View Full Version : help needed - audio & video lenght slightly different
micadelli
18th January 2005, 08:41
Hello everybody...
i've been struggling with this movie about 2 weeks now and i'm getting to lose my patience. I've tried to figure out how to make a DVD of those 2 avi's. They are 640x352 progressive 23.976 fps.
First of all, my goal is to join those AVI's and make a DVD (ntsc or pal - whichever is better or easier). Everything went well, I followed doom9's AVI -> DVD with CCE guide, I joined AVI's with no audio in nandub and then I demux the ac3 stream in VdudMod using append video segment feature. I used cce & avisynth (to resize, add borders and add permanent subtitles) to encode the video. When I loaded the video and ac3 file into bsplayer, they where out of sync.
At the begining it was good but it got worse. At the end, audio came about 500ms too early. I finally realized in VDubMod that the ac3 stream in file1.avi was 220ms shorter than the video, and in file2.avi ac3 stream was 50ms shorter. So if I play them one by one the un-sync is hardly noticeable but when I join them, it will become noticeable at the end.
I tried that "change so video and audio durations match" feature and it changed the frame rate of the video from 23.976 to 23.977. Then I made some samples in full processing mode from the end, and they had a good sync.
Now, my problem is that I don't know how should I proceed. Is it okay to have a 23.977 fps AVI and then use cce & avisynth to make m2v file and after that run pulldown.exe? Does cce, pulldown and authoring softwares accept that fps? What should .avs file look like? My .avs file looked like this...
LoadPlugin("VSFilter.dll")
AviSource("files_joined.avi")
LanczosResize(720,352)
AddBorders(0,64,0,64)
textsub("subtitles.srt")
ResampleAudio(44100)
When I demux the ac3 stream in VDubMod, should I then use BeSliced to fix the .ac3 file? Because, I'm getting "stream error: sync found after xxxx bytes" and it points to 32 ms every time.
I'm exhausted and desperate, please help me to get this done. Thank you!
manono
18th January 2005, 11:05
Hi-
I don't know for sure if this will work, but I think that one way or another it should. First, get AC3 Delay Corrector (http://home.t-online.de/home/520072193568-0001/). I've used it a number of times to get the delay to 0 when making DVDs. Your problem is different, but it still should work.
Assuming the audio for the second part plays about 220ms early after the 2 AVIs are joined, then you want to add 220ms of silence to the second AC3. Demux it, run it through AC3 Delay Corrector with a start delay of 220 ms (and the "Try Silence" box checked, I think), and remux it into the Part 2 AVI. The sound will be out of synch, but when appended to the Part 1 AVI, it should then be OK.
I would make one complete AVI with audio, so you can check the synch, before then making a video with no audio, and an audio with no video.
There's a chance you might have to run the complete AC3 through AC3Fix (http://www.digital-digest.com/dvd/downloads/showcategory.php?cid=5) when done, but I don't know for sure. It won't hurt, though.
You don't want to change the AVI framerate from 23.976fps.
If you still don't have any luck, you might try in the Audio Forum, where the audio experts hang out. Good luck.
yaz
18th January 2005, 13:06
your problem may have many reasons but before u go any hard way (and go mad :-) try the easy one. if both avi are in synch (pls, check it carefully!) u can join them with avimuxgui. it's just some clicking and it takes some minutes. sure, the resulting avi will be in synch and the streams will be aligned properly. extract the streams from the joined avi also with avimuxgui then go on with the guide. before muxing the dvd check (and fix if necessary) the ac3 stream!
the bests
y
micadelli
19th January 2005, 19:14
okay,
it seems as AC3 Delay technique work great. The only negative point is that when I join AVIs together, there will be 250ms silence in the middle of the background music which is playing really loud at that scene. So it borhers me. But if there's no easy way out, that will do, of course.
I was just wondering if there's a way to cut part 2 avi 250 ms from the beginning. First, key frame seems to be at 305 ms, and that would be too much to cut. I think those 2 AVIs overlap about 120 ms, so that 250 ms cut would be hardly noticeable.
So, is it only possible to cut AVIs from its key frames?
Thanks again... you've been a great help
What if I encode both parts separately in CCE, and when I load the second .avs in CCE, I choose to not encode the first 4 frames? Would it work? Is it possible to join .M2V files. They are encoded with permanent subtitles but I think they would still match the audio and video.
manono
20th January 2005, 12:48
Hi-
Yes, there are several ways to do what you want. I'm wondering, though; wasn't there a break in the audio either at the end of the first part, or at the beginning of the second part, or both? It seems strange that the original AVI, before being split, would be set up with a break in the music such as you describe.
What if I encode both parts separately in CCE, and when I load the second .avs in CCE...
Here's a better way. Join the 2 AVIs together, but without adding the silence as instructed in my first post. Extract the AC3 audio. So, when you do that, there's no annoying break in the audio? Also, save the complete video, without audio. You then have a joined AVI video, with black frames that you want to get rid of so that the audio remains in synch after being encoded for DVD.
Your AVI is at 23.976fps. 1000/23.976=41.71ms. Each frame=41.71ms. 220/41.71=5.27. So, assuming that the amount of black frames you want to get rid of is about 220ms worth, then you want to delete 5 frames. If you want to get rid of 250ms worth, then you want to delete 6 frames. You figure it out. To do that you use the AviSynth Trim command on the CCE .avs. Say that you want to get rid of 5 frames between frames 100001 and 100005, then you set up your .avs script like so:
AviSource("C:\Path\To\Movie.avi") #or some such
Trim1=Trim(0,100000)
Trim2=Trim(100006,0)
Trim1+Trim2
Assuming you know your way around AviSynth and CCE, you'll crop/resize, convert to YUY2 if necessary, do the audio workaround, filter, etc. Open the .avs in VDubMod before doing the CCE encoding to make sure you got rid of what you wanted to get rid of.
micadelli
20th January 2005, 23:39
great... you should have not told me anything about that ConvertToYUY2 thing because now I'm even more lost. :D
I checked my sources in VDMod with .Info line in avs file, and it said the colorspace was YV12. Although, I didn't have a problem when doing some test encodes in CCE (without having ConvertToYUY2 line in avs).
I also started to wonder if my source is progressive in the first place. It definately seems to be but is there a way to tell it for sure. All my test encode results looked good when I did everything by the book assuming my sources was progressive. My doubts base on that parity line VDMod tells me when I load that avs /w Info flag. It says 'assuming bottom field first'.
I read on CCE Faq that it's better to insert 'ConvertToYUY2(interlaced=true)' than 'ConvertToYUY2(interlaced=false)'if you're not sure about your source.
So, do I really need that YUY2 convert to be done?
How to check for sure if AVIs are prog or int?
I think I'm having big issues with this... this is like a snowball effect, getting bigger and bigger. I can't wait until it hits its target.
Thank you for your effort, I really appriciate it... Thanks
manono
21st January 2005, 00:41
Hi-
AVIs are almost by definition progressive. In my opinion there's not much point in encoding them as interlaced. In any event, load it in VDubMod, find a place where there's movement, step through it frame by frame, and if you don't see any interlacing (aka combing or feathering), it's progressive.
As for ConvertToYUY2, you didn't say which version of CCE you were using. I use 2.5, always use DVD sources, and always put that line in there, so I'm not real sure if you need the line when using a different version of CCE, or with an AVI source. If it works fine for you without it (CCE will crash if it's needed), then do it the way you always have.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.