I had a request to install latest ffmpeg on one of our Cnetos 5 servers the other day. Since I’m trying to stick the the proper package management I’ve had to look for the most recent ffmpeg RPM package on the pkgs.org site. As in most cases the search pointed me towards atrpms.net repository. Pkgs.org contains pretty detailed instruction on how to add the repository that contains the package you require but unfortunately it was not all that straightforward with atrpms.net
- First step is to add atrpms siging GPG key and repository package to the system
12rpm --import http://packages.atrpms.net/RPM-GPG-KEY.atrpmsrpm -ivh http://dl.atrpms.net/el5-i386/atrpms/stable/atrpms-repo-5-7.el5.i386.rpm
since it’s 32-bit OS.
- Since atrpms is pretty dangerous repository – it might try to replace some of your base OS packages with less compatible versions I would recommend to disable this repository by default (edit the file /etc/yum.repos.d/atrpms.repo and in the [atrpms] section set enabled=0
- Next step we will just try to install ffmpeg package from this repository
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106yum --enablerepo=atrpms install ffmpegLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile* base: mirror.netrouting.net* epel: mirror.proserve.nl* extras: ftp.nluug.nl* ius: lon.mirror.rackspace.com* updates: ftp.nluug.nlatrpms | 2.6 kB 00:00base | 1.1 kB 00:00epel | 3.7 kB 00:00extras | 2.1 kB 00:00ius | 2.1 kB 00:00Not using downloaded repomd.xml because it is older than what we have:Current : Sun Oct 12 09:56:30 2014Downloaded: Sat Oct 11 10:02:54 2014updates | 1.9 kB 00:00Excluding Packages in global exclude listFinishedSetting up Install ProcessResolving Dependencies--> Running transaction check---> Package ffmpeg.i386 0:2.2.1-65.el5 set to be updated--> Processing Dependency: libavcodec55 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libswresample0 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libavdevice55 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libavutil52 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libavfilter4 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libswscale2 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libavformat55 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libpostproc52 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libpostproc.so.52 for package: ffmpeg--> Processing Dependency: libavdevice.so.55(LIBAVDEVICE_55) for package: ffmpeg--> Processing Dependency: libavcodec.so.55(LIBAVCODEC_55) for package: ffmpeg--> Processing Dependency: libavdevice.so.55 for package: ffmpeg--> Processing Dependency: libavutil.so.52(LIBAVUTIL_52) for package: ffmpeg--> Processing Dependency: libpostproc.so.52(LIBPOSTPROC_52) for package: ffmpeg--> Processing Dependency: libswscale.so.2(LIBSWSCALE_2) for package: ffmpeg--> Processing Dependency: libavformat.so.55(LIBAVFORMAT_55) for package: ffmpeg--> Processing Dependency: libavutil.so.52 for package: ffmpeg--> Processing Dependency: libavfilter.so.4 for package: ffmpeg--> Processing Dependency: libswresample.so.0 for package: ffmpeg--> Processing Dependency: libswscale.so.2 for package: ffmpeg--> Processing Dependency: libavformat.so.55 for package: ffmpeg--> Processing Dependency: libSDL-1.2.so.0 for package: ffmpeg--> Processing Dependency: libswresample.so.0(LIBSWRESAMPLE_0) for package: ffmpeg--> Processing Dependency: libavfilter.so.4(LIBAVFILTER_4) for package: ffmpeg--> Processing Dependency: libvdpau.so.1 for package: ffmpeg--> Processing Dependency: libavcodec.so.55 for package: ffmpeg--> Running transaction check---> Package SDL.i386 0:1.2.10-9.el5 set to be updated--> Processing Dependency: libaudiofile.so.0 for package: SDL--> Processing Dependency: libesd.so.0 for package: SDL---> Package libavcodec55.i386 0:2.2.1-65.el5 set to be updated--> Processing Dependency: libxavs.so.1 for package: libavcodec55--> Processing Dependency: libopencore-amrwb.so.0 for package: libavcodec55--> Processing Dependency: libx264.so.142 for package: libavcodec55--> Processing Dependency: libva-0.32.0.2.so.1 for package: libavcodec55--> Processing Dependency: libxvidcore.so.4 for package: libavcodec55--> Processing Dependency: libvorbisenc.so.2 for package: libavcodec55--> Processing Dependency: libmp3lame.so.0 for package: libavcodec55--> Processing Dependency: libopencore-amrnb.so.0 for package: libavcodec55--> Processing Dependency: libgsm.so.1 for package: libavcodec55--> Processing Dependency: libvorbis.so.0 for package: libavcodec55---> Package libavdevice55.i386 0:2.2.1-65.el5 set to be updated--> Processing Dependency: libasound.so.2(ALSA_0.9) for package: libavdevice55--> Processing Dependency: libasound.so.2(ALSA_0.9.0rc4) for package: libavdevice55--> Processing Dependency: libasound.so.2 for package: libavdevice55--> Processing Dependency: libdc1394.so.22 for package: libavdevice55---> Package libavfilter4.i386 0:2.2.1-65.el5 set to be updated---> Package libavformat55.i386 0:2.2.1-65.el5 set to be updated--> Processing Dependency: librtmp.so.0 for package: libavformat55---> Package libavutil52.i386 0:2.2.1-65.el5 set to be updated---> Package libpostproc52.i386 0:2.2.1-65.el5 set to be updated---> Package libswresample0.i386 0:2.2.1-65.el5 set to be updated---> Package libswscale2.i386 0:2.2.1-65.el5 set to be updated---> Package libvdpau1.i386 0:0.7-5.el5 set to be updated--> Running transaction check---> Package alsa-lib.i386 0:1.0.17-1.el5 set to be updated---> Package audiofile.i386 1:0.2.6-5 set to be updated---> Package esound.i386 1:0.2.36-4 set to be updated---> Package libdc1394_22.i386 0:2.0.2-11.el5 set to be updated--> Processing Dependency: libraw1394.so.8 for package: libdc1394_22---> Package libgsm1.i386 0:1.0.13-2.el5 set to be updated---> Package libmp3lame0.i386 0:3.99.3-23.el5 set to be updated---> Package libopencore-amrnb0.i386 0:0.1.3-1.el5 set to be updated---> Package libopencore-amrwb0.i386 0:0.1.3-1.el5 set to be updated---> Package librtmp0.i386 0:2.3-1.el5 set to be updated---> Package libva-0.32.0.2_1.i386 0:0.32.0-4_sds2.el5 set to be updated---> Package libvorbis.i386 1:1.1.2-3.el5_7.6 set to be updated--> Processing Dependency: libogg >= 2:1.1 for package: libvorbis---> Package libx264_142.i486 0:0.142-20_20140406.2245.el5 set to be updated---> Package libxavs1.i386 0:0.1.51-2.el5 set to be updated---> Package libxvidcore4.i386 0:1.3.2-15.el5 set to be updated--> Running transaction check---> Package libraw1394.i386 0:1.3.0-1.el5 set to be updated---> Package libvorbis.i386 1:1.1.2-3.el5_7.6 set to be updated--> Processing Dependency: libogg >= 2:1.1 for package: libvorbis--> Finished Dependency Resolution1:libvorbis-1.1.2-3.el5_7.6.i386 from base has depsolving problems--> Missing Dependency: libogg >= 2:1.1 is needed by package 1:libvorbis-1.1.2-3.el5_7.6.i386 (base)Error: Missing Dependency: libogg >= 2:1.1 is needed by package 1:libvorbis-1.1.2-3.el5_7.6.i386 (base)You could try using --skip-broken to work around the problemYou could try running: package-cleanup --problemspackage-cleanup --dupesrpm -Va --nofiles --nodigest
And there where it gets “interesting”.
- the challenge is that ffmpeg depends on libtheoraenc1 and libtheoradec1 packages that are not in atrpms (stable) repository but in atrpms-testing, that does not have section in repository file along with libogg0 and libvorbis0 and libvorbisenc2 from the same atrpms-testing (what is the logic behind stable package being dependent on testing packages is totally beyond me) that is also conflicting with the base repository libogg and libvorbis packages, so in order to get ffmpeg installed we need to go through some preliminary steps
- First we have to add atrpms-testing section in atrpms.repo file (also disabled by default). Now /etc/yum.repos.d/atrpms.repo will look like this
12345678910111213141516171819202122232425262728293031[atrpms]name=Red Hat Enterprise Linux $releasever - $basearch - ATrpmsfailovermethod=prioritybaseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stableenabled=0gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-atrpms[atrpms-testing]name=Red Hat Enterprise Linux $releasever - $basearch - ATrpmsfailovermethod=prioritybaseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/testingenabled=0gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-atrpms[atrpms-debuginfo]name=Red Hat Enterprise Linux $releasever - $basearch - ATrpms - Debugfailovermethod=prioritybaseurl=http://dl.atrpms.net/debug/el$releasever-$basearch/atrpms/stableenabled=0gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-atrpms[atrpms-source]name=Red Hat Enterprise Linux $releasever - $basearch - ATrpms - Sourcefailovermethod=prioritybaseurl=http://dl.atrpms.net/src/el$releasever-$basearch/atrpms/stableenabled=0gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-atrpms
Section [atrpms-testing] was added manually.
- after that, to satisfy the prerequisites
1yum -y remove libogg libvorbis; yum --enablerepo=atrpms-testing -y install libogg0 libvorbis0 libvorbisenc2 libtheoraenc1 libtheoradec1
In order to avoid the conflict with the base repository packages we will have to add some exclude configuration to the yum.conf file
1echo 'exclude=libogg-* libvorbis-*' >> /etc/yum.conf - And now to the main event:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188yum --enablerepo=atrpms install ffmpegLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile* base: mirror.netrouting.net* epel: mirror.proserve.nl* extras: ftp.nluug.nl* ius: ius.cu.be* updates: ftp.nluug.nlExcluding Packages in global exclude listFinishedSetting up Install ProcessResolving Dependencies--> Running transaction check---> Package ffmpeg.i386 0:2.2.1-65.el5 set to be updated--> Processing Dependency: libavcodec55 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libswresample0 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libavdevice55 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libavutil52 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libavfilter4 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libswscale2 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libavformat55 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libpostproc52 = 2.2.1-65.el5 for package: ffmpeg--> Processing Dependency: libpostproc.so.52 for package: ffmpeg--> Processing Dependency: libavdevice.so.55(LIBAVDEVICE_55) for package: ffmpeg--> Processing Dependency: libavcodec.so.55(LIBAVCODEC_55) for package: ffmpeg--> Processing Dependency: libavdevice.so.55 for package: ffmpeg--> Processing Dependency: libavutil.so.52(LIBAVUTIL_52) for package: ffmpeg--> Processing Dependency: libpostproc.so.52(LIBPOSTPROC_52) for package: ffmpeg--> Processing Dependency: libswscale.so.2(LIBSWSCALE_2) for package: ffmpeg--> Processing Dependency: libavformat.so.55(LIBAVFORMAT_55) for package: ffmpeg--> Processing Dependency: libavutil.so.52 for package: ffmpeg--> Processing Dependency: libavfilter.so.4 for package: ffmpeg--> Processing Dependency: libswresample.so.0 for package: ffmpeg--> Processing Dependency: libswscale.so.2 for package: ffmpeg--> Processing Dependency: libavformat.so.55 for package: ffmpeg--> Processing Dependency: libSDL-1.2.so.0 for package: ffmpeg--> Processing Dependency: libswresample.so.0(LIBSWRESAMPLE_0) for package: ffmpeg--> Processing Dependency: libavfilter.so.4(LIBAVFILTER_4) for package: ffmpeg--> Processing Dependency: libvdpau.so.1 for package: ffmpeg--> Processing Dependency: libavcodec.so.55 for package: ffmpeg--> Running transaction check---> Package SDL.i386 0:1.2.10-9.el5 set to be updated--> Processing Dependency: libaudiofile.so.0 for package: SDL--> Processing Dependency: libesd.so.0 for package: SDL---> Package libavcodec55.i386 0:2.2.1-65.el5 set to be updated--> Processing Dependency: libxavs.so.1 for package: libavcodec55--> Processing Dependency: libopencore-amrwb.so.0 for package: libavcodec55--> Processing Dependency: libx264.so.142 for package: libavcodec55--> Processing Dependency: libva-0.32.0.2.so.1 for package: libavcodec55--> Processing Dependency: libxvidcore.so.4 for package: libavcodec55--> Processing Dependency: libmp3lame.so.0 for package: libavcodec55--> Processing Dependency: libopencore-amrnb.so.0 for package: libavcodec55--> Processing Dependency: libgsm.so.1 for package: libavcodec55---> Package libavdevice55.i386 0:2.2.1-65.el5 set to be updated--> Processing Dependency: libasound.so.2(ALSA_0.9) for package: libavdevice55--> Processing Dependency: libasound.so.2(ALSA_0.9.0rc4) for package: libavdevice55--> Processing Dependency: libasound.so.2 for package: libavdevice55--> Processing Dependency: libdc1394.so.22 for package: libavdevice55---> Package libavfilter4.i386 0:2.2.1-65.el5 set to be updated---> Package libavformat55.i386 0:2.2.1-65.el5 set to be updated--> Processing Dependency: librtmp.so.0 for package: libavformat55---> Package libavutil52.i386 0:2.2.1-65.el5 set to be updated---> Package libpostproc52.i386 0:2.2.1-65.el5 set to be updated---> Package libswresample0.i386 0:2.2.1-65.el5 set to be updated---> Package libswscale2.i386 0:2.2.1-65.el5 set to be updated---> Package libvdpau1.i386 0:0.7-5.el5 set to be updated--> Running transaction check---> Package alsa-lib.i386 0:1.0.17-1.el5 set to be updated---> Package audiofile.i386 1:0.2.6-5 set to be updated---> Package esound.i386 1:0.2.36-4 set to be updated---> Package libdc1394_22.i386 0:2.0.2-11.el5 set to be updated--> Processing Dependency: libraw1394.so.8 for package: libdc1394_22---> Package libgsm1.i386 0:1.0.13-2.el5 set to be updated---> Package libmp3lame0.i386 0:3.99.3-23.el5 set to be updated---> Package libopencore-amrnb0.i386 0:0.1.3-1.el5 set to be updated---> Package libopencore-amrwb0.i386 0:0.1.3-1.el5 set to be updated---> Package librtmp0.i386 0:2.3-1.el5 set to be updated---> Package libva-0.32.0.2_1.i386 0:0.32.0-4_sds2.el5 set to be updated---> Package libx264_142.i486 0:0.142-20_20140406.2245.el5 set to be updated---> Package libxavs1.i386 0:0.1.51-2.el5 set to be updated---> Package libxvidcore4.i386 0:1.3.2-15.el5 set to be updated--> Running transaction check---> Package libraw1394.i386 0:1.3.0-1.el5 set to be updated--> Finished Dependency ResolutionDependencies Resolved================================================================================Package Arch Version RepositorySize================================================================================Installing:ffmpeg i386 2.2.1-65.el5 atrpms 3.2 MInstalling for dependencies:SDL i386 1.2.10-9.el5 base 232 kalsa-lib i386 1.0.17-1.el5 base 412 kaudiofile i386 1:0.2.6-5 base 107 kesound i386 1:0.2.36-4 base 130 klibavcodec55 i386 2.2.1-65.el5 atrpms 3.6 Mlibavdevice55 i386 2.2.1-65.el5 atrpms 41 klibavfilter4 i386 2.2.1-65.el5 atrpms 386 klibavformat55 i386 2.2.1-65.el5 atrpms 768 klibavutil52 i386 2.2.1-65.el5 atrpms 147 klibdc1394_22 i386 2.0.2-11.el5 atrpms 79 klibgsm1 i386 1.0.13-2.el5 atrpms 23 klibmp3lame0 i386 3.99.3-23.el5 atrpms 144 klibopencore-amrnb0 i386 0.1.3-1.el5 atrpms 98 klibopencore-amrwb0 i386 0.1.3-1.el5 atrpms 49 klibpostproc52 i386 2.2.1-65.el5 atrpms 63 klibraw1394 i386 1.3.0-1.el5 base 41 klibrtmp0 i386 2.3-1.el5 atrpms 44 klibswresample0 i386 2.2.1-65.el5 atrpms 48 klibswscale2 i386 2.2.1-65.el5 atrpms 153 klibva-0.32.0.2_1 i386 0.32.0-4_sds2.el5 atrpms 40 klibvdpau1 i386 0.7-5.el5 atrpms 6.4 klibx264_142 i486 0.142-20_20140406.2245.el5 atrpms 410 klibxavs1 i386 0.1.51-2.el5 atrpms 144 klibxvidcore4 i386 1.3.2-15.el5 atrpms 197 kTransaction Summary================================================================================Install 25 Package(s)Upgrade 0 Package(s)Total size: 10 MIs this ok [y/N]: yDownloading Packages:Running rpm_check_debugRunning Transaction TestFinished Transaction TestTransaction Test SucceededRunning TransactionInstalling : libavutil52 1/25Installing : libswresample0 2/25Installing : libpostproc52 3/25Installing : libswscale2 4/25Installing : audiofile 5/25Installing : alsa-lib 6/25Installing : esound 7/25Installing : SDL 8/25Installing : libmp3lame0 9/25Installing : libxavs1 10/25Installing : libx264_142 11/25Installing : libva-0.32.0.2_1 12/25Installing : libopencore-amrwb0 13/25Installing : librtmp0 14/25Installing : libxvidcore4 15/25Installing : libopencore-amrnb0 16/25Installing : libraw1394 17/25Installing : libdc1394_22 18/25Installing : libvdpau1 19/25Installing : libgsm1 20/25Installing : libavcodec55 21/25Installing : libavformat55 22/25Installing : libavfilter4 23/25Installing : libavdevice55 24/25Installing : ffmpeg 25/25Installed:ffmpeg.i386 0:2.2.1-65.el5Dependency Installed:SDL.i386 0:1.2.10-9.el5alsa-lib.i386 0:1.0.17-1.el5audiofile.i386 1:0.2.6-5esound.i386 1:0.2.36-4libavcodec55.i386 0:2.2.1-65.el5libavdevice55.i386 0:2.2.1-65.el5libavfilter4.i386 0:2.2.1-65.el5libavformat55.i386 0:2.2.1-65.el5libavutil52.i386 0:2.2.1-65.el5libdc1394_22.i386 0:2.0.2-11.el5libgsm1.i386 0:1.0.13-2.el5libmp3lame0.i386 0:3.99.3-23.el5libopencore-amrnb0.i386 0:0.1.3-1.el5libopencore-amrwb0.i386 0:0.1.3-1.el5libpostproc52.i386 0:2.2.1-65.el5libraw1394.i386 0:1.3.0-1.el5librtmp0.i386 0:2.3-1.el5libswresample0.i386 0:2.2.1-65.el5libswscale2.i386 0:2.2.1-65.el5libva-0.32.0.2_1.i386 0:0.32.0-4_sds2.el5libvdpau1.i386 0:0.7-5.el5libx264_142.i486 0:0.142-20_20140406.2245.el5libxavs1.i386 0:0.1.51-2.el5libxvidcore4.i386 0:1.3.2-15.el5Complete!
Enjoy your new ffmpeg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
ffmpeg ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers built on Apr 13 2014 13:48:00 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-52) configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --enable-shared --enable-runtime-cpudetect --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-pthreads --enable-x11grab --enable-vdpau --disable-avisynth --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxavs --enable-libxvid --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' --disable-stripping libavutil 52. 66.100 / 52. 66.100 libavcodec 55. 52.102 / 55. 52.102 libavformat 55. 33.100 / 55. 33.100 libavdevice 55. 10.100 / 55. 10.100 libavfilter 4. 2.100 / 4. 2.100 libswscale 2. 5.102 / 2. 5.102 libswresample 0. 18.100 / 0. 18.100 libpostproc 52. 3.100 / 52. 3.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... Use -h to get full help or, even better, run 'man ffmpeg' |
Useful blog post, just saved me some time working out what’s going on and the tip for enabled=0 as a default for atrpms and friends is a sensible one.