'ffmpeg streaming lag cut pause, when I change crf qmin refs, etc, the lag remains
The question is about tuning a FFMPEG command, not about the context or the use, my setup works, it's only the lag part I'm trying to get smoother....
here the ffmpeg command
ffmpeg -y -f alsa -i pulse -f x11grab -draw_mouse 0
-framerate $FRAMERATE -video_size $RESOLUTION -i :$DISPLAY_NUM
-c:v libx264
-movflags +dash
-preset ultrafast
-crf 27 -refs 4 -qmin 4
-pix_fmt yuv420p
-c:a aac -ac 2
-profile:v baseline
-hls_time 6 -hls_list_size 0 -g 30
-start_number 0 -streaming 1 -hls_playlist 1 -lhls 1
-f hls -filter:v fps=$FRAMERATE x.m3u8
I tried changing values in preset, crf, refs, qmin, qmax, profile:v, hls_time......
no matter what I change doesn't fix the "lag" or feeling that it pause,
sample here : https://www.tubfeed.com/_/tubfeed/---/multishare/multimedia/16607032261648
is there any ffmpeg option or attribute that I missed to try ??
Solution 1:[1]
After digging a bit I found more flags for low_delay...
I did this and the lag disappeared
ffmpeg -y
-f alsa -thread_queue_size 4096
-i pulse -f x11grab -thread_queue_size 4096
-draw_mouse 0 -framerate $FRAMERATE
-video_size $RESOLUTION
-i :$DISPLAY_NUM
-c:v libx264
-movflags +dash
-fflags nobuffer
-flags low_delay
-threads 2
-preset ultrafast
-tune zerolatency
-crf 27 -refs 4 -qmin 4
-pix_fmt yuv420p
-c:a aac -ac 2
-profile:v baseline
-hls_time 6 -hls_list_size 0 -start_number 0
-streaming 1 -hls_playlist 1 -lhls 1
-f hls -filter:v fps=$FRAMERATE "/recordings/$VIDEO_ID/$VIDEO_NAME.m3u8"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | John R |
