bentasker / HLS-Stream-Creator

Simple Bash Script to take a media file, segment it and create an M3U8 playlist for serving using HLS
BSD 3-Clause "New" or "Revised" License
273 stars 101 forks source link

FFMPEG will be called only once #6

Closed ironsmile closed 9 years ago

ironsmile commented 9 years ago

FFMPEG can handle splitting the file in segments by itself. This is more efficient and also does not produce any errors. The previous implementation was using integers which made it possible for errors on generating the last segment.

Also, when used with the segment_list parameter, ffmpeg will generate the m3u8 file as well. There is no need to create it ourselves. The ffmpeg generated playlist will be more accurate in its #EXTINF tags.

Few environment variables are added for finer control over the ffmpeg behaviour.

bentasker commented 9 years ago

Last time I looked at the segment_list parameter, they were making a mess of m3u8's (from a HLS perspective), but does seem they've fixed that now.

One thing we do lose is the ability to handle a live rather than a VoD stream. Not sure the script was being used for that anyway, but should simply be a case of having the user identify whether we need to pass the following to ffmpeg

-segment_list_flags +live

Other than that, looks good, so merging.

ironsmile commented 9 years ago

Great! :)