Ffmpeg HTTP LIVE STREAMING removes old segments

Hi, I have an HTTP streaming stream for ffmpeg I want to create HLS im streams using ffmpeg to do this

ffmpeg -i http://127.0.0.1:4242/bysid/7275 -map 0 -codec:v libx264 -codec:a copy -f ssegment -segment_list playlist.m3u8 -segment_list_type hls -segment_list_size 10 -segment_list_flags +live -segment_time 10 out%03d.ts 

i works fine, i just want to remove old segmens that are not showing in playlist.m3u8

 segment_list_size 10 

this will save the last 10 in the playlist file, I want to save only these files on the hard drive

+5
source share
1 answer

You can use the recently added option for the HLS segmentator:

 -hls_flags delete_segments 

You will need to change your command to use the HLS segmentator, not the stream segmenter, using -f hls instead of -f ssegment.

I use this parameter, and it does not do exactly what you request, but rather is implemented to comply with the HLS specification. See the ffmpeg documentation for more information: https://www.ffmpeg.org/ffmpeg-formats.html

+6
source

Source: https://habr.com/ru/post/1208026/


All Articles