Bug 346898

Summary: audio/video desync for clips with "start:" != 00:00:00.0
Product: [Applications] kdenlive Reporter: Daniel Musketa <daniel.musketa>
Component: Rendering & ExportAssignee: Jean-Baptiste Mardelle <jb>
Status: RESOLVED WAITINGFORINFO    
Severity: minor CC: grzesiek.golec, walmartshopper, wegwerf-1-2-3
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Daniel Musketa 2015-04-29 12:23:09 UTC
When I use video files that were generated with a start timestamp other than 00:00:00.0 I get a/v desync when skipping towards the end of that clip.

Reproducible: Always

Steps to Reproduce:
Example:
$ avconv -i input_1920x1080.mov -map 0:0 -map 0:1 -codec:v dnxhd -b:v 185M -ac 2 -codec:a pcm_s16le -f segment -segment_time 60 output_%03d.mov

The resulting files look something like this:

$ avprobe output_119.mov
avprobe version 12_dev0-6:12~~git20150417.1336bb0~ubuntu14.04.1, Copyright (c) 2007-2015 the Libav developers
  built on Apr 17 2015 18:48:09 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1d050c0] multiple edit list entries, a/v desync might occur, patch welcome
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1d050c0] multiple edit list entries, a/v desync might occur, patch welcome
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output119.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf56.18.0
  Duration: 00:01:00.02, start: 7140.007000, bitrate: 177506 kb/s
    Stream #0:0(eng): Video: dnxhd [AVdn / 0x6E645641]
      yuv422p, 1920x1080, 175984 kb/s
      23.98 fps, 24k tbn (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: pcm_s16le [lpcm / 0x6D63706C]
      48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      handler_name    : DataHandler
# avprobe output



The "start: 7140.007000" seems to be important here.

If I do

$ avconv -i output_119.mov -map 0:0 -map 0:1 -codec:v copy -codec:a copy output_119.CLEAN.mov

I get "start: 0.000000" and the problem does not appear.
Comment 1 walmartshopper 2015-06-03 20:40:37 UTC
I'm not sure if it's the same issue, but I noticed if I cut out the first few seconds of a song and then slide it to the beginning of the timeline, I get audio sync issues after some time.  Closing kdenlive and re-opening the project seems to fix it.
Comment 2 Wegwerf 2016-07-22 15:02:04 UTC
Can you please try playing your original clip using melt to see if the desync is already happedning at the MLT layer? If yes, this needs to be reported upstream to the MLT project, otherwise it may be in Kdenlive's ballpark.