I am trying to acquire process information at the frame level. I am encoding from a batch of still images, so my goal is to give a frame to ffmpeg , and then check the progress information to see if it is done encoding the frame or not.
I could get this information offline using -vstats_file or -vstats and the file that is created looks like this:
[Laurent Nguyen]"How do I get this information in real time, i.e. every time a frame is processed ? I tried to read from the file, but ffmpeg seems to be writing chunks."
I certainly have experienced this one before. I use the -vstats feature and get it to write to a named pipe (mkfifo). I then use this "live" to produce a graph of the results whilst it is encoding (ie. ffmpeg & sed & gnuplot). What I have found is that the output is buffered to 1024 bytes so as you said, it only writes in chunks.
IIRC, I did some hunting once a while back in the source (ffmpeg.c) and found a buffering option (char buf;) for this but gave up before getting it to work due to lack of C knowledge on my part.
Certainly worth revisiting though. Let me know if you find a workable solution. It would make you a legend in my mind;-)