These forums are archived

See this post for further info

get_iplayer forums

Forum archived. Posting disabled.

Raspberry PI: ffmpeg missing libx264

user-1467

Hi all, I am trying to run get_iplayer on a raspberry pi "Raspbian GNU/Linux 7 (wheezy)" after using it for years on Windows. I followed the instructions here https://squarepenguin.co.uk/downloads/raspbian/  to install get_iplayer and now have get_iplayer 2.97-ppa26, installed, however after installation I  was getting an error that ffmpeg could not be found so I followed the instructions here /thread-964.html to install ffmpeg. get_iplayer now downloads and can find ffmpeg but I am now gettin the following error:


INFO: Begin converting file: /home/pi/i_player_recordings/Postman_Pat_Special_Delivery_Service_Series_3_-_1._Postman_Pat_and_the_Cornish_Caper_b083r6nt_original.partial.mp4.ts
/usr/bin/ffmpeg: error while loading shared libraries: libx264.so.142: cannot open shared object file: No such file or directory

How do I install the required libraries and point ffmpeg to them?

Please note I am a complete linux numpty so please be gentle.

user-2

It looks like you need to install libx264 runtime library (to handle iPlayer video with ffmpeg). The package name should be libx264-142.

user-1478

I am struggling to get ffmpeg working and have followed the instructions, however when I run get_iplayer it downloads ok but I then get this error:

get_iplayer Output:

INFO: Recorded: 14.04MB in 00:00:10 at 11503kbps to /media/usb/Natural_World_2016-2017_-_The_importance_of_giraffes_p03yjvsl_original.partial.mp4.ts
INFO: Begin converting file: /media/usb/Natural_World_2016-2017_-_The_importance_of_giraffes_p03yjvsl_original.partial.mp4.ts
/usr/bin/ffmpeg: error while loading shared libraries: libx264.so.142: cannot open shared object file: No such file or directory
INFO: Command exit code 127 (raw code = 32512)
WARNING: Conversion failed - retaining /media/usb/Natural_World_2016-2017_-_The_importance_of_giraffes_p03yjvsl_original.partial.mp4.ts
Any advice? The download process works perfectly, but since updating get_iplayer I cannot get the conversion to work.....

I am sure it is really simple, but as a 'novice' I am struggling on this one ;-)


Many thanks for any help

user-1478

OK after many hours I've now fixed the above problem (I've no idea how but know it involved libx264-142). Now I have another problem that I can't seem to fix:

raspberrypi 4.1.19+ #858 (I belive it is a Pi B+)
Writing the file to /media/usb/ (Mounted USB flash drive)

Here is the verbose output:

get_iplayer Output:


pi@raspberrypi ~ $ get_iplayer --pid p03yjvsl --tvmode=best --force --verbose
get_iplayer 2.97-ppa26, Copyright (C) 2008-2010 Phil Lewis
 This program comes with ABSOLUTELY NO WARRANTY; for details use --warranty.
 This is free software, and you are welcome to redistribute it under certain
 conditions; use --conditions for details.

INFO: encodinglocale = UTF-8
INFO: encodinglocalefs = UTF-8
INFO: encodingconsoleout = UTF-8
INFO: encodingconsolein = UTF-8
INFO: ${^UNICODE} = 0
INFO: User prefs dir: /home/pi/.get_iplayer
INFO: System options dir: /etc/get_iplayer/options
Current options:
       encodingconsolein = UTF-8
       encodingconsoleout = UTF-8
       encodinglocale = UTF-8
       encodinglocalefs = UTF-8
       ffmpeg = /usr/bin/ffmpeg
       force = 1
       isodate = 1
       output = /media/usb/
       pid = p03yjvsl
       tvmode = best
       verbose = 1

INFO: Search args: ''
INFO: Will try prog types: tv
INFO: Got 1699 file cache entries for tv
Cleaning pid Old: 'p03yjvsl',  New: 'p03yjvsl'
INFO: Getting page http://www.bbc.co.uk/programmes/p03yjvsl.rdf
INFO: Episode-only pid detected
INFO: Trying pid: p03yjvsl using type: tv
INFO: Trying to stream pid using type tv
INFO: pid not found in tv cache
INFO: Cleaning pid Old: 'p03yjvsl',  New: 'p03yjvsl'
Matches:

INFO: 1 Matching Programmes
INFO: Programme metadata URL = http://www.bbc.co.uk/programmes/p03yjvsl.xml
INFO: Getting page http://www.bbc.co.uk/programmes/p03yjvsl.xml
INFO: Getting page http://open.live.bbc.co.uk/mediaselector...s?cb=58721
INFO: Getting page http://cp401489-vh.akamaihd.net/i/iplaye...cd676f0f08
INFO: Getting page http://open.live.bbc.co.uk/mediaselector...s?cb=13409
INFO: Getting page http://cp401489-vh.akamaihd.net/i/iplaye...a3fb406a98
INFO: Found mode hlshigh1: (gip_hls_iplayer_778) hls h264 640x360 778kbps stream (CDN: akamai_hls_open/10)
INFO: Found mode hlslow1: (gip_hls_iplayer_389) hls h264 512x288 389kbps stream (CDN: akamai_hls_open/10)
INFO: Found mode hlsstd1: (gip_hls_iplayer_499) hls h264 640x360 499kbps stream (CDN: akamai_hls_open/10)
INFO: Found mode hlsvhigh1: (gip_hls_iplayer_1466) hls h264 832x468 1466kbps stream (CDN: akamai_hls_open/10)
INFO: Getting page http://www.bbc.co.uk/programmes/p03yjvst.rdf
INFO: Will search for versions: original
INFO: Mode list: hvfhd,hlshd,hvfsd,hvfvhigh,hlsvhigh,hvfhigh,hlshigh,hvfstd,hlsstd,hvflow,hlslow
INFO: Checking existence of original version
INFO: Version = original
INFO: hlsvhigh1,hlshigh1,hlsstd1,hlslow1 modes will be tried for version original
INFO: Trying hlsvhigh1 mode to record tv: Natural World: 2016-2017 - The importance of giraffes
INFO: Attempt number: 1 / 3
INFO: File name prefix = Natural_World_2016-2017_-_The_importance_of_giraffes_p03yjvsl_original
INFO: Begin recording file: /media/usb/Natural_World_2016-2017_-_The_importance_of_giraffes_p03yjvsl_original.partial.mp4.ts
DEBUG: HLS playlist = http://cp401489-vh.akamaihd.net/i/iplaye...a3fb406a98
INFO: Getting page http://cp401489-vh.akamaihd.net/i/iplaye...a3fb406a98
INFO: Recorded: 14.04MB in 00:00:13 at  8849kbps to /media/usb/Natural_World_2016-2017_-_The_importance_of_giraffes_p03yjvsl_original.partial.mp4.ts
INFO: Begin converting file: /media/usb/Natural_World_2016-2017_-_The_importance_of_giraffes_p03yjvsl_original.partial.mp4.ts


INFO: Command: "/usr/bin/ffmpeg" "-loglevel" "verbose" "-y" "-stats" "-i" "/media/usb/Natural_World_2016-2017_-_The_importance_of_giraffes_p03yjvsl_original.partial.mp4.ts" "-vcodec" "copy" "-acodec" "copy" "-absf" "aac_adtstoasc" "/media/usb/Natural_World_2016-2017_-_The_importance_of_giraffes_p03yjvsl_original.partial.mp4"

ffmpeg version 0.8.17-6:0.8.17-2+rpi1+deb7u2, Copyright (c) 2000-2014 the Libav developers
 built on Jun 18 2016 00:05:51 with gcc 4.6.3
 configuration: --arch=arm --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.17-2+rpi1+deb7u2' --libdir=/usr/lib/arm-linux-gnueabihf --prefix=/usr --disable-yasm --disable-protocol=concat --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib/arm-linux-gnueabihf --enable-shared --disable-static
 avdevice    configuration: --arch=arm --enable-pthreads --enable-runtime-cpudetect --extra-version='6:9.14-1rpi1rpi1' --libdir=/usr/lib/arm-linux-gnueabihf --prefix=/usr --disable-yasm --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib/arm-linux-gnueabihf --enable-shared --disable-static --enable-libopencore-amrnb --enable-version3 --enable-libopencore-amrwb --enable-version3 --enable-libvo-aacenc --enable-version3 --enable-libvo-amrwbenc --enable-version3
 swscale     configuration: --arch=arm --enable-pthreads --enable-runtime-cpudetect --extra-version='6:9.14-1rpi1rpi1' --libdir=/usr/lib/arm-linux-gnueabihf --prefix=/usr --disable-yasm --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib/arm-linux-gnueabihf --enable-shared --disable-static --enable-libopencore-amrnb --enable-version3 --enable-libopencore-amrwb --enable-version3 --enable-libvo-aacenc --enable-version3 --enable-libvo-amrwbenc --enable-version3
 postproc    configuration:
 libavutil    51. 22. 3 / 51. 22. 3
 libavcodec   53. 35. 0 / 53. 35. 0
 libavformat  53. 21. 1 / 53. 21. 1
 libavdevice  53.  2. 0 / 53.  2. 0
 libavfilter   2. 15. 0 /  2. 15. 0
 libswscale    2.  1. 0 /  2.  1. 1
 libpostproc  52.  0. 0 / 52.  0.100
The ffmpeg program is only provided for script compatibility and will be removed
in a future release. It has been deprecated in the Libav project to allow for
incompatible command line syntax improvements in its replacement called avconv
(see Changelog for details). Please use avconv instead.
At least one input file must be specified
INFO: Command exit code 1 (raw code = 256)
WARNING: Conversion failed - retaining /media/usb/Natural_World_2016-2017_-_The_importance_of_giraffes_p03yjvsl_original.partial.mp4.ts
DEBUG: Record using hlsvhigh1 mode return code: '0'

INFO: Loading recordings history
INFO: Getting thumbnail from http://ichef.bbci.co.uk/images/ic/150x84/p04hbg8f.jpg
INFO: Getting page http://ichef.bbci.co.uk/images/ic/150x84/p04hbg8f.jpg
INFO: Downloaded Thumbnail to '/media/usb/Natural_World_2016-2017_-_The_importance_of_giraffes_p03yjvsl_original.jpg'
WARNING: Don't know how to tag MP4 file

Any help gratefully received.

Kind regards

user-2

For the benefit of future readers, I'm going to take a run at clearing up this RPi cluster**** once and for all.
  • The Raspbian instructions on this site are incomplete. You will NOT have a fully-working version of get_iplayer at the end of the installation - additional steps are required.
  • Read this section of the release notes to understand why additional steps are required
  • Read this section of the release notes again to understand why additional steps are required
  • Also see the Raspbian section of this page: https://github.com/get-iplayer/get_iplayer/wiki/unixpkg
  • After installing get_iplayer, install a working version of ffmpeg on Raspbian Jessie by following the instructions here: /thread-964.html
  • Perform ALL of the steps in the above post, including the addition of ffmpeg to get_iplayer preferences. If you don't, get_iplayer will continue to use the obsolete avconv utility and your downloads will fail.
  • Depending on how you originally set up your system, you may find that some of the supporting libraries that ffmpeg requires to handle iPlayer media formats are not installed, leading to "error while loading shared libraries" messages. The missing libraries can be installed with your package manager. The name of the library in the error message will generally be the same, or nearly the same, as the related package. For example, libx264.so.142 (missing in the OP example) is installed with the libx264-142 package.
EDIT: The ffmpeg build referenced above links to libx264-142, which is only supplied with Raspbian Jessie. Raspbian Wheezy users should configure get_iplayer to use avconv (instead of ffmpeg) and the hls TV modes. The default hvf TV modes will not work with avconv. This approach may work for Raspbian Jessie as well.

Code:
# adjust path to avconv as necessary
get_iplayer --prefs-add --ffmpeg=/usr/bin/avconv --tvmode=hls

user-1478

Many thanks for the replies, much appreciated. I have followed to the letter and understand why ffmpeg does not work. However I cannot find out how to install the missing libx264-142 package, or the repositories where it might be hiding. If I try to install libx264-142 the result is: "E: Unable to locate package libx264-142". It is not the end of the world if the .ts file is not converted to mpeg as I can still play it without the conversion. I shall wait for the next version to be ready and hope this solves it.  Kind regards.

user-2

I can see the relevant DEB file in the main Raspbian repository, but I have no way to verify that it works - I got rid of my Pi long ago. I can tell you that the next version of get_iplayer will be no help to you - these ffmpeg problems are purely related to Raspbian.  However, a Raspbian user will need to assist you from here. If none appears, you may want to try your luck on the get_iplayer mailing list.

user-1467

ashgwr, I am having exactly the same problem trying to install the libx264-142 package. The package appears to be installed with Raspbian Jessie so updating to that should, I would have thought, get things working but I have no idea as to why the package will not install on wheezy.

user-2

Looking at the package lists in Raspbian repo, it appears that libx264-142 is indeed only supplied with Jessie. Wheezy and Stretch have different versions. The person who created the ffmpeg build must have used Jessie - I've updated my earlier post accordingly. I can't say if you would do any harm by installing the libx264-142 DEB on a Wheezy machine, but it may not be a risk you should take just for get_iplayer.

user-1478

I have loaded Raspbian Jessie (clean new install) on the Pi and followed the instructions in this thread and it works perfectly with the conversion to mp4 at the end. I think I had missed the fact that Wheezy does not allow ffmpeg to work, Jessie does with get_iplayer.

Regards

user-2

Good news. There appears to be a proper ffmpeg package available in the Raspian repo for stretch, so when that arrives you should be able to avoid this hassle in the future.

These forums are archived

See this post for further info