MathewSachin / Captura

Capture Screen, Audio, Cursor, Mouse Clicks and Keystrokes
https://mathewsachin.github.io/Captura/
MIT License
9.82k stars 1.84k forks source link

How does Captura/FFMpeg handle long recording sessions #518

Open ericjang opened 4 years ago

ericjang commented 4 years ago

FFMpegVideoWriter default settings does not seem to guarantee that encoding is "-tune ultrafast", so it's quite possible that the user is sending frames to the named output pipe faster than FFMpeg can generate encoded frames. I could see a How does Captura/FFMpeg handle this, in general? Does FFMpeg simply drop inputs if there are too much input data in its buffer?

(I'm in the process of investigating the crashes in https://github.com/MathewSachin/Captura/issues/454#issuecomment-605488814, it's probably not related but just double checking to make sure)

MathewSachin commented 4 years ago

Hmm... I don't think the Recreate Target error should be related to FFmpeg. Does that error not happen if you use the MF (Media Foundation) encoder?

Well, for how FFmpegVideoWriter works: Earlier Captura used to throw all the frames into the pipe as soon as they were available. But, in the current version of the code and the latest pre-release version (v9.0.0-beta4), Captura drops frames if earlier frames are not written yet. Still, at least 5 frames are sent into the pipe at a time.

Also, AFAIK, the option should be -preset ultrafast and is a parameter for the H.264 encoder only.