Weird buffering issue hidden somewhere?

Ok, as I was trying to build a reproducible example, I noticed a potential solution.

It turns out nothing this was a combination of two things:

  • I was running ffplay -fflags nobuffer -, but apparently, removing -fflags nobuffer is part of the solution (only works in conjunction with the next point)
  • the program kept running in an infinite loop where, after the whole file was read, it would get stuck reading 0-length buffers all the time. Forcing a break out of the loop once buf == 0 seems to make something flush, and the whole video shows at some point

I should note, for context, that I'm using a small video file for debugging. only a couple of seconds, 112kb of size. I'm guessing this is too small, and even trying to force a flush is not enough for ffplay to play it, and only an EOF of its stdin is triggering it?

I should not as well that drop(child.stdin.take()) as suggested above didn't work either

Anyway, this isn't fully solved, if I were to be pedantic, since I still don't know the full story, but it seems that a real-world scenario (with real-time live video for longer durations instead of just a 100kb clip) won't fall under this problem

Thank you all

1 Like