3

I'm using FFMPEG(h264) and I want to reduce latency as much as possible. Now it's about 700 ms and I can't really make it lower. I tried almost all, so maybe anyone has idea how to help me?

ffmpeg -f dshow -i video="screen-capture-recorder" -pix_fmt yuv420p -probesize 32 -r 100 -an -vcodec libx264 -crf 40 -preset ultrafast -tune zerolatency -threads 8 -thread_type slice -f mpegts udp://192.168.88.228:1234

The weird thing is I got this latency even on 127.0.0.1.... (on the other side I use just ffplay udp:// .......)

KKKk
  • 93
  • 2
  • 15

2 Answers2

0

I would try to set -threads to 1 to disable multi-threaded decoding. Multi-threaded decoding introduces delay by adding a lag of 1 frame for each thread.

Tides
  • 111
  • 11
0

Works with a GoPro Hero 8 Black and Linux

ffmpeg -threads 1 -i 'udp://@0.0.0.0:8554?overrun_nonfatal=1&fifo_size=50000000' -f:v mpegts -fflags nobuffer -vf format=yuv420p -f v4l2 /dev/video0
Striped
  • 2,544
  • 3
  • 25
  • 31