sawpawan / javacv

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

FFmpegFrameGrabber record() out of sync in Android #358

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.i'm trying to merge two video files from the sdcard using javacv 
FFmpegFrameGrabber , but in the output file audio and video appears to be out 
of sync
2.
3.

What is the expected output? What do you see instead?
the audio and video appears to be out of sync.

What version of the product are you using? On what operating system?
Using JavaCV .5,

Please provide any additional information below.
the two input files are Camco_0.mp4 and Camco_1.mp4 and the output is 
output34.mp4

Please Help!!

Original issue reported on code.google.com by cybrop...@gmail.com on 2 Sep 2013 at 9:54

Attachments:

GoogleCodeExporter commented 8 years ago
Those video files are variable frame rate (VBR) so we need to reencode the 
images that way too. Changing your loops to the following works for me here:
    while ((frame = grabber1.grabFrame()) != null) {
        recorder2.setTimestamp(grabber1.getTimestamp());
        recorder2.record(frame);
    }
    long t = recorder2.getTimestamp();
    while ((frame = grabber2.grabFrame()) != null) {
        recorder2.setTimestamp(t + grabber2.getTimestamp());
        recorder2.record(frame);
    }

And please ask your questions on the mailing list next time if possible, thanks!

Original comment by samuel.a...@gmail.com on 16 Sep 2013 at 1:33

GoogleCodeExporter commented 8 years ago
WOW!! it worked , Thanks for the help!

Original comment by cybrop...@gmail.com on 19 Sep 2013 at 9:46

GoogleCodeExporter commented 8 years ago
Hi Samuel,

Can I combine more than 2 videos?I can record .But after 2 videos the frames 
freezes.

Original comment by amlan....@gmail.com on 27 Aug 2014 at 7:42

GoogleCodeExporter commented 8 years ago
I am facing the error 
Could not find class 'org.bytedeco.javacv.FFmpegFrameGrabber
in Android. Can you please resolve this.

Original comment by dfivet...@gmail.com on 22 Apr 2015 at 1:41

GoogleCodeExporter commented 8 years ago
@dfivetech Please try again with the latest version of 0.11, thank you.

Original comment by samuel.a...@gmail.com on 3 May 2015 at 12:06