selvinEduardo / javacv

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

Timestamp difference between to sequential frames sometimes is <0 #408

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. For file from 
http://trac.ffmpeg.org/attachment/ticket/2910/ticket%20%232910.mp4 run code:
 FFmpegFrameGrabber gr = new FFmpegFrameGrabber(f);
 gr.setImageMode(ImageMode.GRAY); gr.start();
 for(int j=0;;j++){
   final Frame fr = gr.grabFrame();
   System.out.println(j + ", " + gr.getTimestamp());
 }

What is the expected output? What do you see instead?
Monotonic function expected.
Instead I see non-monotonic: 
0, 0
1, 41666
2, 83333
3, 125000
4, 166666
5, 23219
6, 46439
7, 69659
8, 92879
9, 116099
...

What version of the product are you using? On what operating system?
javacv-0.7, win7

Please provide any additional information below.
May be this problem with decoding P-frames is related: 
http://trac.ffmpeg.org/ticket/2910

Original issue reported on code.google.com by mip...@gmail.com on 14 Jan 2014 at 4:47

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Like in Issue 409 the same story here: the same video with sound removed(see 
attachment in http://code.google.com/p/javacv/issues/detail?id=409#c1 ) gives 
correct and stable result for this video in terms of time difference between 
sequential frames (not exactly the same code as given above where just time 
measured, not time difference): 
0, 0
1, 41666
2, 41667
3, 41667
.. etc, there are only 41667 values until the last frame, that is correct value 
for 24 fps.

I hope this will help.

Original comment by mip...@gmail.com on 14 Jan 2014 at 10:30

GoogleCodeExporter commented 9 years ago
You're mixing video and audio frames. If the timestamps of the video frames are 
increasing, and the timestamps of the audio frames are increasing, then 
everything is normal. There is no reason for video and audio frames to be 
synchronized among them, although they usually are up to a point. So, I guess 
that also was not an issue after all? Please post your questions on the mailing 
list next if possible, thanks!

Original comment by samuel.a...@gmail.com on 15 Jan 2014 at 12:28

GoogleCodeExporter commented 9 years ago
Yes, I missed that:
FFmpegFrameGrabber.grabKeyFrame() is FFmpegFrameGrabber.grabFrame(true, false, 
true);
and
FFmpegFrameGrabber.grabFrame() is FFmpegFrameGrabber.grabFrame(true, true, 
false);
and if i need just videoframe I should use FFmpegFrameGrabber.grab()

Sorry, I noticed this too late. But I tried to ask about that in Issue 312 in 
comments. So please don't blame me for this issues I shouldn't create :)

Original comment by mip...@gmail.com on 15 Jan 2014 at 1:48