Video and Audio not in sync

Asked by Garibaldi

Thank you for this fantastic video editor for linux! I have always enjoyed using iMovie for its easy-to-use interface and stability. Finally, this functionality is coming to linux! I imported some videos from a couple point and shoot cameras last night (avi format). When using them in OpenShot, I noticed that it doesn't keep the audio in sync with the video when dealing with videos from one of the cameras. I tried multiple times to import it but each time the video and audio got out of sync as I cut it and moved it around the timeline. Any ideas on how to address this problem?

Thanks!

Andrew

Question information

Language:
English Edit question
Status:
Solved
For:
OpenShot Video Editor Edit question
Assignee:
No assignee Edit question
Solved by:
Garibaldi
Solved:
Last query:
Last reply:
Revision history for this message
Helen McCall (wildnfree) said :
#1

Hello Garibaldi,

This has already been submitted as a bug report:

400251 A/V sync off when cutting up a video and exporting

Best wishes, Helen McCall

Revision history for this message
Jonathan Thomas (jonoomph) said :
#2

Can you please post the output of the following command on the video file that didn't stay in sync:
$ ffmpeg -i filename.avi

This might end up being related to the version of FFmpeg that is on your machine. Thanks.

Revision history for this message
Garibaldi (garibaldi) said :
#3

Sure, here it is:
$ ffmpeg -i MVI_3145.AVI
FFmpeg version 0.5-svn17737+3:0.svn20090303-1ubuntu6, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --extra-version=svn17737+3:0.svn20090303-1ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --disable-stripping --disable-vhook --enable-libdc1394 --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-armvfp --disable-neon --disable-altivec --disable-vis --enable-shared --disable-static
  libavutil 49.15. 0 / 49.15. 0
  libavcodec 52.20. 0 / 52.20. 0
  libavformat 52.31. 0 / 52.31. 0
  libavdevice 52. 1. 0 / 52. 1. 0
  libavfilter 0. 4. 0 / 0. 4. 0
  libswscale 0. 7. 1 / 0. 7. 1
  libpostproc 51. 2. 0 / 51. 2. 0
  built on Apr 10 2009 23:18:41, gcc: 4.3.3
Input #0, avi, from 'MVI_3145.AVI':
  Duration: 00:01:28.56, start: 0.000000, bitrate: 15083 kb/s
    Stream #0.0: Video: mjpeg, yuvj422p, 640x480, 30 tbr, 30 tbn, 30 tbc
    Stream #0.1: Audio: pcm_u8, 11024 Hz, mono, s16, 88 kb/s
At least one output file must be specified

Thanks,

Andrew

Revision history for this message
Jonathan Thomas (jonoomph) said :
#4

It looks like there are some known bugs in MLT dealing with A/V sync issues with some video codecs / formats. I know they are aware of them, but it could take some time before they are all fixed. You might try using ffmpeg to convert your video to a different format before editing.

FFmpeg example:
$ ffmpeg -i MyAVIThatDoesntWork.avi NewFileThatMightWork.mpeg

Revision history for this message
Garibaldi (garibaldi) said :
#5

Thanks I'll give that a shot!

Revision history for this message
Jonathan Thomas (jonoomph) said :
#6

I have made many changes related to A/V and timeline / preview sync. Please get the latest version and verify this is still a problem. Thanks!

Revision history for this message
Garibaldi (garibaldi) said :
#7

Sorry for the late follow up on this. I tried editing several different videos last night (including the one I mentioned above) and now noticed no audio/video sync issues both in the preview and rendered output file. Thanks for all your hard work on this truly fantastic video editor!

Revision history for this message
Cresho (cresho) said :
#8

Audio and video sync is an issue and is very related to your kernel version and MLT. Openshot is not the problem. I am currently using winff to convert the mp4 videos to mpeg through winff and using cinelerra with a modified xgamma correction for precise brightness fix. xv is heavily tied into cinelerra and cannot edit color or brightness correctly in cinelerra unless i use this command

#!/bin/bash

xgamma -gamma .7;
Cinelerra;
xgamma -gamma 1.0

to which I was brought in the ubuntu forums after that mess (but cinelerra is now manageble) and now I have encountered this awsome program.

Ill post if I have problems with audio/video sync.

Revision history for this message
Cresho (cresho) said :
#9

Just to update. I am running Ubuntu hardy heron. As in kdenlive, mlt and my kernel version causes problems if that is the case. I also experience audio/video sync issues.
kernel:
2.6.24-24-generic
MLT:
0.4.5

I have no issues in cinelerra.

This project is fantastic! I love the soft video transitions. Produces crisp clean videos and also looks professional.

the video I use is a xacti HD1000. file format is avchd and aac audio. I convert these to mpgusing winff. If I don't, I cannot use sound from my videos.

Here is the string I use to convert in winff.
-vcodec mpeg1video -r 59.94 -s 1280x720 -b 20000K -acodec mp2 -ab 320k -ar 48000 -ac 2

Revision history for this message
Cresho (cresho) said :
#10

ohh and the version of openshot is 0.9.22

Revision history for this message
Jonathan Thomas (jonoomph) said :
#11

You might try converting to a few different fps (i.e. -r), such as 29.97,
30, 60, just to see if it makes a difference.

On Thu, Sep 3, 2009 at 1:55 AM, Cresho
<email address hidden>wrote:

> Question #77782 on OpenShot Video Editor changed:
> https://answers.launchpad.net/openshot/+question/77782
>
> Cresho posted a new comment:
> ohh and the version of openshot is 0.9.22
>
> --
> You received this question notification because you are an answer
> contact for OpenShot Video Editor.
>

Revision history for this message
Cresho (cresho) said :
#12

well, I retried the 59.94fps and it failed: Sync was bad. I tried 29.97 and it works fine. both input videos and output videos used same settings minus the fps portion.

both projects were set according to file. if i used 59.94fps video, project was 60. If I used 29.97fps video, I used project was set to 30

Any thoughts on this? Someone suggested it could be an ffmpeg bug but i'm thinking its an mlt and kernel problem. I'm using medibuntu in hardy heron.

Ill try another night with 60 and 30 fps instead of the other 2 I used and post back results.