destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2011
03:18 PM
Automatic Video Runtime?
The 'Runtime' field is utilizing seconds for all displays. Is there any quicker/easier way to automatically determine the runtime of a streaming video file, like reading metadata encoded at the beginning of the stream for dynamic population of the field?
3 REPLIES 3

RokuKevin
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2011
09:08 AM
Re: Automatic Video Runtime?
The firmware does not currently do this. You must provide the runtime in your feeds.
--Kevin
--Kevin
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2011
07:38 PM
Re: Automatic Video Runtime?
This looks complex but should work fine for MP3's
http://www.zedwood.com/article/127/php- ... ion-of-mp3
dang...I just tried that php code out and it is FAST. Nifty.
Array ( [Filesize] => 107394921 [Encoding] => CBR [MPEG version] => 11 [Layer Description] => 01 [Protection Bit] => 1 [Bitrate Index] => 0111 [Sampling Freq Idx] => 00 [Padding Bit] => 0 [Private Bit] => 0 [Channel Mode] => 01 [Mode Extension] => 00 [Copyright] => 0 [Original Media] => 0 [Emphasis] => 0 [Bitrate] => 96 [Sampling Rate] => 44100 [Frame Size] => 314 [Length] => 8949 [Length mm:ss] => 149:09 )
note - their code is inaccurate if you have embedded artwork in the mp3 - this calculation is 4 seconds too long.
Does anyone have access to similar server side code to determine the runtime for mp4 and m4v video files the ROKU can use?
http://www.zedwood.com/article/127/php- ... ion-of-mp3
dang...I just tried that php code out and it is FAST. Nifty.
Array ( [Filesize] => 107394921 [Encoding] => CBR [MPEG version] => 11 [Layer Description] => 01 [Protection Bit] => 1 [Bitrate Index] => 0111 [Sampling Freq Idx] => 00 [Padding Bit] => 0 [Private Bit] => 0 [Channel Mode] => 01 [Mode Extension] => 00 [Copyright] => 0 [Original Media] => 0 [Emphasis] => 0 [Bitrate] => 96 [Sampling Rate] => 44100 [Frame Size] => 314 [Length] => 8949 [Length mm:ss] => 149:09 )
note - their code is inaccurate if you have embedded artwork in the mp3 - this calculation is 4 seconds too long.
Does anyone have access to similar server side code to determine the runtime for mp4 and m4v video files the ROKU can use?
TomCorwine
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2011
07:56 PM
Re: Automatic Video Runtime?
"destruk" wrote:
This looks complex but should work fine for MP3's
http://www.zedwood.com/article/127/php- ... ion-of-mp3
Does anyone have access to similar server side code to determine the runtime for mp4 and m4v video files the ROKU can use?
Does that work with VBR mp3s? Looking at the code, it seems to just do a rudimentary calculation of the bitrate divided into the file size. I believe calculating the length of VBR mp3s is a bit more difficult.
Great resource, though. I might play with it later on and see how well it works.