MiaoRong / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

FFmpegFrameGrabber on Android only works with small files #231

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Load a Video using FFmpegFrameGrabber on Android
2. Use FFmpegFrameGrabber.getLengthInFrames()

What is the expected output? What do you see instead?
It should report the total amount of frames in the video clip.
On small videos (< 1MB) it´s greater than 0, but never greater than 5 (size 
dependent).
I can only grab an empty IplImage (right dimensions and .isNull() = false) on 
the other videos.

What version of the product are you using? On what operating system?
JavaCV 0.2 on Android 3.2 (HoneyStreak Mod), arm 7 (but using arm5 natives).

Please provide any additional information below.
Video dimensions and framerate are always correct.

Code (shortened):
Analysis.current.videoData = new 
FFmpegFrameGrabber(Analysis.current.pathToVideo);
Analysis.current.videoData.setFormat(extension); //extension is mp4/avi etc.
Analysis.current.videoData.start();
int frames = Analysis.current.videoData.getLengthInFrames(); //Most times 0
double framerate = Analysis.current.videoData.getFrameRate(); //Works

No exceptions or memory / gc related errors, only "unable to find class 
referenced in signature (Ljava/awt/image/BufferedImage;)" like 20 times.

Original issue reported on code.google.com by ffab...@googlemail.com on 5 Aug 2012 at 1:42

GoogleCodeExporter commented 9 years ago
Does calling grab() in a loop gets you all the frames?

Original comment by samuel.a...@gmail.com on 5 Aug 2012 at 1:45

GoogleCodeExporter commented 9 years ago
Yes, that does indeed work, so do I have to loop through until I get an 
Exception?

Original comment by ffab...@googlemail.com on 5 Aug 2012 at 1:50

GoogleCodeExporter commented 9 years ago
No, just until grab() returns null, but it looks like my getLengthInFrames()'s 
borked, can you check if the following works?
    lengthInFrames = getLengthInTime() * getFrameRate() / 1000000
thanks!

Original comment by samuel.a...@gmail.com on 5 Aug 2012 at 1:51

GoogleCodeExporter commented 9 years ago
That seems to work, 1455,0 frames are enough for 48 secs.

Original comment by ffab...@googlemail.com on 5 Aug 2012 at 2:00

GoogleCodeExporter commented 9 years ago
Great, thanks for reporting!

Original comment by samuel.a...@gmail.com on 5 Aug 2012 at 2:01

GoogleCodeExporter commented 9 years ago
I've include the changes in JavaCV 0.3! Thanks for reporting and let me know if 
it's still not working alright for some reason, thanks!

Original comment by samuel.a...@gmail.com on 5 Nov 2012 at 11:36