Troubleshooting tip I discovered with regards to RTMP.
I am working on an ABC (Australia) iView plugin and I have commands that work to download a stream using RTMPDump. This command works to download the video (if you get a new auth string from the server before you run it).
- Code:
rtmpdump --rtmp rtmp://cp53909.edgefcs.net:1935 --app 'ondemand?auth=daEc1aMaUa8dicCbYcKcmcSbda5cfaZb3b5-bqnQIz-8-mkt_xErqN&aifp=v001' --playpath mp4:flash/playback/_definst_/drwhoconfidential_06_07 --swfUrl http://www.abc.net.au/iview/images/iview.jpg --swfVfy 1 --swfsize 2122 --swfhash 96cc76f1d5385fb5cda6e2ce5c73323a399043d0bb6c687edd807e5c73c42b37 -o /home/god/Videos/drwho_confid2.mp4
I then tried to use these commands in my plugin. But my plugin would report the following to the logs
- Code:
2012-08-24 08:07:29,473 DEBUG [FFMPEGWrapper] Invoking FFMPEG to retrieve media information for file: rtmp://cp53909.edgefcs.net:1935 app=ondemand?auth=daEdXdUcKbibqc1amcEcDdacDcwcidoana8-bqnQMC-8-snr_xFzoL&aifp=v001 playpath=mp4:flash/playback/_definst_/drwhoconfidential_06_07 swfUrl=http://www.abc.net.au/iview/images/iview.jpg swfVfy=1 swfsize=2122 swfhash=96cc76f1d5385fb5cda6e2ce5c73323a399043d0bb6c687edd807e5c73c42b37
2012-08-24 08:07:29,474 DEBUG [ProcessExecutor] Starting ffmpeg -i rtmp://cp53909.edgefcs.net:1935 app=ondemand?auth=daEdXdUcKbibqc1amcEcDdacDcwcidoana8-bqnQMC-8-snr_xFzoL&aifp=v001 playpath=mp4:flash/playback/_definst_/drwhoconfidential_06_07 swfUrl=http://www.abc.net.au/iview/images/iview.jpg swfVfy=1 swfsize=2122 swfhash=96cc76f1d5385fb5cda6e2ce5c73323a399043d0bb6c687edd807e5c73c42b37
2012-08-24 08:07:29,503 WARN [FeedUpdaterThread] Failed to retrieve online item information for rtmp://cp53909.edgefcs.net:1935 app=ondemand?auth=daEdXdUcKbibqc1amcEcDdacDcwcidoana8-bqnQMC-8-snr_xFzoL&aifp=v001 playpath=mp4:flash/playback/_definst_/drwhoconfidential_06_07 swfUrl=http://www.abc.net.au/iview/images/iview.jpg swfVfy=1 swfsize=2122 swfhash=96cc76f1d5385fb5cda6e2ce5c73323a399043d0bb6c687edd807e5c73c42b37. It might not play.
java.io.IOException: org.serviio.library.local.metadata.extractor.InvalidMediaFormatException: Unknown video file type.
and if I ran the ffmpeg -i command from the logs it would just sit there and do nothing.
What I figured out is that I need a command of the form
rtmp://<server>:<port>/<app> playpath=<playpath>
The part of my rtmpdump that was the --app parameter goes after the port number prefixed with slash. And the playpath is specified with a playpath=parameter.
And I did not need any of the rest of the swfUrl, swfVfy, swfsize, swfhash stuff. (See edit below)
- Code:
ffmpeg -i "rtmp://cp53909.edgefcs.net:1935/ondemand?auth=daEcnaKdQaocedWbKa1cycda5dyc9dbd4aZ-bqoINR-8-mkr_tEvpJ&aifp=v001 playpath=mp4:flash/playback/_definst_/drwhoconfidential_06_07"
returns something like
- Code:
ffmpeg version 0.11.1.git Copyright (c) 2000-2012 the FFmpeg developers
built on Aug 22 2012 00:01:08 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --enable-static --disable-shared --bindir=/tmp/ffmpeg --disable-ffplay --disable-ffserver --enable-pthreads --disable-mmx --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3 --enable-librtmp --pkg-config=pkg-config
libavutil 51. 70.100 / 51. 70.100
libavcodec 54. 54.100 / 54. 54.100
libavformat 54. 25.104 / 54. 25.104
libavdevice 54. 2.100 / 54. 2.100
libavfilter 3. 11.101 / 3. 11.101
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
HandleCtrl: Ignoring SWFVerification request, use --swfVfy!
Metadata:
duration 543.80
moovPosition 40.00
width 640.00
height 360.00
videocodecid avc1
audiocodecid mp4a
avcprofile 100.00
avclevel 41.00
aacaot 2.00
videoframerate 25.00
audiosamplerate 48000.00
audiochannels 2.00
tags:
©too Lavf52.39.2
trackinfo:
length 13595.00
timescale 25.00
language und
sampledescription:
sampletype avc1
length 26101760.00
timescale 48000.00
language und
sampledescription:
sampletype mp4a
length 48942000.00
timescale 90000.00
language und
sampledescription:
length 26095616.00
timescale 48000.00
language und
sampledescription:
Input #0, flv, from 'rtmp://cp53909.edgefcs.net:1935/ondemand?auth=daEcnaKdQaocedWbKa1cycda5dyc9dbd4aZ-bqoINR-8-mkr_tEvpJ&aifp=v001 playpath=mp4:flash/playback/_definst_/drwhoconfidential_06_07':
Metadata:
moovPosition : 40
avcprofile : 100
avclevel : 41
aacaot : 2
videoframerate : 25
audiochannels : 2
Duration: 00:09:03.79, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p, 640x360, 25 tbr, 1k tbn, 50 tbc
Stream #0:1: Audio: aac, 48000 Hz, stereo, s16
At least one output file must be specified
Which is success. We dont care about "At least one output file must be specified" because we are just getting the metadata with this command. And Ignoring SWFVerification request does not seem to matter.
Edit: Ignoring SWFVerification does matter. If this services does not complete SWFVerification the video stops playing after about a minute. See
this thread for my battle with SWFVerification on iView.
I do need a swfUrl and a swfVfy (but not swfsize swfhash)