Hi Adrian,

> I have a strange problem when using Kdenlive, but which I think is due
> to MLT: I have a recording of a singer from two angles and I want to
> switch between them. However, AV never is in sync. There are problems
> with a scenario as simple as the following:
> 
> Put a video on track 2, and the other on top of it on track 1. The
> position of the 1st is aligned (delayed) to the 2nd. Audio from both
> videos is active. Then I cut "holes" into the 1st to show track 2. The
> result is as follows:
> 
> * In the render output and the project monitor (if the project is
> played from the beginning), AV gets out of sync only on track 2 (the
> audio belonging to the video!), but the two combined audio sync is
> fine.
> 
> * If I seek to arbitrary positions (position with either holes or no
> holes, active video 1 or 2, respectively), AV sync on track 2 is fine,
> but A and V is not in sync with track 1 when it is active.
> 
> So, either way, I can not reliably sync the two tracks. What can I do?


Your question is probably better suited for the KDENLIVe list.

I've never tried to synchronize audio tracks myself. But here are some ideas:
Have you read this:
http://www.addlime.com/blog/video/kdenlive-multicam-editing-workflow/
And this:
http://userbase.kde.org/Kdenlive/Manual/Timeline/Right_Click_Menu

What you are trying to do is dfficult for two reasons:
1) Your two recording devices were not frame locked. So, a frame captured on 
device 1 may have occurred 10ms sooner than the closest frame captured by 
device 2. So there is no way to perfectly synchronize the video from the two 
sources.


2) Your two video/audio recording devices were not frequency locked. So even if 
they were both recording at the same time, due to tolerences in electronic 
devices, one was invariably recording slightly faster than the other. No matter 
what, one will drift away from the other.

So, the best you can hope for is one video source that is perfectly synced to 
the audio and another source that is approximately synced to the audio.

> Note: Track 2 material is obtained from a camcorder. It consists of
> several MPG files joined with the ffmpeg concat demuxer and transcoded
> to x264. I also tried -vsync cfr. When playing in melt or ffplay,
> video gets out of sync occasionally, frame drop is increased (ffplay
> fd=X value), and then resyncs.


This is probably working against you for the reasons I wrote above.

Here is my advice.

1) Choose one of the sources to serve as the reference audio. Only use the 
audio from this source.

2) Put the reference audio source on track 2.

3) Use the technique in the link above to set track 2 as the reference audio.

4) Take the clip from the slave source (non reference) and chop it up into a 
bunch of small pieces (maybe 20-30 seconds - try difference sizes to see what 
works).

5) Put all these clips on track 1 in order.


6) Use the technique in the link above to align the clips on track 1 with the 
reference on track 2. I expect you will have to do each one individually. I've 
never tried this.


7) Assuming that the smaller clips on track 1 can be reasonably aligned with 
the reference on track 2...

8) Mute the audio on track 1 so that the reference audio from track 2 is all 
that is ever heard.

9) Edit and "poke holes" in track 1 to reveal video from track 2  - apply 
transitions to keep things interesting. Insert artistic effect here.

My reasoning is that the clips on track 1 will drift away from track 2 over 
time. But since they are short, they will not drift far enough way to be 
noticible before you cut to video on track 2 (which will always be in sync). 
Then, when you cut back to track 1, it will be a new clip that was 
"resynchronized" to the reference - and will not result in an apparent drift 
over time.


Again, I've not tried this myself. There are probably people on the KDENLIVe 
list who have.

Good luck!

~Brian


------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to