Is there a way, maybe via an ffmpeg option or flag, to force the client player to always start the playlist from the beginning when live streaming rather than the real time mid-stream?
Say the user comes in 1mn after the stream has started, rather than starting to watch at 1mn the player would start at the beginning of the video so minute zero.
Here is my ffmpeg command:
ffmpeg -f "screen capture" -s 1280x720 -r 30 -i :0.0+nomouse -f alsa -ac 2 -i pulse -async 30 -vcodec libx264 -pix_fmt yuv420p -acodec libfdk_aac -ar 44100 -b:a 64k -threads 0 -s 640x360 -f hls -g 1 -hls_time 1 -hls_list_size 1 -hls_allow_cache 0 /hls/#{@stream_name}/index.m3u8
Thanks!
Use -hls_list_size 0
to keep all segments in the playlist. Using a value greater than 0 will cause the playlist to use a sliding window of hls_list_size
length.
Also of note, using -hls_time 1
will greatly increase your playlist file size. The Apple recommended value is 6 seconds so you should try to increase it to a multiple of your desired keyframe interval.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With