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: 
Conroy94
Visitor

Video player buffer size

Hi,

I am developing an application that sniffs network traffic to test the responsiveness of video players - Roku being one of them. The concept being that the video player will request the most appropriate bitrate for the current network conditions. Throttling the network should result in a lower bitrate being requested, and so on.

Part of the application also infers buffering, which is done by capturing the number of bytes that have been transferred through the network. This approach works quite accurately, but would be more accurate if I knew the exact size of the buffers (i.e. x amount of bytes must be received before playback begins, and when the video buffers, x amount of bytes must be received before the video restarts).

Could anyone point me in the right direction?

Thanks
0 Kudos
6 REPLIES 6
RokuMarkn
Visitor

Re: Video player buffer size

The Roku video player already does this internally.  If you pass multiple video streams to the player via the Streams value in Content Metadata, the player will pick the best stream to play based on the streams' bitrates and the network bandwidth which has been measured recently.  There's no need for your app to do any of this.

--Mark
0 Kudos
Conroy94
Visitor

Re: Video player buffer size

My app is to test how responsive the video player is to the change of bitrate, not changing the bitrate itself. In order for my tests to be accurate, I am asking if anyone knows the preflight buffer size (i.e. how many bytes of data, or seconds of video, are downloaded before video begins).
0 Kudos
RokuMarkn
Visitor

Re: Video player buffer size

There isn't a simple answer to that question.  The amount of prebuffer is not a fixed amount, but depends on many factors, including the measured network bandwidth, recent history of rebuffers, the type of demux being used, the skew between video and audio in the stream, and other things.

I'm very unclear about what you're trying to do.  Why are you making this measurement?  Is it just curiosity?  Or does it have some functional purpose?  Is the "application" that you're writing a Roku channel, or something on an external server?

--Mark
0 Kudos
Conroy94
Visitor

Re: Video player buffer size

I assumed as much.

My company has multiple video players, Roku being one of them. Our app runs tests under certain network conditions and observes how the video player behaves - how many times it buffers, etc. As this tool is for all of our video players, it runs on a Raspberry Pi and sniffs the network to see the video requests from the video player and the video responses from our CDN. We keep a record of all the received video chunks and try to simulate playback - knowing how the buffer behaves would make our tests more accurate.

Could you suggest another approach to this? Are there other ways to find out when video playback starts, stops, etc, from the network level?
0 Kudos
RokuMarkn
Visitor

Re: Video player buffer size

If you're using your own Roku channel to play the videos, you could monitor roVideoPlayerEvents and send messages to your external app using roUrlTransfer or roDatagramSocket.

--Mark
0 Kudos
zig_zag
Visitor

Re: Video player buffer size

"RokuMarkn" wrote:
The Roku video player already does this internally.  If you pass multiple video streams to the player via the Streams value in Content Metadata, the player will pick the best stream to play based on the streams' bitrates and the network bandwidth which has been measured recently.  There's no need for your app to do any of this.

--Mark

Hi Mark! 
How can i pass multiple video streams to the Scene Graph Video? Or if i can't, what should i do to play a video depending on user's network connection?
Thanks!
- Gabriel
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.