aiilab / javacv

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

JavaCV 0.11 getLengthInFrames() #505

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Simple use frameGrabber.getLengthInFrames()
2. Observer total number of frames above method retuns?
3. Observer total number of video and image frames processed?

What is the expected output? What do you see instead?
It should return total of audio+video frames OR is there any method to find out 
the total number of audio frames and video frames?

What version of the product are you using? On what operating system?
Java CV 0.11, Using Android Operating system.

Please provide any additional information below.
I want to process the video from end. So first of all fetch total number of 
frames using getLengthInFrames():

index = getLengthInFrames();
frameGrabber.setFrameNumber(index)

and fetch the frames from end to 0th index because i want to process the video 
from end to start.

But when I loop untill grabbedFrame != null then I notice that it prints as 
below:

Total No Of Frames (getLengthInFrames()) = 2968
Total No Of Audio Frames = 1856
Total No Of Video Frames = 2967

So if i use index to check that video processing is completed then audio is 
missing in new processed video. And If i do not use index then how can i know 
that which number i have to use in setFrameNumber to perform seek operation?

Is there any other way or best way to do this? Please help me.

Please let me know if further information is required.

Original issue reported on code.google.com by sanjay50...@gmail.com on 11 Jun 2015 at 6:16

GoogleCodeExporter commented 9 years ago
Since what you care about isn't the number of frames, just use setTimestamp() 
with getLenghtInTime(). This is much better supported by FFmpeg.

And please post any other questions you may have on either the mailing list or 
GitHub. Google Code will soon disappear.

Original comment by samuel.a...@gmail.com on 11 Jun 2015 at 12:16

GoogleCodeExporter commented 9 years ago
Hi Samuel,

Thank you for quick reply, it helps me a lot because i stuck.

I can get the total length in time using getLenghtInTime() method. This will 
seek to end of the file. After that i use grabFrame() and it will give me the 
frame from end. But i am stuck after that. How can i go to one frame previous 
and again from that one frame previous and till first frame of the video file.

grabFrame() automatically go to next frame. i.e. each time you call grabFrame() 
it grabs next frame. But how can i go reverse?

Please help me.

Original comment by sanjaymo...@gmail.com on 11 Jun 2015 at 12:34

GoogleCodeExporter commented 9 years ago
@Samuel. Can u please help me.

Original comment by sanjaymo...@gmail.com on 12 Jun 2015 at 5:59