lopbeer.blogg.se

Ffmpeg rtsp stream latency
Ffmpeg rtsp stream latency






c:v libx264 -acodec copy -b:v 768k -vf “scale=720:trunc(ow/a/2)*2” -tune zerolatency -preset veryfast -crf 23 -g 60 -hls_list_size 0 -f flv rtmp://localhost/hls/$name_mid c:v libx264 -acodec copy -b:v 256k -vf “scale=480:trunc(ow/a/2)*2” -tune zerolatency -preset veryfast -crf 23 -g 60 -hls_list_size 0 -f flv rtmp://localhost/hls/$name_low

#Ffmpeg rtsp stream latency how to#

Hey thanks for wonderful articles on rtmp, do u have any atricles on how to setup nginx rtmp for playing hls streaming with reduced latency? my current setting for adaptive sgtreaming with ffmpeg isĮxec ffmpeg -i rtmp://localhost/$app/$name -async 1 -vsync -1 # Transcoding can be enabled here, or by using the abshls application below. This is usually no problem at all since platforms like YouTube Live or have the same delay. Use the 4 seconds of segment size and you have a delay of up to 30 seconds. This requires a lot new features that the server (in our case FFmpeg) must implement (currently, April 2020 doesn’t support this). They have extended the HLS protocol and published this as a new RFC draft. I personally recommend not using a value lesser then 2 seconds: -hls_time 2 More informationĪpple has also published an article about this topic. So reduce the segment size only if you need a lesser delay.Īpple recommends a target duration of 6 seconds. But this causes more overhead because more files must be created, the playlist file must be updated more often and also the client must reload the playlist more often. Using smaller segment duration might be an option. This gives you the delay of up to 30 seconds. On top of this you have a delay on the RTMP encoding on client side and the upload/transfer to the server (typically 1-4 seconds). Also the encoder is always processing one segment (another 4 seconds delay). Another segment is on delay because the player must reload always the playlist (–> up to 4 seconds). The player typically caches 2-4 segments (–> 8-16 seconds delay).

ffmpeg rtsp stream latency

We create currently segments with a duration of 4 seconds.

ffmpeg rtsp stream latency

In our example we have a typically delay of 20-30 seconds. Follow the link here to get an overview over all articles.






Ffmpeg rtsp stream latency