digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   VirtualDub: Audio sync and bad frames in DivX (http://www.digitalfaq.com/archives/encode/2778-virtualdub-audio-sync.html)

J-Wo 02-25-2003 12:12 PM

Audio sync and bad frames in DivX
 
Hi, I have a DivX file with CBR mp3 audio with some visible bad frames and freezes in it when I watch it in media player. After the freezing there is some audio sync for maybe a minute but then it suddenly resolves itself. However when I make my KVCD using this avi the audio stays out of sync after hitting the error point. Loading the avi in VDub I tried Scan Video Stream For Errors but it found none. Can someone please tell me a step-by-step guide as to what I should do to fix this? Thanks!

Update: I just rried VDubMP3freeze to check video for freezes and it said there were none! Now I'm really at a loss as to what to do... :( :?: However DivFix DOES say there are erorrs, but when I rebuild the index the resulting file is not playable in WMP (I did check on remove bad frames). Help me pleeeeease! :lol:

PyRoMaNiA 03-11-2003 12:50 PM

Open DivFix and scan for bad frames. Then open VirtualDub and click Edit, Go to...take your first DivFix bad frame and subtract 1. Type this number in VirtualDub, then click Edit, Set Selection Start. Now press Edit, Go to... again and add 1 to your first DivFix bad frame, type in this number. Click Edit, Set Selection end. Then press Delete. Repeat the process with every bad frame that DivFix found, then click Video, Direct Stream Copy and Audio, Direct Stream Copy, then save your fixed AVI.

Hope this helps. :)

CheronAph 03-11-2003 12:53 PM

Thanks for the tip Pyro!

urban tec 03-11-2003 07:31 PM

This is what I use if I have a similar problem, basically it uses an avs script to cut out the bad frames and keep the audio in sync.

I do not take credit for writing this, I copied it from a post I saw here and now I cant remember who posted it, if they see this Thanks.

Here is the original script

Code:

LoadPlugin("E:\DVD Backup\2 - DVD2SVCD\MPEG2Dec\MPEG2DEC2.dll")
#
# ------ avi File Number 1 ------
video=avisource("D:\Temp\movie01.avi")
audio=WAVSource("D:\Temp\audio01.wav")
#
# ------ Remove A/V Frames in File 1 ------
part1=trim(AudioDub(video,audio),0,12620)
part2=trim(AudioDub(video,audio),15575,21844)
part3=trim(AudioDub(video,audio),30009,62366)
part4=trim(AudioDub(video,audio),63509,0)
clip1=part1+part2+part3+part4
#
# ------ avi File Number 2 ------
video2=avisource("D:\Temp\movie02.avi")
audio2=WAVSource("D:\Temp\audio02.wav")
clip2=AudioDub(video2,audio2)
#
# ------ avi File Number 3 ------
video3=avisource("D:\Temp\movie03.avi")
audio3=WAVSource("D:\Temp\audio03.wav")
clip3=AudioDub(video3,audio3)
#
# ------ avi File Number 4 ------
video4=avisource("D:\Temp\movie04.avi")
audio4=WAVSource("D:\Temp\audio04.wav")
clip4=AudioDub(video4,audio4)
#
# ------ Join All avi Files ------
unalignedsplice(clip1,clip2,clip3,clip4)
#
# ------ Resize ------
LegalClip()
Grip(704,480,overscan=1)
GripSize()
TemporalSmoother(2,2)
GripBorders()
LegalClip()

The wav file are used to keep it in sync with video when using Trim
to remove frames. I use this with Tmpgenc to encode audio and video.

And here is a copy of a more simplified version I used recently

Code:

LoadPlugin("C:\Program Files\AviSynth2\plugins\MPEG2DEC.dll")
LoadPlugin("C:\Program Files\AviSynth2\plugins\fluxsmooth.dll")
LoadPlugin("C:\Program Files\AviSynth2\plugins\blockbuster.dll")
LoadPlugin("C:\Program Files\AviSynth2\plugins\legalclip.dll")
LoadPlugin("C:\Program Files\AviSynth2\plugins\GripFit_preview.dll")
LoadPlugin("C:\Program Files\AviSynth2\plugins\Sampler.dll")

video=Mpeg2Source("D:\encode\movie.d2v")
audio=WAVsource("D:\encode\movie.wav")



part1=trim(AudioDub(video,audio),0,45113)
part2=trim(AudioDub(video,audio),45122,0)

unalignedsplice(part1,part2)

LegalClip()
GripCrop(352, 288, source_anamorphic=false)
GripSize(resizer="BilinearResize")
FluxSmooth()
BlockBuster(method="noise")
GripBorders()
LegalClip()

#Sampler(length=24)

I was getting divide by zero errors in Tmpg and this was the only way I could get around it after trying everything else.

Hope this helps. :)


All times are GMT -5. The time now is 07:08 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.