Shaka-player: Default chunk size (in seconds)

Created on 27 Mar 2017  路  10Comments  路  Source: google/shaka-player

Hi, i'm using Shaka version 1.6.2;
I have two questions:

1) what is shaka player default chunk size in seconds?
2) How can i set manually this property?

Thanks in advance.

archived question

Most helpful comment

Shaka Packager creates 10-second segments by default, but you can control that with a command line flag. When I created content for the Shaka Player demo (using Shaka Packager), I set that flag to 4 seconds. You can set that to whatever you wish when you package your content.

I recommend you set both --segment_duration and --fragment_duration when you package your content, and set them to the same value (in seconds). This value should be a multiple of the GOP size you used when you encoded the content. For ffmpeg, this is controlled by -g and -keyint_min, both of which I recommend you set to the same value (in frames).

For example, for 24 fps content and 4-second segments, 24 * 4 = 96 frames per segment. So you would use ffmpeg ... -g 96 -keyint_min 96 ... and packager --segment_duration 4 --fragment_duration 4 ...

I hope that helps!

All 10 comments

Do you mean the amount of media data Shaka Player requests? Shaka requests one segment at a time, and the segment size is set when the content is created. For example, 10 second segments are common for VOD DASH content, and Apple's HLS tools have a default of 6 second segments. The demo assets we created use 4 second segments, because we found that to be a good balance between overhead and adaptation speed.

Does this help?

@joeyparrish Yes, i've created shaka-enabled content using shaka packager and now i want to study a dash-enabled CDN performance, like i.e. each segment's latency. I've used this library. So do you confirm me that segment duration is 4 second? Thanks a lot!

Shaka Packager creates 10-second segments by default, but you can control that with a command line flag. When I created content for the Shaka Player demo (using Shaka Packager), I set that flag to 4 seconds. You can set that to whatever you wish when you package your content.

I recommend you set both --segment_duration and --fragment_duration when you package your content, and set them to the same value (in seconds). This value should be a multiple of the GOP size you used when you encoded the content. For ffmpeg, this is controlled by -g and -keyint_min, both of which I recommend you set to the same value (in frames).

For example, for 24 fps content and 4-second segments, 24 * 4 = 96 frames per segment. So you would use ffmpeg ... -g 96 -keyint_min 96 ... and packager --segment_duration 4 --fragment_duration 4 ...

I hope that helps!

This seems to be resolved now, so I will go ahead and close. Let us know if you need any more help with this, and we can reopen. Thanks!

Sorry, i have another question: what is default sampling rate when i create segments?

Neither the sampling rate of the audio nor the frame rate of the video is changed by the packager. If you start with 44kHz audio and 24fps video, you will have 44kHz audio and 24fps video after packaging.

You can change those things in ffmpeg if you wish, but by default, the output from ffmpeg will have the same sampling rate and frame rate as the input did.

Ok, thanks @joeyparrish . Last (i hope, but i don't know if this is true :) my master thesis is so long...) question: does shaka support a way to see average delay/delay jitter?

Can you define what you mean by "delay" here? Delay of what?

I mean segment delay: time to download each segment.

We don't expose segment delay currently, but we track segment download times to build our bandwidth estimate. You may want to tinker with shaka.abr.EwmaBandwidthEstimator, specifically the sample method which receives the raw data from shaka.net.NetworkingEngine.

Since we're buffering ahead, we will (ideally) not experience that delay as a buffering delay. If you want to get information about the time the player spends buffering vs playing, you can get that from player.getStats(). In the latest code in master, we expose loadLatency (introduced in v2.1.x, time between load() call and playback of the first frame), playTime (total time spent in a playing state), and bufferingTime (total time spent in a buffering state).

P.S.: My email address is in the CONTRIBUTORS file if you want someone to give you feedback on your thesis. :-)

Was this page helpful?
0 / 5 - 0 ratings