View Full Version : VirtualDub2 cropped video fails to sync to audio with "match duration"
stormy1777
2nd November 2018, 09:22
Figured to open a separate thread instead of hitting the main one with possibly many folks watching :) If not right, feel free to move to other main thread.
This is probably a very basic question:
Load a 10min video at 29.9 fps, and an audio clip that is 5 minutes, in the Frame Rate dialog it will offer to ~double the frame rate to "match duration" of video/audio..
Now, go ahead and CROP/TRIM the video anywhere, start/mid/end and remove 3-5 minutes, a large chunk.
The expectation is that it would "know" that video stream has FEWER frames, and ADJUST the "match duration" fps, but it does not, it keeps the original fps value, which cuts video way before the audio :)
A somewhat RELATED issue if you trim/crop the video from the *START*, then the audio becomes out of sync, my naive question, why can't the newly trimmed video simply be "numbered" with frame0.. last frame, why does it still "remember" the original non-cropped video and uses that as the audio-sync.
I know that SAVING The trimmed video and RELOADING it will do this, but that may be an hour video, so require a lot of time.
is there a possibility to make some changes in the management of "frame starting point" or "total frame count" and adjust it each time to the loaded audio? if that is a backward compatible issue, maybe offer a "new" way to trim/crop.. and of course, if user does an UNDO of a trim, then the frames would re-number again, and so on.
Thanks.
Stormy.
shekh
2nd November 2018, 20:20
About cropping: "audio from other file" does not belong to timeline. So if you delete some frames, it has no effect on audio.
Many operations are "applied" in certain order, this should answer all questions.
For example:
1. sources are compared, and video frame rate is adjusted
2. timeline edits are applied
3. audio is attached
This is also full of anomalies, like why would it adjust frame rate at step 1, when there is no audio at all.
This pipeline is poor IMO, and can be improved. But it is not a simple task.
Meanwhile, I saw related issue: changing frame rate does not affect audio display. This I hope can be fixed :)
stormy1777
6th November 2018, 16:27
Thanks for the reply!! Yes, ordering, sure, that makes a lot of sense, but still I fail to understand how this is supposed/designed to work...
Here is another very simple example:
1. close all copies of VirtualDub2.
2. Open a 5min video clip, with NO AUDIO in virtualdub2
3. trim the last 3 minutes (ctrl-X)
4) open APPEND the *same* 5 min clip (or anything else), again, with no audio.
5) there is a "white" line showing there connection/cut/append location.
6) now attach a long enough AUDIO from file, that is longer than that spot
7) Play the video shows both segments, but audio is trimmed as if it belonged to the original video that was clipped on step 3..
Does that make sense??
The "workaround" is to SAVE the video into a temp file, and RELOAD it into virtualdub2, then append the audio.. that is the only way I've found to not clip audio that is added from file.
Stormy.
shekh
6th November 2018, 17:20
7) Play the video shows both segments, but audio is trimmed as if it belonged to the original video that was clipped on step 3..
Thanks, I think this is a bug.
I noticed quite many issues in audio-vs-timeline area recently, trying to bring it to healthy state.
stormy1777
8th November 2018, 16:05
Thanks, I think this is a bug.
I noticed quite many issues in audio-vs-timeline area recently, trying to bring it to healthy state.
Amazing, thanks for the attention; if needed; I'll be glad to test anything u put out :) good luck!!
shekh
24th November 2018, 17:01
I was wrong, audio from other file should behave the same way as interleaved audio. You can control whether edits are applied with option "apply video edits" in Video->Select range.
Here is another very simple example:
1. close all copies of VirtualDub2.
2. Open a 5min video clip, with NO AUDIO in virtualdub2
3. trim the last 3 minutes (ctrl-X)
4) open APPEND the *same* 5 min clip (or anything else), again, with no audio.
5) there is a "white" line showing there connection/cut/append location.
6) now attach a long enough AUDIO from file, that is longer than that spot
7) Play the video shows both segments, but audio is trimmed as if it belonged to the original video that was clipped on step 3..
Don't remember when I fixed it, but with current version I can't see the problem.
stormy1777
28th November 2018, 10:27
WONDERFUL!! yes, unchecked the apply video edits to audio and things are LOT better!
However, still, the option in ctrl-R (framerate) to "change so v and a duration match" i do not think works when u TRIM large section from video, with/out the apply video edits enabled.
Look at that number, then trim 20min, and it should change the fps, but i don't think it does on mine or maybe I'm misunderstanding what it does.... v/a are from different sources with diff length (can be shorter/longer).
shekh
28th November 2018, 11:06
As I tried to explain "match duration" compares sources only. Edits are ignored. Seems you have to do some math on calculator :)
Maybe this option was created to workaround issues with wrongly detected framerate (no proof for this). In that case audio is used as reference to fix it, that's all. Doubt it was meant as tool for slideshows or something.
stormy1777
28th November 2018, 13:04
cool, got it..
That math is not that fun, b/c cuts may come in several stages so video length changes, or sound/song/music changes during the "production" phase.. maybe add a "sub option" there to "include edits" similar to how it is done in "select range"?... just a thought :) :) then we let the computers do the math, something they're good at :)
Stormy.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.