shaka-project / shaka-packager

A media packaging and development framework for VOD and Live DASH and HLS applications, supporting Common Encryption for Widevine and other DRM Systems.
https://shaka-project.github.io/shaka-packager/
Other
2k stars 510 forks source link

How to specify the time length of each .ts file output? #1220

Closed richardARPANET closed 1 year ago

richardARPANET commented 1 year ago

Is it possible to make the .ts files have a shorter duration? (Something like the 'hls_time' option that ffmpeg has)

Here is how I'm using it: https://github.com/VeemsHQ/veems/blob/develop/veems/packaging/package_video_for_vod.sh#L34

richardARPANET commented 1 year ago

I've tried params --segment_duration 2 --fragment_duration 2. They do not work. Also tried each param on its own, same result.

zaygit commented 1 year ago

Have you checked the GOP of your source video? It might well be set at 6 seconds.

richardARPANET commented 1 year ago

@zaygit I'm ignorant to what that is and if it can be overridden?

zaygit commented 1 year ago

GOP is the length between two I frames (IDR for HLS). In HLS each segment must start with an IDR frame. So if your source video has an IDR every 6 seconds then the packager cannot create chunks of 2 seconds.

richardARPANET commented 1 year ago

Turns out earlier in the video processing I had set -g 240 (for the ffmpeg transcode step), removing this fixes the issue. Thanks