-
Notifications
You must be signed in to change notification settings - Fork 1.4k
FFmpeg version issue in Ubuntu #941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
follow my suggestions in issue #727 :) |
I don't understand the meaning of this issue. Did you follow the recommended instructions for installation? Download our source code: git clone https://github.com/huggingface/lerobot.git
cd lerobot Create a virtual environment with Python 3.10 and activate it, e.g. with conda create -y -n lerobot python=3.10
conda activate lerobot When using conda install ffmpeg Install 🤗 LeRobot: pip install --no-binary=av -e .
This should install ffmpeg 6.1.1. The issue of having ffmpeg 7 is that it is not compatible with the version packaged by opencv |
Here's what I have noticed. Just running conda install ffmpeg installs ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 11.2.0 (Anaconda gcc)
configuration: --prefix=/home/interbotix/miniconda3/envs/ffmpeg_test --cc=/croot/ffmpeg_1743153284778/_build_env/bin/x86_64-conda-linux-gnu-cc --ar=/croot/ffmpeg_1743153284778/_build_env/bin/x86_64-conda-linux-gnu-ar --nm=/croot/ffmpeg_1743153284778/_build_env/bin/x86_64-conda-linux-gnu-nm --ranlib=/croot/ffmpeg_1743153284778/_build_env/bin/x86_64-conda-linux-gnu-ranlib --strip=/croot/ffmpeg_1743153284778/_build_env/bin/x86_64-conda-linux-gnu-strip --disable-doc --enable-swresample --enable-swscale --enable-openssl --enable-libxml2 --enable-libtheora --enable-demuxer=dash --enable-postproc --enable-hardcoded-tables --enable-libfreetype --enable-libharfbuzz --enable-libfontconfig --enable-libdav1d --enable-zlib --enable-libaom --enable-pic --enable-shared --disable-static --disable-gpl --enable-version3 --disable-sdl2 --enable-libopenh264 --enable-libopus --enable-libmp3lame --enable-libopenjpeg --enable-libvorbis --enable-pthreads --enable-libtesseract --enable-libvpx
libavutil 58. 29.100 / 58. 29.100
libavcodec 60. 31.102 / 60. 31.102
libavformat 60. 16.100 / 60. 16.100
libavdevice 60. 3.100 / 60. 3.100
libavfilter 9. 12.100 / 9. 12.100
libswscale 7. 5.100 / 7. 5.100
libswresample 4. 12.100 / 4. 12.100
V....D libaom-av1 libaom AV1 (codec av1)
V....D libopenh264 OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
VF.... libopenjpeg OpenJPEG JPEG 2000 (codec jpeg2000)
V....D libtheora libtheora Theora (codec theora)
V....D libvpx libvpx VP8 (codec vp8)
V....D libvpx-vp9 libvpx VP9 (codec vp9)
VF...D zlib LCL (LossLess Codec Library) ZLIB
A....D libmp3lame libmp3lame MP3 (MPEG audio layer 3) (codec mp3)
A....D libopus libopus Opus (codec opus)
A....D libvorbis libvorbis (codec vorbis) Installing ffmpeg using ffmpeg version 7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 13.3.0 (conda-forge gcc 13.3.0-2)
configuration: --prefix=/home/interbotix/miniconda3/envs/lerobot_trossen_env --cc=/home/conda/feedstock_root/build_artifacts/ffmpeg_1743376049581/_build_env/bin/x86_64-conda-linux-gnu-cc --cxx=/home/conda/feedstock_root/build_artifacts/ffmpeg_1743376049581/_build_env/bin/x86_64-conda-linux-gnu-c++ --nm=/home/conda/feedstock_root/build_artifacts/ffmpeg_1743376049581/_build_env/bin/x86_64-conda-linux-gnu-nm --ar=/home/conda/feedstock_root/build_artifacts/ffmpeg_1743376049581/_build_env/bin/x86_64-conda-linux-gnu-ar --disable-doc --enable-openssl --enable-demuxer=dash --enable-hardcoded-tables --enable-libfreetype --enable-libharfbuzz --enable-libfontconfig --enable-libopenh264 --enable-libdav1d --disable-gnutls --enable-libvpx --enable-libass --enable-pthreads --enable-alsa --enable-libpulse --enable-vaapi --enable-libopenvino --enable-gpl --enable-libx264 --enable-libx265 --enable-libmp3lame --enable-libaom --enable-libsvtav1 --enable-libxml2 --enable-pic --enable-shared --disable-static --enable-version3 --enable-zlib --enable-libvorbis --enable-libopus --enable-librsvg --enable-ffplay --pkg-config=/home/conda/feedstock_root/build_artifacts/ffmpeg_1743376049581/_build_env/bin/pkg-config
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.101 / 61. 19.101
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
V....D libaom-av1 libaom AV1 (codec av1)
V..... libsvtav1 SVT-AV1(Scalable Video Technology for AV1) encoder (codec av1)
V....D libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
V....D libx264rgb libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264)
V....D libopenh264 OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
V....D libx265 libx265 H.265 / HEVC (codec hevc)
V....D libvpx libvpx VP8 (codec vp8)
V....D libvpx-vp9 libvpx VP9 (codec vp9)
VF...D zlib LCL (LossLess Codec Library) ZLIB
A....D libmp3lame libmp3lame MP3 (MPEG audio layer 3) (codec mp3)
A....D libopus libopus Opus (codec opus)
A....D libvorbis libvorbis (codec vorbis) Using ffmpeg 6.1.1 results in encoder not found issue as mentioned in
I'm using Linux 22.04 , and I don't face any issues with pyav installations as I have downloaded all the required packages as mentioned in the Readme. I hope this information helps. @imstevenpmwork |
Hi, I am using Ubuntu 22.04, and I also faced the same av build issue of using ffmpeg==7.1.1. I am new to this repository, so I haven't run anything to face the encoder issue yet. |
Thank you for the detailed explanation. It looks like this is an additional challenge on top of the previous dependency version conflicts and the After checking, I confirm that the conda-installed FFmpeg doesn’t include Interestingly, on Ubuntu 24, installing FFmpeg via One caveat: Ubuntu 22’s default APT repository installs FFmpeg 4.X, so we’d need separate instructions for that version. |
This is really a nice suggestion:
|
Here's an update, I tried a few things and noticed that the order of installation really matters. Here's the workflow that works for me on Linux 22.04.
conda create -n lerobot python=3.10 -y
conda activate lerobot
pip install --no-binary=av -e ".[dynamixel, intelrealsense]"
conda install -c conda-forge ffmpeg -y How this help, this allows you to build pyav from source without getting this error src/av/option.c: In function ‘__pyx_pymod_exec_option’:
src/av/option.c:7416:51: error: ‘AV_OPT_TYPE_CHANNEL_LAYOUT’ undeclared (first use in this function); did you mean ‘AV_OPT_TYPE_CHLAYOUT’?
7416 | __pyx_t_3 = __Pyx_PyInt_From_enum__AVOptionType(AV_OPT_TYPE_CHANNEL_LAYOUT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| AV_OPT_TYPE_CHLAYOUT
src/av/option.c:7416:51: note: each undeclared identifier is reported only once for each function it appears in
error: command '/usr/bin/gcc' failed with exit code 1
[end of output] Installing ffmpeg later allows you to get the correct version of ffmpeg that supports Note: Here's why the previous solution worked Isuccessfully build pyav from source in one of my environments, whihc was then cached, this cached version was used in the other environments as well, therefore, I didn't run into the pyav not built error. When I used |
Nice solution! I believe this time it will work. You found the root cause. I will try it out soon. Thanks a lot, Shantanuparab! |
We're working on a more elaborated solution, I recommend you to give first this PR a try (from a fresh environment and following the new installation instructions in the main readme): #903 |
Hello! I created an issue #964 as I have having some related issues. Using the fixes provided by @shantanuparab-tr I had done
I have mentioned the versions for thanks |
I was testing against /feat/ branch. Then I noticed that it is brought to main. Then I tested main branch again. At least so far, I do not have any issue with FFmpeg version any more. I would like to close this issue. Thanks a lot, all! |
OS: Ubuntu 22.0.4
python: 3.10
virtual env: miniconda
ffmpeg: 7.1.1
open CV: 4.11
av == 14.2.0
torchvision == 0.21.0
av and torchvision were default. After update to above version, they gave the same result.
Issue: In order to record video, newest FFmpeg is a must since certain encoder is used. When I do the following command:
pip install --no-binary=av -e ".[feetech]"
or
pip install --no-binary=av -e .
Terminal gave the same output as follow, which indicate: " error: ‘AV_OPT_TYPE_CHANNEL_LAYOUT’ undeclared (first use in this function); did you mean ‘AV_OPT_TYPE_CHLAYOUT’? "
"
Possible reason is: FFmpeg changed AV_OPT_TYPE_CHANNEL_LAYOUT into AV_OPT_TYPE_CHLAYOUT in new version. It is not compatible in PyAV.
Suggetion: can we have more control of versions by writing a requirement.txt indicating wanted package versions in order to avoid conflicts?A complete package list can be exported from a successful environment using a json file.
The following paragraphs are the terminal outputs:
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for av
Successfully built lerobot
Failed to build av
ERROR: Failed to build installable wheels for some pyproject.toml based projects (av)
(lerobot) guyu@GuLinux:~/Documents/5_lerobot/lerobot$
Originally posted by @shantanuparab-tr in #679
The text was updated successfully, but these errors were encountered: