Log in

View Full Version : Audio synch problem


viceversa
16th July 2009, 20:41
I'm trying to rip my DVD's and reencode them with my native language subs at home but there is an error i cant think any way to fix...

Step 1. I used Handbrake to rip all files with AAC sound, MP4 format and x264 - no error
Step 2. Checked the movie, no audio synch error, plays perfect.
Step 3. I added my subtitles and used VitualDubMod and reencoded them with using an AVS script with x264 codec.

Final movie becomes way off audio synched... Something like 4 minute delay at the end parts...

And here is the scripts i used;


DirectShowSource("01.mp4")
FDecimate(23.976)
converttoyv12()
temporalsoften(4,4,8,15,2)
FluxsmoothT(3)
gradfun2db(1.51)
fastlinedarken(strength=20,thinning=0)
AWarpSharpDering(depth=16,diffthresh=8)
LimitedSharpenFaster(strength=50)
textsub("subtitle_guy.ass")
textsub("subtitle_girl.ass")


Any ideas?

BTW, i used NTSC DVD's and ripped them with 23.976.
Got AC3 sound and ripped as AAC.

thewebchat
16th July 2009, 21:07
Are you absolutely sure you didn't convert the framerate to 25fps by accident? The default framerate in x264 is 25, so depending on how you called it, it might have sped up your video from 24->25fps, causing a 4% speedup which would result in a slightly shorter length.

viceversa
16th July 2009, 22:53
Checked with GSpot, it shows as 23.976?

Skelsgard
17th July 2009, 02:11
Why do you encode twice to x264?
Why are you Fdecimating something that should have been pulldown-removed in Step 1 (if your DVDs are NTSC)?
I would recommend you to rip the video to your HDD (so you won't need to read the DVD during the encoding process), then use DGIndex to create a D2V file that you can load into an AVS script, in which you will do all the processing needed (including pulldown-removal, cleaning, subtitle adding, etc, etc), and output to H.264.
Also, your script seams heavy, like your source is really noisy and low quality:
your using two different temporal smoothers (temporalsoften and FluxsmoothT) one next to the other, which might not be a good choice depending on how they work together with a given source
granfun2db was intended for playback, not for pre-processing, unles we're talking about a source with some heavy banding, cause in normal situations were the source has zero-to-limited banding it's the encoder that will create banding. So you can strip that line if your source is not that band-ed.
If your source is very noisy you might want to try the MVDegrain1/MVDegrain2 filters that come with the MVTools plugin package.

viceversa
17th July 2009, 11:12
hmm... I was clipping the video from left and right a bit. How can i do it with DGIndex then?

Skelsgard
17th July 2009, 18:39
With DGIndex you basically just decode and frameserve the MPEG-2 video to avisynth.
But you can also use DGIndex, the latest version, to rip the video from the DVD.
1. Load the DVD and open it with a DVD player like Cyberlink or Intervideo or whatever to unlock it.
Then, start DGindex, "File --> Open [F2]" the files straight from the DVD and select "File --> Save Project and Demux Video".

2. Load the whatever.m2v file that was created in your HDD into DGIndex.
Now there are two methods to deal with pulldown, and I've tried both with basically the same results for NTSC 3:2 pulldown DVDs:
one, you set Video -> Field Operation -> Honor Pulldown Flags, and do the removal within the avisynth script
two, you set Video -> Field Operation -> Forced Film (if you're sure the DVD is a pulldown-ed movie) and no need for removal in the script.

Then, File -> Save Project [F4] (you get a .d2v file)

3. Use your avisynth script, maybe something like this:
MPEG2Source("whatever.d2v")
Telecine(order=X) #order=1 if TFF, order=0 if BFF <-- you can remove this and Decimate() if you used "Forced Film".
Decimate()
temporalsoften(4,4,8,15,2)
FluxsmoothT(3)
gradfun2db(1.51) # <-- remove it if your source is not that banded
Crop(x,x,-x,-x) # <-- left,top,-right,-bottom - use it to remove the black bars, wherever they are.
Spline36Resize(x,x) # <-- (width,height) necessary to fix the AR, because of DVDs DAR and cropping.
fastlinedarken(strength=20,thinning=0)
AWarpSharpDering(depth=16,diffthresh=8)
LimitedSharpenFaster(strength=50)
textsub("subtitle_guy.ass")
textsub("subtitle_girl.ass")

Another option is (using the MVTools plugins, DegrainMedian and Seesaw):
MPEG2Source("whatever.d2v")
Telecine(order=1)
Decimate()
Crop(10,0,-12,0) # i.e, if you want to crop 10 pixels from the left and 12 from the right
Spline36Resize(656,368) # i.e., if your movie is 16:9 AR.*
back_1 = last.MVAnalyse(isb = true, delta = 1, overlap=4, idx = 1)
forw_1 = last.MVAnalyse(isb = false, delta = 1, overlap=4, idx = 1)
a=last.MVDegrain1(back_1,forw_1,thSAD=400,idx=1)
b=a.DegrainMedian(limitY=1,limitUV=2,mode=2)
Seesaw(a,b, NRLimit=1, NRLimit2=2, Sstr=0.9, Slimit=4, Spower=4, SootheT=0, SootheS=0)
textsub("subtitle_guy.ass")
textsub("subtitle_girl.ass")

* The resize function is not necessary if you set the DAR in the container (MKV, MP4) but for better compressibility you should use a mod16 size no matter what the DAR will be.

viceversa
19th July 2009, 21:09
i'll try these. thanks in advance.