Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
happymeal
Visitor

Video meta data - specifically length of video

Hello - I'm wondering if its possible to get the meta data from a video. I've seen that this appears possible for audiostreams and images but nothing on videos. If it is not possible, is there some method of establishing how long a video is? I wish to display a playback progress bar. I know how to get the playback position from video event messages. I would like to display this as a ratio of the total video time.
0 Kudos
16 REPLIES 16
TheEndless
Channel Surfer

Re: Video meta data - specifically length of video

Unfortunately there's nothing exposed to BrightScript that gives this information. Even though the roVideoScreen has it, it doesn't make it available anywhere, as far as I've found. You'll need to rely on getting the metadata from someplace else, or trying to parse it from the file headers directly. In my custom roVideoPlayer implementations, I've opted to just show current playback time, if the overall length isn't provided, and show a full playback progress bar if it is.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
RokuMarkn
Visitor

Re: Video meta data - specifically length of video

There's an event (type 7) that is sent at the start of play and contains the duration of the video. It doesn't seem to be documented, so I'm not sure if it's plumbed all the way up to Brightscript.

--Mark
0 Kudos
csPlay
Visitor

Re: Video meta data - specifically length of video

"RokuMarkn" wrote:
There's an event (type 7) that is sent at the start of play and contains the duration of the video. It doesn't seem to be documented, so I'm not sure if it's plumbed all the way up to Brightscript.

--Mark


Hi Mark,

Can you describe how can we capture that event type 7?

Thanks.
0 Kudos
TheEndless
Channel Surfer

Re: Video meta data - specifically length of video

"csPlay" wrote:
"RokuMarkn" wrote:
There's an event (type 7) that is sent at the start of play and contains the duration of the video. It doesn't seem to be documented, so I'm not sure if it's plumbed all the way up to Brightscript.

--Mark

Hi Mark,

Can you describe how can we capture that event type 7?

Thanks.

It's not exposed to Brightscript currently, so you can't capture it. Hopefully Mark will have better news concerning that, as it would come in extremely handy, particularly for custom video players.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
RokuMarkn
Visitor

Re: Video meta data - specifically length of video

That's correct, it's not currently available to Brightscript. There is a pending enhancement request to implement it, but I don't know when that will be released.

--Mark
0 Kudos
csPlay
Visitor

Re: Video meta data - specifically length of video

Does that mean that if we use the component rovideoplayer, there is no way of knowing the full duration untill the end of the stream? (assuming we do not have a metadata for that specific stream)
0 Kudos
TheEndless
Channel Surfer

Re: Video meta data - specifically length of video

"csPlay" wrote:
Does that mean that if we use the component rovideoplayer, there is no way of knowing the full duration untill the end of the stream? (assuming we do not have a metadata for that specific stream)

That is correct. For non-Live HLS, I parse the M3U8 playlist to calculate the length. For MP4, without metadata, there's nothing to work with.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
bosborne
Visitor

Re: Video meta data - specifically length of video

Is this still true? Not exposed to brightscript yet?
0 Kudos
RokuMarkn
Visitor

Re: Video meta data - specifically length of video

In 5.0 and later firmware, there is ifVideoPlayer.GetPlaybackDuration.

http://sdkdocs.roku.com/display/sdkdoc/ ... nasInteger

--Mark
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.