Monday 3 March 2014

get_iplayer - RTMP_ReadPacket, failed to read RTMP packet header

If you use the excellent application get_iplayer to download content from the BBC's iPlayer service you may from early June 2013 find issues downloading content.

ERROR: RTMP_ReadPacket
  • The following is a typical error :
WARNING: ffmpeg does not exist - not converting flv file
INFO: File name prefix =
History_of_Scotland_

Street_b022ff9g_default
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
INFO: Connected...
Caught signal: 13, cleaning up, just a second...
ERROR: WriteN, RTMP send error 32 (42 bytes)
ERROR: RTMP_ReadPacket, failed to read RTMP packet header
INFO: Command exit code 1 (raw code = 256)


Solution
  •  Run the following command :

$ get_iplayer --prefs-add --rtmp-tv-opts="--swfVfy http://www.bbc.co.uk/emp/releases/iplayer/revisions/617463_618125_4/617463_618125_4_emp.swf" 

  • This updates your options file :

$ cat ~/.get_iplayer/options
output /home/cwishaw/iplayer
rtmptvopts --swfVfy http://www.bbc.co.uk/emp/releases/iplayer/revisions/617463_618125_4/617463_618125_4_emp.swf


  •  Note : I also use the options file to set my default download folder which is really useful
Background
  • The BBC iPlayer service uses SWF (Shockwave Flash) developed by Macromedia then purchased by Adobe
  • SWF Verification can protect access content by only allowing authorized software to access it
  • Content is accessed only by specific SWF files and is controlled by using an authorization key
  • The video download will fail without the authorization key
  • A Real-Time Messaging Protocol (RTMP) client is used by Flash for streaming video
  • The RTMP client used for get_iplayer is rtmpdump
  • The iPlayer media servers require SWF Verification with an authorized flash file e.g. 617463_618125_4_emp.swf
  • get_iplayer uses the SWF URL to provide to rtmpdump with the URL
  • The SWF verification file can be changed by the BBC which has occurred on this occasion
  • The default SWF file can be overwritten as detailed above in the options file

Further Information


No comments:

Post a Comment