0

I am working on a project and am following https://gist.github.com/mrbar42/ae111731906f958b396f30906004b3fa to convert a mp4 file to a HLS m3u8 playlist. So far everything worked out. What I am trying to do now is an optimisation of the stream such that initial segment(s) can be of smaller size than the rest of them.

What I have already tried is:

  1. hls_init_time, as per the documentation, this flag does the job. But when I say -hls_playlist_type vod, it forces hls_list_size to be 0 (again, as per the documentation). It made sense to me cause in a VOD, the playlist/manifest should have this info available always (cmiiw).
  2. played with ffmpeg and bash commands to get the playlist in the desired format, i.e. have segments with variable lengths. As a result, the video had an added pause after the variable segments (before the lengthier segments started to play).

looks like a std problem What I am stuck at is:

  1. Is this even possible to have segments in the m3u8 file with variable length?
  2. Is there any other way I can achieve the above mentioned optimisation (changing playlist type/passing some other existing flag)?
dravit
  • 553
  • 6
  • 16
  • 1
    Why should the initial segment have a smaller size? What you try to achieve with this? – martinr92 Jan 31 '21 at 17:05
  • as I mentioned, it's to optimise the stream. load initial chunks faster – dravit Feb 01 '21 at 04:36
  • 1
    IMHO makes this no sense in HLS. Because the goal is to have the same segment sizes / file sizes. If you provide multiple variants (bitrates) then the client chooses typically a lower bitrate for the first segments and switches then automatically into a higher resolution for a faster start of the movie. – martinr92 Feb 01 '21 at 11:47
  • As per my understanding, meanwhile the initial segments (the ones which were of smaller length and hence were loaded quickly) are being watched, client can download the next segments easily(which are lengthier and hence need more bandwidth). This keeps my end user to not be stuck on loading/buffering screen. – dravit Feb 01 '21 at 12:48

0 Answers0