Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create less segments for small files #1486

Open
muraty opened this issue Nov 1, 2023 · 2 comments
Open

Create less segments for small files #1486

muraty opened this issue Nov 1, 2023 · 2 comments

Comments

@muraty
Copy link

muraty commented Nov 1, 2023

Hello.

Is it possible to have only one segment for a file for HLS? Or specify size in bytes for each segment just like duration?

For context, we have subtitle files those are less than 1MB for a 2 hour video. If we segment them into streams with default duration which is 10s (vod_segment_duration), clients do hundreds of requests in total to download all segments. Segmentation into streams works well for video files but small files cause hundreads of unnecessary requests.

If having only one segment or specifying segment size in bytes are not options, what can we do to have less segments? I think increasing vod_segment_duration might work but sounds a little bit tricky.

Thanks,
Murat.

@erankor
Copy link
Contributor

erankor commented Nov 2, 2023

Yeah, this is correct, it makes sense to use larger segments for subtitles. I thought about supporting it long time ago, but never got to it...
If it really bothers you, you can probably work around it by using 2 locations - one location will have a vod_segment_duration of 10s (or whatever you want for video/audio), the other location will have vod_segment_duration of 60s (for example). You can use a regex on the subtitle location, so that it will capture only requests for subtitle index.m3u8/seg.vtt.

@muraty
Copy link
Author

muraty commented Nov 3, 2023

That's what I thought as a workaround. Thanks for the suggestion anyway.

A configuration for this would be nice-to-have. I don't know how much work it needs though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants