Bug 353989 - Audio/Video out of sync on render
Summary: Audio/Video out of sync on render
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Video Display & Export (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-17 02:30 UTC by Steve
Modified: 2016-05-31 15:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve 2015-10-17 02:30:21 UTC
OpenSuse Tumbleweed 64-bit
16 GB RAM
Nvidia driver 355.11
Kdenlive 15.08.01
Source files:  1920x1080 DNxHD 29.97fps, WAV 48KHz
Project: 1920x1080p 29.97fps
Render to: MP4 H.264/AAC (fast or High Profile)

This is a longstanding issue from the kdenlive 0.9.x days. I realize that there was work done on the 15.x series to try to defeat this issue, but it still remains.

Audio and video look in sync while editing.  Using ffplay on the rendered mp4 file, the audio drifts ahead of the video as time goes by.

On a 25 minute video I just edited, the audio/video start out in perfect sync. By the end of the video, the audio is 0.5 seconds ahead of the video.

On longer videos I have had the drift be as much as 1.5 seconds.
The audio file is from a Roland audio recorder with a body mike to get better sound than the camera mike 30 feet away.


My workaround is to:
1) Extract the audio wav file from the rendered file using ffmpeg
2) Open the wav file in Audacity
3) Use Change Tempo to stretch the wav
4) Save the stretched wav file
5) Use ffmpeg to combine the video from the rendered file and the audio from the stretched wav file
6) Test and repeat from step 3 until correct

SUCCESS:
==============
If I create a project with just the video file and render it, the audio and video are in sync for the entire duration.

FAILURE:
==============
For testing I created:
A project with one video file and one audio file.
I lined up the files in kdenlive for sync. The sync is maintained throughout the project.
I added mute to the audio file so all sound will come from the video file.
The rendered file has the audio/video drift.


Reproducible: Always

Steps to Reproduce:
1. Place a video file with audio in it of sufficient length ( >20 minutes)
2. Place the audio wav file
3. Line up the video to perfect sync with the audio wav file
4) Mute the audio wav file with Audio Correction-Mute (All audio will come from the video file)
5) Render

Actual Results:  
Audio will be out of sync with the video at the end.

Expected Results:  
Audio will stay in sync throughout the whole rendered video.
Comment 1 Jean-Baptiste Mardelle 2016-05-31 06:32:08 UTC
This might have been fixed in MLT 6.0.0, see this commit :
https://github.com/mltframework/mlt/commit/b264065634f0536bd302eeae6e61a4df3e60ba0d

Can you test with MLT >= 6.0.0
Comment 2 Steve 2016-05-31 15:30:40 UTC
Yes.
With MLT 6.2 and Kdenlive 16.07 looks fixed.

Thank you