ubuntu 未知的编码器“libx264”

svgewumm  于 5个月前  发布在  其他
关注(0)|答案(3)|浏览(101)

我在ubuntu 11上安装了ffmpeg 0.8.9,
./configure --enable-gpl --enable-nonfree --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libx264
当我运行它时

ffmpeg -y -i test.mp4 -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -vcodec libx264 -b 250k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 250k -maxrate 250k -bufsize 250k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect 320:240 -g 30 -async 2 a.ts

字符串
它说
未知的编码器“libx 264”
(Note:avconv也可能发生同样的错误)
我该怎么解决这个问题?谢谢!

clj7thdc

clj7thdc1#

我使用的是Ubuntu 11.04,我也遇到了这个错误-Unknown encoder 'libx264'。安装软件包libavcodec-extra-53解决了这个问题。
在Ubuntu 14.04 LTS中,所需的软件包称为libavcodec-extra-54(和libav-tools

avkwfej4

avkwfej42#

首先安装这些库

sudo apt-get install libfdk-aac-dev libass-dev libopus-dev  \
libtheora-dev libvorbis-dev libvpx-dev libssl-dev

字符串
Ubuntu 20.04版本

sudo apt-get install nasm


然后跳过这个手动的nasm安装.但是从Ubuntu 17.04 sudo apt-get install nasm开始,没有提供足够的新nasm,所以手动安装
http://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D上获取nasm的源代码下载最新版本,然后

cd ~/src/nasm-2.13.02  #  update to release you just downloaded
./configure
make -j $(nproc)
sudo make install


对于x264:

git clone https://code.videolan.org/videolan/x264.git
cd x264
./configure --enable-static --enable-shared
make -j $(nproc)
sudo make install


对于mp3获取LAME(libmp 3lame)

sudo apt-get install libmp3lame-dev


或从http://lame.sourceforge.net/版本v3.100手动安装,然后给予正常

cd lame-3.100/
./configure
make -j $(nproc)
sudo make install


最后下载ffmpeg源码并安装:

git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg

./configure  --enable-gpl   --enable-libass   --enable-libfdk-aac   --enable-libfreetype   --enable-libmp3lame   --enable-libopus   --enable-libtheora   --enable-libvorbis   --enable-libvpx   --enable-libx264   --enable-nonfree --enable-shared --enable-openssl   

make -j $(nproc)
sudo make install


我能感受到你的痛苦,但这是有效的-在Ubuntu 22.04上仍然有效

xienkqul

xienkqul3#

我在使用OpenAI Gym时遇到了Ubuntu 18的这个错误。你需要正确版本的ffmpeg和x264编码器。为了得到它们,我使用了以下命令,它工作了:

conda install x264=='1!152.20180717' ffmpeg=4.0.2 -c conda-forge

字符串

相关问题