"src/libtorchaudio/sox/utils.cpp" did not exist on "732c94a3bd1140eb06e138e41470761e8863cd45"
Commit d38a7854 authored by moto's avatar moto Committed by Facebook GitHub Bot
Browse files

Upgrade to FFmpeg5 (#3298)

Summary:
This commit upgrade the version of FFmpeg compiled against TorchAudio binary distribution to 5.0.4.

FFmpeg 5.0 was released in Jan 2022, and many package managers provide a version of FFmpeg v5.
Conda-forge lists 5.1 for all the platforms TorchAudio supports.https://anaconda.org/conda-forge/ffmpeg

Pull Request resolved: https://github.com/pytorch/audio/pull/3298

Reviewed By: hwangjeff

Differential Revision: D45865599

Pulled By: mthrok

fbshipit-source-id: d95638eb80daaf477a710a992f4ead9b9009bb9b
parent e4c1d70b
......@@ -462,7 +462,7 @@ jobs:
name: smoke test
command: |
source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
conda install 'ffmpeg<5'
conda install 'ffmpeg>=5.0,<6'
./test/smoke_test/run_smoke_test.sh
smoke_test_linux_conda_gpu:
......@@ -485,7 +485,7 @@ jobs:
name: smoke test
command: |
source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
conda install 'ffmpeg<5'
conda install 'ffmpeg>=5.0,<6'
./test/smoke_test/run_smoke_test.sh
smoke_test_linux_pip:
......@@ -537,11 +537,7 @@ jobs:
command: |
eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
conda activate python${PYTHON_VERSION}
if [[ "${PYTHON_VERSION}" == "3.11" ]]; then
conda install -c conda-forge ffmpeg=4.4.2
else
conda install 'ffmpeg<5'
fi
conda install 'ffmpeg>=5.0,<6'
./test/smoke_test/run_smoke_test.sh
smoke_test_windows_conda_gpu:
......@@ -568,7 +564,7 @@ jobs:
conda env remove -n python${PYTHON_VERSION} || true
conda create -yn python${PYTHON_VERSION} python=${PYTHON_VERSION}
conda activate python${PYTHON_VERSION}
conda install -v -y ${CONDA_CHANNEL_FLAGS:-} -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch numpy ffmpeg pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4}
conda install -v -y ${CONDA_CHANNEL_FLAGS:-} -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch numpy 'ffmpeg>=5.0,<6' pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4}
# Install from torchaudio file
conda install -v -y $(ls ~/workspace/conda-bld/win-64/torchaudio*.tar.bz2)
......
......@@ -462,7 +462,7 @@ jobs:
name: smoke test
command: |
source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
conda install 'ffmpeg<5'
conda install 'ffmpeg>=5.0,<6'
./test/smoke_test/run_smoke_test.sh
smoke_test_linux_conda_gpu:
......@@ -485,7 +485,7 @@ jobs:
name: smoke test
command: |
source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
conda install 'ffmpeg<5'
conda install 'ffmpeg>=5.0,<6'
./test/smoke_test/run_smoke_test.sh
smoke_test_linux_pip:
......@@ -537,11 +537,7 @@ jobs:
command: |
eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
conda activate python${PYTHON_VERSION}
if [[ "${PYTHON_VERSION}" == "3.11" ]]; then
conda install -c conda-forge ffmpeg=4.4.2
else
conda install 'ffmpeg<5'
fi
conda install 'ffmpeg>=5.0,<6'
./test/smoke_test/run_smoke_test.sh
smoke_test_windows_conda_gpu:
......@@ -568,7 +564,7 @@ jobs:
conda env remove -n python${PYTHON_VERSION} || true
conda create -yn python${PYTHON_VERSION} python=${PYTHON_VERSION}
conda activate python${PYTHON_VERSION}
conda install -v -y ${CONDA_CHANNEL_FLAGS:-} -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch numpy ffmpeg pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4}
conda install -v -y ${CONDA_CHANNEL_FLAGS:-} -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch numpy 'ffmpeg>=5.0,<6' pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4}
# Install from torchaudio file
conda install -v -y $(ls ~/workspace/conda-bld/win-64/torchaudio*.tar.bz2)
......
......@@ -36,4 +36,4 @@ conda activate "${env_dir}"
# 3. Install minimal build tools
pip --quiet install cmake ninja
conda install --quiet -y 'ffmpeg>=4.1' pkg-config
conda install --quiet -y -c conda-forge 'ffmpeg==5.1' pkg-config
......@@ -35,4 +35,4 @@ conda activate "${env_dir}"
# 3. Install minimal build tools
pip --quiet install cmake ninja
conda install --quiet -y 'ffmpeg>=4.1'
conda install --quiet -y -c conda-forge 'ffmpeg==5.1'
......@@ -61,7 +61,7 @@ jobs:
# Install torchaudio
# TODO: Enable NVDec/NVEnc
conda install --quiet -y 'ffmpeg>=4.1' pkg-config
conda install --quiet -y -c conda-forge 'ffmpeg>=5.0,<6' pkg-config
pip --quiet install cmake>=3.18.0 ninja
cd packaging
. ./pkg_helpers.bash
......
......@@ -55,7 +55,7 @@ jobs:
"${CUDATOOLKIT}"
# Install torchaudio
conda install --quiet -y 'ffmpeg>=4.1' pkg-config
conda install --quiet -y -c conda-forge 'ffmpeg==5.1' pkg-config
python3 -m pip --quiet install cmake>=3.18.0 ninja
USE_FFMPEG=1 python3 -m pip install -v -e . --no-use-pep517
......
......@@ -16,7 +16,7 @@ Please refer to https://pytorch.org/get-started/locally/ for the details.
each of which requires a corresponding PyTorch distribution.
.. note::
This software was compiled against an unmodified copy of FFmpeg (licensed under `the LGPLv2.1 <https://github.com/FFmpeg/FFmpeg/blob/a5d2008e2a2360d351798e9abe883d603e231442/COPYING.LGPLv2.1>`_), with the specific rpath removed so as to enable the use of system libraries. The LGPL source can be downloaded `here <https://github.com/FFmpeg/FFmpeg/releases/tag/n4.1.8>`_.
This software was compiled against an unmodified copy of FFmpeg (licensed under `the LGPLv2.1 <https://github.com/FFmpeg/FFmpeg/blob/0e15444aceca0e78f99f3d67758eb79d11b86599/COPYING.LGPLv2.1>`_), with the specific rpath removed so as to enable the use of system libraries. The LGPL source can be downloaded `here <https://github.com/FFmpeg/FFmpeg/releases/tag/n5.0.3>`_.
Dependencies
------------
......@@ -31,8 +31,8 @@ Optional Dependencies
* `FFmpeg <https://ffmpeg.org>`_.
Required to use :py:mod:`torchaudio.io` module.
TorchAudio official binary distributions are compatible with FFmpeg 4.1 to 4.4.
If you need to use FFmpeg 5, please build TorchAudio from source.
TorchAudio official binary distributions are compatible with FFmpeg 5.
If you need to use FFmpeg 6, please build TorchAudio from source.
* `sentencepiece <https://pypi.org/project/sentencepiece/>`_
......
......@@ -10,11 +10,11 @@ on laptop.
.. note::
This tutorial requires FFmpeg libraries (>=4.1, <4.4) and SentencePiece.
This tutorial requires FFmpeg libraries (>=5.0, <6) and SentencePiece.
There are multiple ways to install FFmpeg libraries.
If you are using Anaconda Python distribution,
``conda install 'ffmpeg<4.4'`` will install
``conda install -c conda-forge 'ffmpeg<6'`` will install
the required FFmpeg libraries.
You can install SentencePiece by running ``pip install sentencepiece``.
......
......@@ -13,11 +13,11 @@ apply various effects and codecs to waveform tensor.
#
# .. note::
#
# This tutorial requires FFmpeg libraries (>=4.1, <5).
# This tutorial requires FFmpeg libraries (>=5.0, <6).
#
# There are multiple ways to install FFmpeg libraries.
# If you are using Anaconda Python distribution,
# ``conda install -c anaconda 'ffmpeg<5'`` will install
# ``conda install -c conda-forge 'ffmpeg<6'`` will install
# the required libraries.
#
......
......@@ -13,11 +13,11 @@ to perform online speech recognition.
#
# .. note::
#
# This tutorial requires FFmpeg libraries (>=4.1, <4.4) and SentencePiece.
# This tutorial requires FFmpeg libraries (>=5, <6) and SentencePiece.
#
# There are multiple ways to install FFmpeg libraries.
# If you are using Anaconda Python distribution,
# ``conda install 'ffmpeg<4.4'`` will install
# ``conda install -c conda-forge 'ffmpeg<6'`` will install
# the required FFmpeg libraries.
#
# You can install SentencePiece by running ``pip install sentencepiece``.
......
......@@ -14,11 +14,11 @@ libavfilter provides.
#
# .. note::
#
# This tutorial requires FFmpeg libraries (>=4.1, <4.4).
# This tutorial requires FFmpeg libraries (>=5.0, <6).
#
# There are multiple ways to install FFmpeg libraries.
# If you are using Anaconda Python distribution,
# ``conda install -c anaconda 'ffmpeg<4.4'`` will install
# ``conda install -c conda-forge 'ffmpeg<6'`` will install
# the required libraries.
#
......
......@@ -23,17 +23,14 @@ play audio and video.
#
# .. note::
#
# This tutorial requires torchaudio nightly build and FFmpeg libraries (>=4.1, <4.4).
#
# To install torchaudio nightly build, please refer to
# https://pytorch.org/get-started/locally/ .
#
# This tutorial requires FFmpeg libraries (>=5.0, <6).
#
# There are multiple ways to install FFmpeg libraries.
# If you are using Anaconda Python distribution,
# ``conda install 'ffmpeg<4.4'`` will install the required FFmpeg libraries,
# however, this distribution does not have SDL plugin, so it cannot play
# video.
# ``conda install -c conda-forge 'ffmpeg<6'`` will install
# the required libraries.
# This distribution, however, does not have SDL plugin, so
# it cannot play video.
#
######################################################################
......
......@@ -13,14 +13,12 @@ encode and save audio/video data into various formats/destinations.
#
# .. note::
#
# This tutorial requires torchaudio nightly build and FFmpeg libraries (>=4.1, <4.4).
#
# To install torchaudio nightly build, please refer to
# https://pytorch.org/get-started/locally/ .
# This tutorial requires FFmpeg libraries (>=5.0, <6).
#
# There are multiple ways to install FFmpeg libraries.
# If you are using Anaconda Python distribution,
# ``conda install 'ffmpeg<4.4'`` will install the required FFmpeg libraries.
# ``conda install -c conda-forge 'ffmpeg<6'`` will install
# the required libraries.
#
######################################################################
......
......@@ -32,7 +32,7 @@ cd "${build_dir}"
# NOTE:
# When changing the version of FFmpeg, update the README so that the link to the source points
# the same version.
curl -LsS -o ffmpeg.tar.gz https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n4.1.8.tar.gz
curl -LsS -o ffmpeg.tar.gz https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n5.0.3.tar.gz
tar -xf ffmpeg.tar.gz --strip-components 1
./configure \
--prefix="${prefix}" \
......@@ -72,11 +72,11 @@ ls ${prefix}/*
# macOS: Fix rpath so that the libraries are searched dynamically in user environment.
# In Linux, this is handled by `--enable-rpath` flag.
if [[ "$(uname)" == Darwin ]]; then
avcodec=libavcodec.58
avdevice=libavdevice.58
avfilter=libavfilter.7
avformat=libavformat.58
avutil=libavutil.56
avcodec=libavcodec.59
avdevice=libavdevice.59
avfilter=libavfilter.8
avformat=libavformat.59
avutil=libavutil.57
otool="/usr/bin/otool"
# NOTE: miniconda has a version of otool and install_name_tool installed and we want
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment