Easiest way to install an older version of ffmpeg for PyTorch

I’m reading the PyTorch tutorial and it’s saying that PyTorch works only with the older versions of ffmpeg. Namely, earlier than 4.4. They suggest installing it through conda:

conda install -c anaconda 'ffmpeg<4.4'

This works perfectly fine other than the fact that the installed ffmpeg does not recognize any of my system’s devices:

ffmpeg -devices
ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7.3.0 (crosstool-NG 1.23.0.449-a04d0)
  configuration: --prefix=/opt/conda/conda-bld/ffmpeg_1597178665428/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh --cc=/opt/conda/conda-bld/ffmpeg_1597178665428/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc --disable-doc --disable-openssl --enable-avresample --enable-gnutls --enable-hardcoded-tables --enable-libfreetype --enable-libopenh264 --enable-pic --enable-pthreads --enable-shared --disable-static --enable-version3 --enable-zlib --enable-libmp3lame
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
Devices:
 D. = Demuxing supported
 .E = Muxing supported
 --
 DE fbdev           Linux framebuffer
 D  lavfi           Libavfilter virtual input device
 DE oss             OSS (Open Sound System) playback
 DE video4linux2,v4l2 Video4Linux2 output device

This is while my system’s original ffmpeg recognizes all:

ffmpeg -devices
ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Devices:
 D. = Demuxing supported
 .E = Muxing supported
 --
 DE alsa            ALSA audio output
 DE fbdev           Linux framebuffer
 D  iec61883        libiec61883 (new DV1394) A/V input device
 D  jack            JACK Audio Connection Kit
 D  kmsgrab         KMS screen capture
 D  lavfi           Libavfilter virtual input device
  E opengl          OpenGL output
 DE oss             OSS (Open Sound System) playback
 DE pulse           Pulse audio output
  E sdl,sdl2        SDL2 output device
 DE video4linux2,v4l2 Video4Linux2 output device
 D  x11grab         X11 screen capture, using XCB
  E xv              XV (XVideo) output device

My question is, how can I install an ffmpeg<4.4 that recognizes my system’s devices? It would be great if I could install it only within a conda environment so I won’t be affecting my whole system.

Thanks.

ffmpeg4.4 is already available in the repositories. Have you tried installing it?

Is it AUR or Official repo? When I search for ffmpeg in Pamac, a huge list of items is returned. I tried looking into some of them but they are mostly version 5.x or even 6. I don’t see any 4. I thought maybe version 4 is considered too old. Can you help me find it?

BTW, it has to be earlier than 4.4. Like 4.3 or 4.2.

pacman -Si ffmpeg4.4

:wink:

Why? python-pytorch dpends on ffmpeg4.4.

This is a quote from their tutorial page:

This tutorial requires FFmpeg libraries (>=4.1, <4.4).

There are multiple ways to install FFmpeg libraries. If you are using Anaconda Python distribution, conda install -c anaconda 'ffmpeg<4.4' will install the required libraries.

I do see ffmpeg4.4 in Manjaro’s Official Repository. In fact, it’s installed on my machine which does not make sense since I have 5.1.2 installed as well! But I don’t see 4.3 or 4.2.

I think you missed my ninja edit:

The documentation may be out of date.

OK, then. But I have another question. Since I already have ffmpeg4.4 installed as well as ffmpeg (which is 2:5.1.2-1 - whatever that means), how can I use the 4.4 version?

Right now, when I try to run the code that is supposed to talk to ffmpeg:

StreamReader(
    src="1",
    format="pulse",
)

It errors out that it cannot find ffmpeg:

RuntimeError: StreamReader requires FFmpeg extension which is not available. Please refer to the stacktrace above for how to resolve this.

While in terminal:

ffmpeg -version
ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12.2.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
libavutil      57. 28.100 / 57. 28.100
libavcodec     59. 37.100 / 59. 37.100
libavformat    59. 27.100 / 59. 27.100
libavdevice    59.  7.100 / 59.  7.100
libavfilter     8. 44.100 /  8. 44.100
libswscale      6.  7.100 /  6.  7.100
libswresample   4.  7.100 /  4.  7.100
libpostproc    56.  6.100 / 56.  6.100

I’m not a Python developer, so that I do not know.

You should be able to specify the paths somewhere: /usr/lib/ffmpeg4.4/ & /usr/include/ffmpeg4.4/.

Perhaps this may help:

Do you know where can I find the executable file for ffmpeg4.4 if I also have ffmpeg 5.1.2 installed? It’s not in any of the two directories you’ve mentioned. Perhaps I can make a symlink to /usr/bin/ffmpeg (which right now is 5.1.2) and fool the Python code!

Looking at the list of files (provided by Pamac) for ffmpeg4.4, I don’t think it comes with an executable file!

/usr/include/ffmpeg4.4/libavcodec/ac3_parser.h
/usr/include/ffmpeg4.4/libavcodec/adts_parser.h
/usr/include/ffmpeg4.4/libavcodec/avcodec.h
/usr/include/ffmpeg4.4/libavcodec/avdct.h
/usr/include/ffmpeg4.4/libavcodec/avfft.h
/usr/include/ffmpeg4.4/libavcodec/bsf.h
/usr/include/ffmpeg4.4/libavcodec/codec.h
/usr/include/ffmpeg4.4/libavcodec/codec_desc.h
/usr/include/ffmpeg4.4/libavcodec/codec_id.h
/usr/include/ffmpeg4.4/libavcodec/codec_par.h
/usr/include/ffmpeg4.4/libavcodec/d3d11va.h
/usr/include/ffmpeg4.4/libavcodec/dirac.h
/usr/include/ffmpeg4.4/libavcodec/dv_profile.h
/usr/include/ffmpeg4.4/libavcodec/dxva2.h
/usr/include/ffmpeg4.4/libavcodec/jni.h
/usr/include/ffmpeg4.4/libavcodec/mediacodec.h
/usr/include/ffmpeg4.4/libavcodec/packet.h
/usr/include/ffmpeg4.4/libavcodec/qsv.h
/usr/include/ffmpeg4.4/libavcodec/vaapi.h
/usr/include/ffmpeg4.4/libavcodec/vdpau.h
/usr/include/ffmpeg4.4/libavcodec/version.h
/usr/include/ffmpeg4.4/libavcodec/videotoolbox.h
/usr/include/ffmpeg4.4/libavcodec/vorbis_parser.h
/usr/include/ffmpeg4.4/libavcodec/xvmc.h
/usr/include/ffmpeg4.4/libavdevice/avdevice.h
/usr/include/ffmpeg4.4/libavdevice/version.h
/usr/include/ffmpeg4.4/libavfilter/avfilter.h
/usr/include/ffmpeg4.4/libavfilter/buffersink.h
/usr/include/ffmpeg4.4/libavfilter/buffersrc.h
/usr/include/ffmpeg4.4/libavfilter/version.h
/usr/include/ffmpeg4.4/libavformat/avformat.h
/usr/include/ffmpeg4.4/libavformat/avio.h
/usr/include/ffmpeg4.4/libavformat/version.h
/usr/include/ffmpeg4.4/libavutil/adler32.h
/usr/include/ffmpeg4.4/libavutil/aes.h
/usr/include/ffmpeg4.4/libavutil/aes_ctr.h
/usr/include/ffmpeg4.4/libavutil/attributes.h
/usr/include/ffmpeg4.4/libavutil/audio_fifo.h
/usr/include/ffmpeg4.4/libavutil/avassert.h
/usr/include/ffmpeg4.4/libavutil/avconfig.h
/usr/include/ffmpeg4.4/libavutil/avstring.h
/usr/include/ffmpeg4.4/libavutil/avutil.h
/usr/include/ffmpeg4.4/libavutil/base64.h
/usr/include/ffmpeg4.4/libavutil/blowfish.h
/usr/include/ffmpeg4.4/libavutil/bprint.h
/usr/include/ffmpeg4.4/libavutil/bswap.h
/usr/include/ffmpeg4.4/libavutil/buffer.h
/usr/include/ffmpeg4.4/libavutil/camellia.h
/usr/include/ffmpeg4.4/libavutil/cast5.h
/usr/include/ffmpeg4.4/libavutil/channel_layout.h
/usr/include/ffmpeg4.4/libavutil/common.h
/usr/include/ffmpeg4.4/libavutil/cpu.h
/usr/include/ffmpeg4.4/libavutil/crc.h
/usr/include/ffmpeg4.4/libavutil/des.h
/usr/include/ffmpeg4.4/libavutil/dict.h
/usr/include/ffmpeg4.4/libavutil/display.h
/usr/include/ffmpeg4.4/libavutil/dovi_meta.h
/usr/include/ffmpeg4.4/libavutil/downmix_info.h
/usr/include/ffmpeg4.4/libavutil/encryption_info.h
/usr/include/ffmpeg4.4/libavutil/error.h
/usr/include/ffmpeg4.4/libavutil/eval.h
/usr/include/ffmpeg4.4/libavutil/ffversion.h
/usr/include/ffmpeg4.4/libavutil/fifo.h
/usr/include/ffmpeg4.4/libavutil/file.h
/usr/include/ffmpeg4.4/libavutil/film_grain_params.h
/usr/include/ffmpeg4.4/libavutil/frame.h
/usr/include/ffmpeg4.4/libavutil/hash.h
/usr/include/ffmpeg4.4/libavutil/hdr_dynamic_metadata.h
/usr/include/ffmpeg4.4/libavutil/hmac.h
/usr/include/ffmpeg4.4/libavutil/hwcontext.h
/usr/include/ffmpeg4.4/libavutil/hwcontext_cuda.h
/usr/include/ffmpeg4.4/libavutil/hwcontext_d3d11va.h
/usr/include/ffmpeg4.4/libavutil/hwcontext_drm.h
/usr/include/ffmpeg4.4/libavutil/hwcontext_dxva2.h
/usr/include/ffmpeg4.4/libavutil/hwcontext_mediacodec.h
/usr/include/ffmpeg4.4/libavutil/hwcontext_opencl.h
/usr/include/ffmpeg4.4/libavutil/hwcontext_qsv.h
/usr/include/ffmpeg4.4/libavutil/hwcontext_vaapi.h
/usr/include/ffmpeg4.4/libavutil/hwcontext_vdpau.h
/usr/include/ffmpeg4.4/libavutil/hwcontext_videotoolbox.h
/usr/include/ffmpeg4.4/libavutil/hwcontext_vulkan.h
/usr/include/ffmpeg4.4/libavutil/imgutils.h
/usr/include/ffmpeg4.4/libavutil/intfloat.h
/usr/include/ffmpeg4.4/libavutil/intreadwrite.h
/usr/include/ffmpeg4.4/libavutil/lfg.h
/usr/include/ffmpeg4.4/libavutil/log.h
/usr/include/ffmpeg4.4/libavutil/lzo.h
/usr/include/ffmpeg4.4/libavutil/macros.h
/usr/include/ffmpeg4.4/libavutil/mastering_display_metadata.h
/usr/include/ffmpeg4.4/libavutil/mathematics.h
/usr/include/ffmpeg4.4/libavutil/md5.h
/usr/include/ffmpeg4.4/libavutil/mem.h
/usr/include/ffmpeg4.4/libavutil/motion_vector.h
/usr/include/ffmpeg4.4/libavutil/murmur3.h
/usr/include/ffmpeg4.4/libavutil/opt.h
/usr/include/ffmpeg4.4/libavutil/parseutils.h
/usr/include/ffmpeg4.4/libavutil/pixdesc.h
/usr/include/ffmpeg4.4/libavutil/pixelutils.h
/usr/include/ffmpeg4.4/libavutil/pixfmt.h
/usr/include/ffmpeg4.4/libavutil/random_seed.h
/usr/include/ffmpeg4.4/libavutil/rational.h
/usr/include/ffmpeg4.4/libavutil/rc4.h
/usr/include/ffmpeg4.4/libavutil/replaygain.h
/usr/include/ffmpeg4.4/libavutil/ripemd.h
/usr/include/ffmpeg4.4/libavutil/samplefmt.h
/usr/include/ffmpeg4.4/libavutil/sha.h
/usr/include/ffmpeg4.4/libavutil/sha512.h
/usr/include/ffmpeg4.4/libavutil/spherical.h
/usr/include/ffmpeg4.4/libavutil/stereo3d.h
/usr/include/ffmpeg4.4/libavutil/tea.h
/usr/include/ffmpeg4.4/libavutil/threadmessage.h
/usr/include/ffmpeg4.4/libavutil/time.h
/usr/include/ffmpeg4.4/libavutil/timecode.h
/usr/include/ffmpeg4.4/libavutil/timestamp.h
/usr/include/ffmpeg4.4/libavutil/tree.h
/usr/include/ffmpeg4.4/libavutil/twofish.h
/usr/include/ffmpeg4.4/libavutil/tx.h
/usr/include/ffmpeg4.4/libavutil/version.h
/usr/include/ffmpeg4.4/libavutil/video_enc_params.h
/usr/include/ffmpeg4.4/libavutil/xtea.h
/usr/include/ffmpeg4.4/libpostproc/postprocess.h
/usr/include/ffmpeg4.4/libpostproc/version.h
/usr/include/ffmpeg4.4/libswresample/swresample.h
/usr/include/ffmpeg4.4/libswresample/version.h
/usr/include/ffmpeg4.4/libswscale/swscale.h
/usr/include/ffmpeg4.4/libswscale/version.h
/usr/lib/ffmpeg4.4/libavcodec.so
/usr/lib/ffmpeg4.4/libavdevice.so
/usr/lib/ffmpeg4.4/libavfilter.so
/usr/lib/ffmpeg4.4/libavformat.so
/usr/lib/ffmpeg4.4/libavutil.so
/usr/lib/ffmpeg4.4/libpostproc.so
/usr/lib/ffmpeg4.4/libswresample.so
/usr/lib/ffmpeg4.4/libswscale.so
/usr/lib/ffmpeg4.4/pkgconfig/libavcodec.pc
/usr/lib/ffmpeg4.4/pkgconfig/libavdevice.pc
/usr/lib/ffmpeg4.4/pkgconfig/libavfilter.pc
/usr/lib/ffmpeg4.4/pkgconfig/libavformat.pc
/usr/lib/ffmpeg4.4/pkgconfig/libavutil.pc
/usr/lib/ffmpeg4.4/pkgconfig/libpostproc.pc
/usr/lib/ffmpeg4.4/pkgconfig/libswresample.pc
/usr/lib/ffmpeg4.4/pkgconfig/libswscale.pc
/usr/lib/libavcodec.so.58
/usr/lib/libavcodec.so.58.134.100
/usr/lib/libavdevice.so.58
/usr/lib/libavdevice.so.58.13.100
/usr/lib/libavfilter.so.7
/usr/lib/libavfilter.so.7.110.100
/usr/lib/libavformat.so.58
/usr/lib/libavformat.so.58.76.100
/usr/lib/libavutil.so.56
/usr/lib/libavutil.so.56.70.100
/usr/lib/libpostproc.so.55
/usr/lib/libpostproc.so.55.9.100
/usr/lib/libswresample.so.3
/usr/lib/libswresample.so.3.9.100
/usr/lib/libswscale.so.5
/usr/lib/libswscale.so.5.9.100

No, don’t do that. There is no separate binary in the ffmpeg4.4 package as you noticed. That’s on purpose.

I know how to build a package to tell it to use ffmpeg4.4 instead of the default ffmpeg, but unfortunately that’s the end of my knowledge. Hopefully someone else more knowledgeable can chime in.

The mix of local and system packages can be problematic when developing. That’s why it’s best to develop in a virtual environment as suggested in the tutorial I linked above.

I really appreciate your help, @Yochanan . I’ve made some progress but I could still use some help. It would be great if you could guide me for this last step as well.

After our conversation here, I thought it might be better if I try to compile ffmpeg4.4 from source. Especially since I saw where conda was installing its own ffmpeg. This way I’ll be making a change to the ffmpeg within conda environment and not the whole system.

A quick search showed me where conda was keeping its ffmpeg package:

$ find ~ -name "ffmpeg*" 
/home/mehran/.local/share/icons/Papirus/32x32/apps/ffmpeg.svg
/home/mehran/.local/share/icons/Papirus/64x64/apps/ffmpeg.svg
/home/mehran/.local/share/icons/Papirus/16x16/apps/ffmpeg.svg
/home/mehran/.local/share/icons/Papirus/48x48/apps/ffmpeg.svg
/home/mehran/.local/share/icons/Papirus/24x24/apps/ffmpeg.svg
/home/mehran/.local/share/icons/Papirus/22x22/apps/ffmpeg.svg
/home/mehran/.conda/pkgs/torchaudio-2.0.0-py310_cu118/info/test/test/torchaudio_unittest/utils/ffmpeg_utils_test.py
/home/mehran/.conda/pkgs/torchaudio-2.0.0-py310_cu118/info/test/test/torchaudio_unittest/backend/dispatcher/ffmpeg
/home/mehran/.conda/pkgs/torchaudio-2.0.0-py310_cu118/lib/python3.10/site-packages/torchaudio/utils/ffmpeg_utils.py
/home/mehran/.conda/pkgs/torchaudio-2.0.0-py310_cu118/lib/python3.10/site-packages/torchaudio/utils/__pycache__/ffmpeg_utils.cpython-310.pyc
/home/mehran/.conda/pkgs/qt-main-5.15.2-h327a75a_7/share/qt/3rd_party_licenses/qtwebengine/src/3rdparty/chromium/third_party/ffmpeg
/home/mehran/.conda/pkgs/ffmpeg-4.2.2-h20bf706_0
/home/mehran/.conda/pkgs/ffmpeg-4.2.2-h20bf706_0/share/ffmpeg
/home/mehran/.conda/pkgs/ffmpeg-4.2.2-h20bf706_0/bin/ffmpeg
/home/mehran/.conda/pkgs/ffmpeg-4.2.2-h20bf706_0.tar.bz2
/home/mehran/.conda/pkgs/ffmpeg-4.3-hf484d3e_0
/home/mehran/.conda/pkgs/ffmpeg-4.3-hf484d3e_0/share/ffmpeg
/home/mehran/.conda/pkgs/ffmpeg-4.3-hf484d3e_0/bin/ffmpeg
/home/mehran/.conda/pkgs/ffmpeg-4.3-hf484d3e_0.tar.bz2
/home/mehran/.conda/envs/pytorch/conda-meta/ffmpeg-4.2.2-h20bf706_0.json
/home/mehran/.conda/envs/pytorch/share/qt/3rd_party_licenses/qtwebengine/src/3rdparty/chromium/third_party/ffmpeg
/home/mehran/.conda/envs/pytorch/share/ffmpeg
/home/mehran/.conda/envs/pytorch/bin/ffmpeg
/home/mehran/.conda/envs/pytorch/lib/python3.10/site-packages/torchaudio/utils/ffmpeg_utils.py
/home/mehran/.conda/envs/pytorch/lib/python3.10/site-packages/torchaudio/utils/__pycache__/ffmpeg_utils.cpython-310.pyc

Also, after activating conda environment, I can see that the ffmpeg is pointing to conda’s package instead of the system’s:

$ conda activate pytorch
$ which ffmpeg          
/home/mehran/.conda/envs/pytorch/bin/ffmpeg

So I downloaded the ffmpeg 4.4.3 from Github and:

$ cd ~/Downloads/FFmpeg-n4.4.3
$ ./configure --enable-libjack --enable-libpulse --enable-opengl --prefix=/home/mehran/.conda/pkgs/ffmpeg-4.4.3
$ make
$ make install

(I omitted the commands’ outputs for the sake of clarity)

Now, I have ffmpeg 4.4.3 compiled as a package within conda. But still the binary that is executed when I run ffmpeg is at /home/mehran/.conda/envs/pytorch/bin/ffmpeg. When I ls that file, it shows as regular file and not a symlink. So, I’m not sure how should I make it to point to my new 4.4.3? Can you please help me figure this out? Should I simply copy my new ffmpeg from the ffmpeg-4.4.3/bin folder and replace it with /home/mehran/.conda/envs/pytorch/bin/ffmpeg? Or maybe a symlink?

Seems like it’s not that easy! After replacing the executable file for ffmpeg with the one I compiled myself, even though running ffmpeg -version shows what I would like to see, but still, PyTorch sees the old version. Perhaps there’s more to it than just the executable file path. Who knew?

OK, I tried another approach. I tried to install the PyTorch packages from the Manjaro (/Arch) repositories. This is what I have now:

pacman -Q | grep torch
python-pytorch 1.13.1-3
python-torchaudio 2.0.1-1
python-torchvision 0.14.1-1

It’s not ideal since the PyTorch package is not the latest but that’s OK. Also, the python-torchaudio is an AUR package. The problem is that now, the python code does not see the ffmpeg:

from torchaudio.utils.ffmpeg_utils import get_input_devices

for k, v in get_input_devices().items():
    print(f"{k}: {v}")
RuntimeError: get_input_devices requires FFmpeg extension which is not available. Please refer to the stacktrace above for how to resolve this.

Apparently, the PyTorch packages are not compiled with ffmpeg.

They are indeed compiled with FFmpeg. You did this, remember?

If you’re going to use the system packages, then you’ll need to revert what you did.

❯ which ffmpeg
/usr/bin/ffmpeg

The ffmpeg package I compiled is gone. I installed it into a conda environment which I deleted (it never replaced the system’s ffmpeg). Then I installed the PyTorch packages above.

So right now:

which ffmpeg
/usr/bin/ffmpeg

More assurance:

❯ ffmpeg -devices
ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Devices:
 D. = Demuxing supported
 .E = Muxing supported
 --
 DE alsa            ALSA audio output
 DE fbdev           Linux framebuffer
 D  iec61883        libiec61883 (new DV1394) A/V input device
 D  jack            JACK Audio Connection Kit
 D  kmsgrab         KMS screen capture
 D  lavfi           Libavfilter virtual input device
  E opengl          OpenGL output
 DE oss             OSS (Open Sound System) playback
 DE pulse           Pulse audio output
  E sdl,sdl2        SDL2 output device
 DE video4linux2,v4l2 Video4Linux2 output device
 D  x11grab         X11 screen capture, using XCB
  E xv              XV (XVideo) output device