[FFmpeg-user] Latency in UDP to HLS Conversion

KRISHNAKUMAR N K nk.krishnakumar at gmail.com
Wed Aug 19 16:27:09 EEST 2020


Hi Guys

I am converting UDP Input to Live HLS output and pushing the chunks to a
webdav server. Initial playback works fine, but the playback was delayed by
almost an hour, when we checked after 15 hours. I can also see that the cpu
load average is very less.

*ffmpeg :*










*ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers  built
with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)  configuration:
--prefix=/root/ffmpeg-4.3/ffmpeg_build --pkg-config-flags=--static
--extra-cflags='-I/root/ffmpeg-4.3/ffmpeg_build/include
-I/usr/local/cuda/include'
--extra-ldflags='-L/root/ffmpeg-4.3/ffmpeg_build/lib
-L/usr/local/cuda/lib64' --extra-libs=-lpthread --extra-libs=-lm
--bindir=/root/ffmpeg-4.3/bin --enable-gpl --enable-libfdk_aac
--enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvpx
--enable-libx264 --enable-libx265 --enable-cuda --enable-cuvid
--enable-nvenc --enable-libnpp --enable-nonfree --enable-openssl  libavutil
     56. 51.100 / 56. 51.100  libavcodec     58. 91.100 / 58. 91.100
libavformat    58. 45.100 / 58. 45.100  libavdevice    58. 10.100 / 58.
10.100  libavfilter     7. 85.100 /  7. 85.100  libswscale      5.  7.100 /
 5.  7.100  libswresample   3.  7.100 /  3.  7.100  libpostproc    55.
 7.100 / 55.  7.100*

Below is the ffmpeg command that i am using. Any help would be appreciated.






*ffmpeg -i "udp://230.1.1.15:10000?fifo_size=10000000&overrun_nonfatal=1
<http://230.1.1.15:10000?fifo_size=10000000&overrun_nonfatal=1>"
-analyzeduration 25M -probesize 50M -threads 0 -vsync 1 -filter_complex
"[i:0xd49]yadif[vout];[vout]split=4[out0][out1][out2][out3];[out0]setdar=16/9[v0];[out1]setdar=16/9[v1];[out2]setdar=16/9[v2];[out3]setdar=16/9[v3];[i:0xd4a]aresample=async=1:min_hard_comp=0.100000:first_pts=0[aout];[aout]asplit=4[a0][a1][a2][a3]"
\-vcodec libx264 -s:v:0 256x144 -tune film -r:v:0 25 -b:v:0 100000
-maxrate:v:0 100000 -minrate:v:0 100000 -bufsize:v:0 200000 -acodec
libfdk_aac -ar:0 48000 -b:a:0 48000 -sc_threshold 0 -pix_fmt yuv420p -flags
+global_header+cgop -profile:v:0 baseline -level:v:0 3.0 -preset fast
-nal-hrd cbr -keyint_min 50 -g 50 -map [v0] -map [a0] \-vcodec libx264
-s:v:1 512x288 -tune film -r:v:1 25 -b:v:1 200000 -maxrate:v:1 200000
-minrate:v:1 200000 -bufsize:v:1 400000 -acodec libfdk_aac -ar:1 48000
-b:a:1 48000 -sc_threshold 0 -pix_fmt yuv420p -flags +global_header+cgop
-profile:v:1 baseline -level:v:1 3.0 -preset fast -nal-hrd cbr -keyint_min
50 -g 50 -map [v1] -map [a1] \-vcodec libx264 -s:v:2 640x360 -tune film
-r:v:2 25 -b:v:2 700000 -maxrate:v:2 700000 -minrate:v:2 700000
-bufsize:v:2 1400000 -acodec libfdk_aac -ar:2 48000 -b:a:2 48000
-sc_threshold 0 -pix_fmt yuv420p -flags +global_header+cgop -profile:v:2
main -level:v:2 3.1 -preset fast -nal-hrd cbr -keyint_min 50 -g 50 -map
[v2] -map [a2] \-vcodec libx264 -s:v:3 1280x720 -tune film -r:v:3 25 -b:v:3
1000000 -maxrate:v:3 1000000 -minrate:v:3 1000000 -bufsize:v:3 2000000
-acodec libfdk_aac -ar:3 48000 -b:a:3 48000 -sc_threshold 0 -pix_fmt
yuv420p -flags +global_header+cgop -profile:v:3 high -level:v:3 4.0 -preset
fast -nal-hrd cbr -keyint_min 50 -g 50 -map [v3] -map [a3] \-f hls
-var_stream_map "a:0,v:0,name:148k a:1,v:1,name:248k a:2,v:2,name:764k
a:3,v:3,name:1064k" -master_pl_name master.m3u8 -hls_list_size 3 -hls_time
6 -method PUT -ignore_io_errors 1 -hls_segment_filename
https://usr:pass@example.com:8043/httppush/media_%v_%03d.ts -hls_flags
delete_segments+independent_segments+discont_start
https://usr:pass@example.com:8043/httppush/playlist_%v.m3u8*

Regards

*KrishnaKumar **N K *


More information about the ffmpeg-user mailing list