Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You say it stops somewhere around 35 000 frames.

It is a good chance that some counter inside OpenCV or ffmpeg is hardcoded as short int, whose maximum value is 32 767. If that is the case, it's little to do. Another chance is that 1GB is the hardcoded limit of what your codec can support - some variable overflows after counting that many bits, or whatever.

What you can do:

  • Use another codec.

  • try to compile and run your program on an 64bit system - and hope that the troublesome variable will get upgraded to 4 bytes.

  • use the latest OpenCV, ffmpeg, codecs, Windows packages, etc. It is a chance that the problem has been fixed by someone else already.

  • Go with Linux. It may be that Linux has better support for it.

If none of these help, I'am afraid there is little else to do. You can try to find the problem by yourself and fix it. It may be anywhere, from OpenCV to the codec. Good luck!

And last, but not least, the easiest way, the "dummy solution":

  • Split your video in smaller sequences. VLC or the vanilla ffmpeg may be good at helping you with it.

You say it stops somewhere around 35 000 frames.

It is a good chance that some counter inside OpenCV or ffmpeg is hardcoded as short int, whose maximum value is 32 767. If that is the case, it's little to do. Another chance is that 1GB is the hardcoded limit of what your codec can support - some variable overflows after counting that many bits, or whatever.

What you can do:

  • Use another codec.

  • try to compile and run your program on an 64bit system - and hope that the troublesome variable will get upgraded to 4 bytes.

  • Use a decent compiler. Mingw is known to have some problems o windows. Use Visual Studio's compiler.

  • use the latest OpenCV, ffmpeg, codecs, Windows packages, etc. It is a chance that the problem has been fixed by someone else already.

  • Go with Linux. It may be that Linux has better support for it.

If none of these help, I'am afraid there is little else to do. You can try to find the problem by yourself and fix it. It may be anywhere, from OpenCV to the codec. Good luck!

And last, but not least, the easiest way, the "dummy solution":

  • Split your video in smaller sequences. VLC or the vanilla ffmpeg may be good at helping you with it.