Page 1 of 1

ustream stream url extractor - ffmpeg failing

PostPosted: Sat Jul 28, 2012 4:11 pm
by xs2inattar
I just wrote down this ustream url extractor using the logic provided by piscui.

The stream url is extracted correctly for the ustream link but ffmpeg keeps failing. When the extracted url is pasted directly in serviio as a livestream it works.

when ffmpeg is run for the extracted url it works; but from serviio it fails.

plugin code and logs are attached. please take a look.

plugin:
USTREAM.groovy
USTREAM extractor plugin
(4.97 KiB) Downloaded 1188 times

ustream url used: http://www.ustream.tv/nasahdtv
url extracted by plugin is: rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1
log:
  Code:
2012-07-28 11:58:22,036 DEBUG [OnlineLibraryManager] Resource http://www.ustream.tv/nasahdtv not in cache yet, loading it
2012-07-28 11:58:22,036 DEBUG [WebResourceParser] Parsing web resource 'http://www.ustream.tv/nasahdtv'
2012-07-28 11:58:22,573 DEBUG [FeedItemUrlExtractor] Playlist extractor:   - transmitted from WebResourceParser - playlistUrl: null
2012-07-28 11:58:22,578 DEBUG [WebResourceParser] Found matching url extractor (ustream.tv) for resource http://www.ustream.tv/nasahdtv
2012-07-28 11:58:22,578 DEBUG [FeedItemUrlExtractor] ustream.tv: Starting parsing resource: http://www.ustream.tv/nasahdtv
2012-07-28 11:58:23,230 DEBUG [FeedItemUrlExtractor] ustream.tv: Starting extraction of url for item: NASA TV in HD
2012-07-28 11:58:23,688 DEBUG [FeedItemUrlExtractor] ustream.tv: Finished extraction of url: ContentURLContainer [fileType=VIDEO, contentUrl="rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1", thumbnailUrl=http://static-cdn1.ustream.tv/i/channel/picture/6/5/4/0/6540154/6540154_nasatv_public_hr_1330361732,90x90,r:1.jpg, expiresImmediately=true, cacheKey=USTREAM_6540154, live=true, ]
2012-07-28 11:58:23,689 DEBUG [WebResourceParser] Added resource item 1: 'NASA TV in HD' ("rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1")
2012-07-28 11:58:23,689 DEBUG [OnlineContentCacheDecorator] Stored online content 'http://www.ustream.tv/nasahdtv' in the cache (online_feeds), returning it
2012-07-28 11:58:23,692 DEBUG [OnlineLibraryManager] Resource http://www.ustream.tv/nasahdtv will expire in the cache on Sun Jul 29 11:58:23 EDT 2012
2012-07-28 11:58:23,692 DEBUG [FeedUpdaterThread] Retrieving information about the video stream 'NASA TV in HD'
2012-07-28 11:58:23,693 DEBUG [FFMPEGWrapper] Invoking FFMPEG to retrieve media information for file: "rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1"
2012-07-28 11:58:23,693 DEBUG [ProcessExecutor] Starting /volume1/@appstore/Serviio/bin/ffmpeg-wrapper.sh -i "rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1"
2012-07-28 11:58:23,826 DEBUG [FeedUpdaterThread] Cannot get information about the URL, it might have expired already. Trying again.
2012-07-28 11:58:23,827 DEBUG [FeedItemUrlExtractor] ustream.tv: Starting extraction of url for item: NASA TV in HD
2012-07-28 11:58:23,943 DEBUG [FeedItemUrlExtractor] ustream.tv: Finished extraction of url: ContentURLContainer [fileType=VIDEO, contentUrl="rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1", thumbnailUrl=http://static-cdn1.ustream.tv/i/channel/picture/6/5/4/0/6540154/6540154_nasatv_public_hr_1330361732,90x90,r:1.jpg, expiresImmediately=true, cacheKey=USTREAM_6540154, live=true, ]
2012-07-28 11:58:23,944 DEBUG [FFMPEGWrapper] Invoking FFMPEG to retrieve media information for file: "rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1"
2012-07-28 11:58:23,944 DEBUG [ProcessExecutor] Starting /volume1/@appstore/Serviio/bin/ffmpeg-wrapper.sh -i "rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1"
2012-07-28 11:58:24,170 WARN  [FeedUpdaterThread] Failed to retrieve online item information for "rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1". It might not play.
java.io.IOException: org.serviio.library.local.metadata.extractor.InvalidMediaFormatException: Unknown video file type.
   at org.serviio.library.online.metadata.FeedUpdaterThread.retrieveMetadata(FeedUpdaterThread.java:291)
   at org.serviio.library.online.metadata.FeedUpdaterThread.retrieveTechnicalMetadata(FeedUpdaterThread.java:209)
   at org.serviio.library.online.metadata.FeedUpdaterThread.run(FeedUpdaterThread.java:102)
Caused by: org.serviio.library.local.metadata.extractor.InvalidMediaFormatException: Unknown video file type.
   at org.serviio.library.metadata.FFmpegMetadataRetriever.validateCodecsFound(FFmpegMetadataRetriever.java:381)
   at org.serviio.library.metadata.FFmpegMetadataRetriever.retrieveMetadata(FFmpegMetadataRetriever.java:86)
   at org.serviio.library.metadata.FFmpegMetadataRetriever.retrieveOnlineMetadata(FFmpegMetadataRetriever.java:124)
   at org.serviio.library.online.metadata.FeedUpdaterThread.retrieveMetadata(FeedUpdaterThread.java:268)

ffmpeg output:
  Code:
RR-DS212plus> /volume1/@appstore/Serviio/bin/ffmpeg-wrapper.sh -i "rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl
=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1"
/volume1/@appstore/Serviio/bin/ffmpeg  -i "rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1"
ffmpeg version N-42368-gbf53863-Serviio Copyright (c) 2000-2012 the FFmpeg developers
  built on Jul 11 2012 01:45:53 with gcc 4.2.3
  configuration: --arch=arm --enable-armv5te --prefix=/opt --extra-cflags=-I/opt/include --extra-ldflags=-L/tmp/lib --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-pthreads --enable-libmp3lame --enable-librtmp --extra-version=Serviio
  libavutil      51. 64.100 / 51. 64.100
  libavcodec     54. 33.100 / 54. 33.100
  libavformat    54. 15.102 / 54. 15.102
  libavdevice    54.  1.100 / 54.  1.100
  libavfilter     3.  1.100 /  3.  1.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
Metadata:
  width                 1280.00
  height                720.00
  framerate             14.99
  videocodecid          7.00
  videodatarate         1000.00
  audiodatarate         64.00
[flv @ 0xf903d0] Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1':
  Duration: N/A, start: 0.000000, bitrate: 1089 kb/s
    Stream #0:0: Video: h264 (Baseline), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1024 kb/s, 14.99 tbr, 1k tbn, 29.97 tbc
    Stream #0:1: Audio: aac, 44100 Hz, stereo, s16, 65 kb/s
At least one output file must be specified

Re: ustream stream url extractor - ffmpeg failing

PostPosted: Sat Jul 28, 2012 4:56 pm
by zip
try it without the wrapper

Re: ustream stream url extractor - ffmpeg failing

PostPosted: Sat Jul 28, 2012 5:15 pm
by xs2inattar
zip wrote:try it without the wrapper


Still the same issue, without the wrapper.

  Code:
2012-07-28 13:15:14,610 DEBUG [FeedItemUrlExtractor] ustream.tv: Starting extraction of url for item: NASA TV in HD
2012-07-28 13:15:15,028 DEBUG [FeedItemUrlExtractor] ustream.tv: Finished extraction of url: ContentURLContainer [fileType=VIDEO, contentUrl="rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1", thumbnailUrl=http://static-cdn1.ustream.tv/i/channel/picture/6/5/4/0/6540154/6540154_nasatv_public_hr_1330361732,90x90,r:1.jpg, expiresImmediately=true, cacheKey=USTREAM_6540154, live=true, ]
2012-07-28 13:15:15,028 DEBUG [WebResourceParser] Added resource item 1: 'NASA TV in HD' ("rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1")
2012-07-28 13:15:15,029 DEBUG [OnlineContentCacheDecorator] Stored online content 'http://www.ustream.tv/nasahdtv' in the cache (online_feeds), returning it
2012-07-28 13:15:15,030 DEBUG [OnlineLibraryManager] Resource http://www.ustream.tv/nasahdtv will expire in the cache on Sun Jul 29 13:15:15 EDT 2012
2012-07-28 13:15:15,030 DEBUG [FeedUpdaterThread] Retrieving information about the video stream 'NASA TV in HD'
2012-07-28 13:15:15,031 DEBUG [FFMPEGWrapper] Invoking FFMPEG to retrieve media information for file: "rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1"
2012-07-28 13:15:15,031 DEBUG [ProcessExecutor] Starting /volume1/@appstore/Serviio/bin/ffmpeg -i "rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1"
2012-07-28 13:15:15,046 DEBUG [FeedUpdaterThread] Cannot get information about the URL, it might have expired already. Trying again.
2012-07-28 13:15:15,046 DEBUG [FeedItemUrlExtractor] ustream.tv: Starting extraction of url for item: NASA TV in HD
2012-07-28 13:15:15,224 DEBUG [FeedItemUrlExtractor] ustream.tv: Finished extraction of url: ContentURLContainer [fileType=VIDEO, contentUrl="rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1", thumbnailUrl=http://static-cdn1.ustream.tv/i/channel/picture/6/5/4/0/6540154/6540154_nasatv_public_hr_1330361732,90x90,r:1.jpg, expiresImmediately=true, cacheKey=USTREAM_6540154, live=true, ]
2012-07-28 13:15:15,225 DEBUG [FFMPEGWrapper] Invoking FFMPEG to retrieve media information for file: "rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1"
2012-07-28 13:15:15,226 DEBUG [ProcessExecutor] Starting /volume1/@appstore/Serviio/bin/ffmpeg -i "rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1"
2012-07-28 13:15:15,249 WARN  [FeedUpdaterThread] Failed to retrieve online item information for "rtmp://ustreamlivefs.fplive.net/ustream3live-live/ playpath=stream_live_1_1_6540154 swfUrl=http://static-cdn1.ustream.tv/swf/live/viewer.rsl:96.swf swfVfy=1 live=1". It might not play.
java.io.IOException: org.serviio.library.local.metadata.extractor.InvalidMediaFormatException: Unknown video file type.
   at org.serviio.library.online.metadata.FeedUpdaterThread.retrieveMetadata(FeedUpdaterThread.java:291)
   at org.serviio.library.online.metadata.FeedUpdaterThread.retrieveTechnicalMetadata(FeedUpdaterThread.java:209)
   at org.serviio.library.online.metadata.FeedUpdaterThread.run(FeedUpdaterThread.java:102)
Caused by: org.serviio.library.local.metadata.extractor.InvalidMediaFormatException: Unknown video file type.
   at org.serviio.library.metadata.FFmpegMetadataRetriever.validateCodecsFound(FFmpegMetadataRetriever.java:381)
   at org.serviio.library.metadata.FFmpegMetadataRetriever.retrieveMetadata(FFmpegMetadataRetriever.java:86)
   at org.serviio.library.metadata.FFmpegMetadataRetriever.retrieveOnlineMetadata(FFmpegMetadataRetriever.java:124)
   at org.serviio.library.online.metadata.FeedUpdaterThread.retrieveMetadata(FeedUpdaterThread.java:268)
   ... 2 more

Re: ustream stream url extractor - ffmpeg failing

PostPosted: Sat Jul 28, 2012 6:27 pm
by zip
Are you wrapping the rtmp:// url in quotes in your plugin? If yes, remove it.

Re: ustream stream url extractor - ffmpeg failing

PostPosted: Sat Jul 28, 2012 7:14 pm
by jhb50
Confirming that it works fine without the quotes.

Re: ustream stream url extractor - ffmpeg failing

PostPosted: Sat Nov 24, 2012 10:43 pm
by csholmq
You need to wrap the URL in quotes (as it contains spaces), but not in escaped quotes.

E.g
  Code:
./ffmpeg -i $PRE_FLAGS "$EXTRACTED_URL" $POST_FLAGS

not
  Code:
./ffmpeg -i $PRE_FLAGS \"$EXTRACTED_URL\" $POST_FLAGS


It can be confusing at first, since the quotes don't show up in the logs (which you might expect). But their purpose, to tie the multiple word URL together, still does the trick. It make the URL appear as one single argument to ffmpeg.

I hope this makes it less cryptic.