diff --git a/docs/source/build.jetson.rst b/docs/source/build.jetson.rst index ba8eb38bf8..736d7a58bb 100644 --- a/docs/source/build.jetson.rst +++ b/docs/source/build.jetson.rst @@ -128,7 +128,7 @@ Verify the installation by checking the version and CUDA device accessibility. .. code-block:: - sudo apt install ffmpeg libavformat-dev libavcodec-dev libavutil-dev libavdevice-dev libavfilter-dev + sudo apt install libavformat-dev libavcodec-dev libavutil-dev libavdevice-dev libavfilter-dev 3. Build TorchAudio ~~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/build.linux.rst b/docs/source/build.linux.rst index 0809293822..f9786f2623 100644 --- a/docs/source/build.linux.rst +++ b/docs/source/build.linux.rst @@ -44,17 +44,3 @@ Here, we install nightly build. To use ``pip``, please use ``--no-use-pep517`` option. ``pip install -v -e . --no-use-pep517`` - -[Optional] Build TorchAudio with a custom built FFmpeg ------------------------------------------------------- - -By default, torchaudio tries to build FFmpeg extension with support for multiple FFmpeg versions. This process uses pre-built FFmpeg libraries compiled for specific CPU architectures like ``x86_64`` and ``aarch64`` (``arm64``). - -If your CPU is not one of those, then the build process can fail. To workaround, one can disable FFmpeg integration (by setting the environment variable ``USE_FFMPEG=0``) or switch to the single version FFmpeg extension. - -To build single version FFmpeg extension, FFmpeg binaries must be provided by user and available in the build environment. To do so, install FFmpeg and set ``FFMPEG_ROOT`` environment variable to specify the location of FFmpeg. - -.. code-block:: - - conda install -c conda-forge ffmpeg - FFMPEG_ROOT=${CONDA_PREFIX} pip install -e . -v --no-build-isolation diff --git a/docs/source/build.rst b/docs/source/build.rst index f1f80ece28..a0aa2a2820 100644 --- a/docs/source/build.rst +++ b/docs/source/build.rst @@ -1,7 +1,7 @@ Building from source ==================== -TorchAudio integrates PyTorch for numerical computation and third party libraries for multimedia I/O. It requires the following tools to build from source. +TorchAudio integrates PyTorch for numerical computation. It requires the following tools to build from source. - `PyTorch `_ - `CMake `_ @@ -22,15 +22,12 @@ TorchAudio integrates PyTorch for numerical computation and third party librarie Customizing the build --------------------- -TorchAudio's integration with third party libraries can be enabled/disabled via +Optional features of torchaudio can be enabled/disabled via environment variables. They can be enabled by passing ``1`` and disabled by ``0``. -- ``BUILD_SOX``: Enable/disable I/O features based on libsox. -- ``BUILD_KALDI``: Enable/disable feature extraction based on Kaldi. - ``BUILD_RNNT``: Enable/disable custom RNN-T loss function. -- ``USE_FFMPEG``: Enable/disable I/O features based on FFmpeg libraries. - ``USE_ROCM``: Enable/disable AMD ROCm support. - ``USE_CUDA``: Enable/disable CUDA support. diff --git a/docs/source/build.windows.rst b/docs/source/build.windows.rst index 88e072d910..128158c0f3 100644 --- a/docs/source/build.windows.rst +++ b/docs/source/build.windows.rst @@ -131,102 +131,3 @@ Now that we have everything ready, we can build TorchAudio. To use ``pip``, please use ``--no-use-pep517`` option. ``pip install -v -e . --no-use-pep517`` - -[Optional] Build TorchAudio with a custom FFmpeg ------------------------------------------------- - -By default, torchaudio tries to build FFmpeg extension with support for multiple FFmpeg versions. This process uses pre-built FFmpeg libraries compiled for specific CPU architectures like ``x86_64``. - -If your CPU is different, then the build process can fail. To workaround, one can disable FFmpeg integration (by setting the environment variable ``USE_FFMPEG=0``) or switch to the single version FFmpeg extension. - -To build single version FFmpeg extension, FFmpeg binaries must be provided by user and available in the build environment. To do so, install FFmpeg and set ``FFMPEG_ROOT`` environment variable to specify the location of FFmpeg. - -.. code-block:: - - conda install -c conda-forge ffmpeg - FFMPEG_ROOT=${CONDA_PREFIX}/Library pip install -e . -v --no-build-isolation - - -[Optional] Building FFmpeg from source --------------------------------------- - -The following section illustrates a way to build FFmpeg libraries from source. - -Conda-forge's FFmpeg package comes with support for major codecs and GPU decoders, so regular users and developers do not need to build FFmpeg from source. - -If you are not using Conda, then you can either find a pre-built binary distribution or build FFmpeg by yourself. - -Also, in case torchaudio developer needs to update and customize the CI for FFmpeg build, this section might be helpful. - -1. Install MSYS2 -~~~~~~~~~~~~~~~~ - -To build FFmpeg in a way it is usable from the TorchAudio development environment, we need to build binaries native to ``MINGW64``. To do so, we need tools required by FFmpeg's build process, such as ``pkg-config`` and ``make``, that work in ``MINGW64`` environment. For this purpose, we use MSYS2. - -FFmpeg's official documentation touches this https://trac.ffmpeg.org/wiki/CompilationGuide/MinGW - -Please follow the instruction at https://www.msys2.org/ to install MSYS2. - -.. note:: - - In CI environment, often `Chocolatery `_ can be used to install MSYS2. - -2. Launch MSYS2 -~~~~~~~~~~~~~~~ - -Use the shortcut to launch MSYS2 (MINGW64). - -.. image:: https://download.pytorch.org/torchaudio/doc-assets/windows-msys2.png - :width: 360px - -.. note:: - - The Bash environment in MSYS2 does not play well with Conda env, so do not add Conda initialization script in ``~/.bashrc`` of MSYS2 environment. (i.e. ``C:\msys2\home\USER\.bashrc``) Instead, add it in ``C:\Users\USER\.bashrc``) - -3. Install build tools -~~~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: - - $ pacman -S mingw-w64-x86_64-make - $ pacman -S mingw-w64-x86_64-yasm - -After the installation, you should have packages similar to the following; - -.. code-block:: - - $ pacman -Qe - base 2020.12-1 - base-devel 2022.01-2 - filesystem 2023.01-2 - mingw-w64-x86_64-make 4.3-1 - mingw-w64-x86_64-pkgconf 1.8.0-2 - mingw-w64-x86_64-yasm 1.3.0-4 - msys2-runtime 3.4.3-5 - -4. Build FFmpeg -~~~~~~~~~~~~~~~ - -Check out FFmpeg source code. - -.. code-block:: - - git clone https://github.com/ffmpeg/ffmpeg - cd ffmpeg - git checkout - -Build - -.. code-block:: - - ./configure --toolchain=msvc - make -j - -If the build succeeds, ``ffmpeg.exe`` should be found in the same directory. Make sure that you can run it. - -5. Verify the build -~~~~~~~~~~~~~~~~~~~ - -Check that the resulting FFmpeg binary is accessible from Conda env - -Now launch a new command prompt and enable the TorchAudio development environment. Make sure that you can run the ``ffmpeg.exe`` command generated in the previous step. diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 3135dabb4d..115b977cd1 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -15,9 +15,6 @@ Please refer to https://pytorch.org/get-started/locally/ for the details. Starting ``0.10``, torchaudio has CPU-only and CUDA-enabled binary distributions, each of which requires a corresponding PyTorch distribution. -.. note:: - This software was compiled against an unmodified copies of FFmpeg, with the specific rpath removed so as to enable the use of system libraries. The LGPL source can be downloaded from the following locations: `n4.1.8 `__ (`license `__), `n5.0.3 `__ (`license `__) and `n6.0 `__ (`license `__). - Dependencies ------------ @@ -30,49 +27,6 @@ Dependencies Optional Dependencies ~~~~~~~~~~~~~~~~~~~~~ -.. _ffmpeg_dependency: - -* `FFmpeg `__ - - Starting version 2.1, TorchAudio official binary distributions are compatible with - FFmpeg version 6, 5 and 4. (>=4.4, <7). At runtime, TorchAudio first looks for FFmpeg 6, - if not found, then it continues to looks for 5 and move on to 4. - - There are multiple ways to install FFmpeg libraries. - Please refer to the official documentation for how to install FFmpeg. - If you are using Anaconda Python distribution, - ``conda install -c conda-forge 'ffmpeg<7'`` will install - compatible FFmpeg libraries. - - If you need to specify the version of FFmpeg TorchAudio searches and links, you can - specify it via the environment variable ``TORIO_USE_FFMPEG_VERSION``. For example, - by setting ``TORIO_USE_FFMPEG_VERSION=5``, TorchAudio will only look for FFmpeg - 5. - - If for some reason, this search mechanism is causing an issue, you can disable - the FFmpeg integration entirely by setting the environment variable - ``TORIO_USE_FFMPEG=0``. - - There are multiple ways to install FFmpeg libraries. - If you are using Anaconda Python distribution, - ``conda install -c conda-forge 'ffmpeg<7'`` will install - compatible FFmpeg libraries. - - .. note:: - - When searching for FFmpeg installation, TorchAudio looks for library files - which have names with version numbers. - That is, ``libavutil.so.`` for Linux, ``libavutil..dylib`` - for macOS, and ``avutil-.dll`` for Windows. - Many public pre-built binaries follow this naming scheme, but some distributions - have un-versioned file names. - If you are having difficulties detecting FFmpeg, double check that the library - files you installed follow this naming scheme, (and then make sure - that they are in one of the directories listed in library search path.) - -* `SoundFile `__ - - Required to use ``backend="soundfile"`` in `I/O functions <./torchaudio.html#i-o>`__. * `sentencepiece `__