Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaCV 0.11 getLengthInFrames() #505

Closed
GoogleCodeExporter opened this issue Mar 23, 2016 · 3 comments
Closed

JavaCV 0.11 getLengthInFrames() #505

GoogleCodeExporter opened this issue Mar 23, 2016 · 3 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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

  • Changed state: Done
  • Added labels: Type-Other
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

@Samuel. Can u please help me.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant