0

Im starting an ffmpeg process, where the input is a FIFO file i created. Im writing some data in a loop to the FIFO file, but the ffmpeg process doesn't start streaming until one of the two happens:

  1. i'm closing the file
  2. iv'e written a certain amount of data. after a while of writing, the ffmpeg process starts streaming. The more data i write, the faster it starts running. (im writing a chunk of data on each loop, if i just duplicate those chunks times 100, it starts much faster).

What can be the reason for that? Is there a minimum of data required for the ffmpeg process to start streaming? How can i "force" it to start, without closing the FIFO file after writing?

tamirg
  • 607
  • 1
  • 7
  • 15
  • Sounds like yes, it is waiting for a certain amount of data. What file format are you streaming? Some formats are better than others. – user253751 Jun 23 '22 at 09:14
  • its a h264 frame – tamirg Jun 23 '22 at 09:20
  • Try adding the argument `-tune zerolatency`. The default latency of `libx264` codec is about 26 video frames (only after writing the 27'th frame, the first encoded frame get out). With `-tune zerolatency` it should be "frame in frame out". The price is higher bitrate and/or lower encoded video quality. – Rotem Jun 23 '22 at 15:54

0 Answers0