[FFmpeg-user] ffmpeg for transcoding/stream into web pag

R C cjvijf at gmail.com
Mon May 13 08:50:03 EEST 2019


On 5/12/19 11:03 PM, Ted Park wrote:
>> I am using: ffmpeg -i "rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream" -y -c:a aac -b:a 160000 -ac 2 -s 960x540 -c:v libx264 -b:v 800000 -hls_time 10 -hls_list_size 10 -start_number 1 mystream.m3u8
>> ffmpeg creates a new file "mystreamnn.ts" every so much time, can the old files be deleted automatically, or can it "wrap around" and start from the start of the file again after a certain amount of time?
> You set the maximum number of entries in the playlist to 10, so if you add -hls_flags delete_segments by default it should only keep 10 + 1 segments before deleting them.

I changed it to this:

ffmpeg -i 
"rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream" 
-y -c:a aac -b:a 160000 -ac 2 -s 960x540 -c:v libx264 -b:v 800000 
-hls_time 6 -hls_list_size 10 -hls_flags delete_segments -start_number 1 
mystream.m3u8


that doesn't delete the "old files" though


>> mystream.m3u8 is created after "mystream1.ts" is created/finished, can it be created  as soon as ffmpeg starts, so the stream is "immediately" available?
> Well this is partly because HLS isn’t really a streaming protocol, I can’t think of any good way to avoid that initial delay. The recommended target duration of each segment is 6 seconds (or adjusted for drop frame) so if you change hls_time from 10 to 6 you could make it shorter but I don’t think that’s usually the “bottleneck,” so to speak. There’s the time needed to connect to the original rtsp source and transcode, for instance.
>
> If you keep an instance running constantly, this would be a non-issue though?

true,  but the delay is about 60 seconds or so,  I think that is because 
each segment is about that long?


> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list