FAQ  •  Register  •  Login

ustream stream url extractor - ffmpeg failing

<<

xs2inattar

DLNA master

Posts: 143

Joined: Sun Jun 24, 2012 5:49 pm

Post Sat Jul 28, 2012 4:11 pm

ustream stream url extractor - ffmpeg failing

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 672 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
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16858

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Jul 28, 2012 4:56 pm

Re: ustream stream url extractor - ffmpeg failing

try it without the wrapper
<<

xs2inattar

DLNA master

Posts: 143

Joined: Sun Jun 24, 2012 5:49 pm

Post Sat Jul 28, 2012 5:15 pm

Re: ustream stream url extractor - ffmpeg failing

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
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16858

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Jul 28, 2012 6:27 pm

Re: ustream stream url extractor - ffmpeg failing

Are you wrapping the rtmp:// url in quotes in your plugin? If yes, remove it.
<<

jhb50

DLNA master

Posts: 2854

Joined: Thu Jun 30, 2011 9:32 pm

Post Sat Jul 28, 2012 7:14 pm

Re: ustream stream url extractor - ffmpeg failing

Confirming that it works fine without the quotes.
<<

csholmq

DLNA master

Posts: 139

Joined: Sun Mar 25, 2012 11:41 pm

Post Sat Nov 24, 2012 10:43 pm

Re: ustream stream url extractor - ffmpeg failing

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.

Return to Plugin development

Who is online

Users browsing this forum: No registered users and 2 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.