Log in

View Full Version : Problem with audio compression on alignedspliced Video


Bixolzon
12th April 2007, 14:17
At first: great job. Been reading stuff on the page and forums for years now...great resource!

I laterly discovered the problem with the unaligned/aligned joining of videos. I have around 6 videos i want to join. what i did is:
-use avisynth (avisource("1.avi")++(avisource("2.avi"9)..etc
-add some resizing, sharpening etc in avisynth
-load it in virtualdub 1.6.17
-compress the video with my codec of choice (xvid)
-put audio on direct stream copy (otherwise the align won't work)
-then save the video.

the result is perfectly fine gathered video with synchronous audio. problem is: virtualdub decompressed the audio and hence 85% of the file size is pure pcm audio. when trying to compress audio it gets asynchronous.

help please :)

ps. i tried search but didn't find a thread discussing this problem

JoeShrubbery
12th April 2007, 14:53
AFAIK there's no way to process audio through avisynth without it being decoded.

If I'm reading you right, you join the clips and save out to a new file with compressed video and uncompressed synchronous audio, but when you go back to compress the audio it goes out of sync. The question now is how exactly are you recompressing the audio. I assume you're doing so in virtualdub, but what codec and what specific settings are you using? If not in virtualdub then what are you using to a) compress the audio and then b) mux it back in with the video.

Personally I just compress the audio within Virtualdub and use the Lame ACM codec but steer clear of the ABR modes, they always cause sync problems for me whereas the CBR modes give me perfect sync. Years ago a buggy Vorbis ACM codec was floating around that caused syncing headaches most of the time. Can't recall any other codecs I've had trouble like that with, the common denominator being the ABR/VBR nature of those problem codecs which makes perfect sense, non-CBR audio in AVI files is a non-standard hack that doesn't always work.

Bixolzon
12th April 2007, 15:25
yes that's exactly the problem.

i used mpeg layer 3, 128kbit/s 44,1k hz, stereo, so pretty much standard....i don't know who authored the encoder.

trying with lame, 44,1hz (no conversion), stereo, 128kbit/s cbr solved the problem appearently! Thanks a lot!

setarip_old
12th April 2007, 19:55
Hi!

Rather than trying to determine the cause of your problem, I'll just suggest how you may fix it:

Load the file into VirtualDub, VirtualDubMod, or NanDub.
Set BOTH "Video"(VirtualDub,
VirtualDubMod and NanDub) and "Audio"
(VirtualDub and NanDub - VirtualDubMOD>"Streams>"Stream
list") to "Direct Stream Copy".

A) If the difference between audio and video is constant
throughout the video:

From the "Audio" dropdown menu, select "Interleaving" (For
VirtualDubMOD, rightclick on the listed audiostream and then
select "Interleaving")

Under "Audio skew correction", set an appropriate number of
milliseconds (positive or negative) in the box labelled "Delay
audio track by"

Save with a new filename

B) If the difference increases as the movie plays:

From under the "Video" dropdown menu, select "Framerate" -
and select "Change so video and audio durations match"

Save with a new filename

Let us know of your success ;>}

Bixolzon
13th April 2007, 11:23
@setarip:
joe's solution works just fine.

your solutions concern a differnent kind of asynchronous audio, i tried them before i knew of the alignedspliced thingy and they didn't work. readjusting the audio will cause the whole audio stream to shift. that just means i can select another "piece" of the joined vids to be synchronous which does no good. adjusting the frame rate will make it even worse, it will cause the whole video, even the first piece, to be asynchronous.

here (http://speeddemosarchive.com/kb/index.php/AviSynth) is a guide (see 3.4 part 4) with a nice illustration of the problem.

thanks for the reply nevertheless :)

setarip_old
13th April 2007, 18:01
@setarip: joe's solution works just fine.Glad to hear your problem's been resolved ;>}