I am using JavaCV and it's FFmpegFrameGrabber in my project. It loads and player files OK, when I launch the project from Eclipse, but shows either a black screen or a still 1st frame when I run a compiled project. Sometimes comming with this error:
Input #0, avi, from 'C:/path/Start_Cut.avi':
Duration: 00:00:20.03, start: 0.000000, bitrate: 26002 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 1920x1080, 30 tbr, 30 tbn, 30 tbc
Cannot allocate memory. com.googlecode.javacv.FrameGrabber$Exception: Cannot initialize the conversion c ontext.
at com.googlecode.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.jav a:280)
and sometimes with
[mpeg4 @ 6A95DF20] Invalid and inefficient vfw-avi packed B frames detected
Input #0, avi, from 'C:/path/Start_Cut.avi':
Duration: 00:00:20.03, start: 0.000000, bitrate: 26002 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 25 tbr, 30
tbn, 25 tbc
does anyone has a clue on this?
UPDATE:
I have been able to narrow down the problem. For some reason, FFmpegFrameGrabber returns null
upn calling the grab()
method. Why does it work in Eclipse and does not work in standalone build? All libraries are included and I suppose, it would come up with an error if they did not.
Upgrading to the 2.4.0 version of OpenCV and to the current version of JavaCV did the trick. If someone gets in the same situation (which is unlikely), just perform a brand new installation following the instruction on the JavaCV website.