Log in

View Full Version : frustrating a/v sync issue


meatwad666
24th July 2010, 18:44
Good Morning,

i'll be overly descriptive in my process in case that helps clarify my problem.

I recorded HP-GOF from abc family channel using my comcast dvr. i pulled the transport stream from the dvr through the firewire using my mbp. i then copied it to my win 7 machine, quickstream fixed the m2t to a ts using videoredo, and then cut the commercials again using video redo.

i threw the commercial free ts into megui to make a x264/aac encode to fit on a single dvd.

the resulting file had a progresive sync loss, at the end of the file (2hr 28min) theres about -340ms of lost sync. halfway through the movie, the sync error is half that. i determined that visually using MPC and the +/- sync.

i thought, ok maybe becuase there were 14 cuts theres some compounding issue with delays, so i split the ts at each break and put together this script:

LoadPlugin("C:\Program Files\megui\tools\dgindex\DGDecode.dll")
Loadplugin("c:\program files\megui\tools\avisynth_plugin\colormatrix.dll")
Loadplugin("c:\program files\megui\tools\avisynth_plugin\undot.dll")

v1=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob1.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()
v2=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob2.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()
v3=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob3.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()
v4=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob4.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()
v5=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob5.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()
v6=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob6.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()
v7=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob7.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()
v8=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob8.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()
v9=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob9.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()
v10=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob10.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()
v11=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob11.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()
v12=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob12.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()
v13=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob13.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()
v14=DGDecode_mpeg2source("C:\Users\Public\Recorded TV\HP GOB\gob14.d2v", info=3).ColorMatrix(hints=true, threads=0).TDecimate(cycleR=3).undot()

a1=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob1 PID 841 3_2ch 384Kbps DELAY 32ms.ac3").normalize()
a2=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob2 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a3=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob3 PID 841 3_2ch 384Kbps DELAY 32ms.ac3").normalize()
a4=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob4 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a5=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob5 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a6=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob6 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a7=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob7 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a8=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob8 PID 841 3_2ch 384Kbps DELAY 32ms.ac3").normalize()
a9=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob9 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a10=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob10 PID 841 3_2ch 384Kbps DELAY 32ms.ac3").normalize()
a11=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob11 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a12=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob12 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a13=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob13 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a14=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob14 PID 841 3_2ch 384Kbps DELAY 32ms.ac3").normalize()

a=audiodub(v1,a1).delayaudio(0.032)
b=audiodub(v2,a2).delayaudio(0.031)
c=audiodub(v3,a3).delayaudio(0.032)
d=audiodub(v4,a4).delayaudio(0.031)
e=audiodub(v5,a5).delayaudio(0.031)
f=audiodub(v6,a6).delayaudio(0.031)
g=audiodub(v7,a7).delayaudio(0.031)
h=audiodub(v8,a8).delayaudio(0.032)
i=audiodub(v9,a9).delayaudio(0.031)
j=audiodub(v10,a10).delayaudio(0.032)
k=audiodub(v11,a11).delayaudio(0.031)
l=audiodub(v12,a12).delayaudio(0.031)
m=audiodub(v13,a13).delayaudio(0.031)
n=audiodub(v14,a14).delayaudio(0.032)

a++b++c++d++e++f++g++h++i++j++k++l++m++n

the original script would have been very similar to this but without the allignedspling

i have tried putting the delay audio with the directshowsource command, with the audiodub command as shown, and even ommitting it entireily. still the same progressive sync issue.

can someone with more experience with avisynth shed some insight into what i'm doing wrong?

stax76
24th July 2010, 18:51
Try the cut feature in StaxRip and if there are still sync issues enable ProjectX in the settings.

meatwad666
24th July 2010, 19:10
i'll give staxrip a shot.

i should have also noted, that when i play the script directly in MPC, the audio is fine. does that mean its an audio encoder issue?

Avisynth_challenged
24th July 2010, 19:21
@meatwad666

I use VideoRedo Plus and VideoRedo TVSuite 3 to trim commercials out of my raw .ts files (1080i MPEG2), and when I load my edited VRD output into DGIndex and save to a .d2v file, I receive "invalid field transition" errors from DGIndex.

Letting DGIndex create a fix resulted in a .d2v which was no longer in sync with the .ac3 audio of the edited video. Did this happen to you as well?

*Edit*
Don't know if this pertains to your case, but here's some info in the VideoRedo forum:
http://www.videoredo.net/msgBoard/showthread.php?t=6685

meatwad666
24th July 2010, 19:46
@meatwad666

I use VideoRedo Plus and VideoRedo TVSuite 3 to trim commercials out of my raw .ts files (1080i MPEG2), and when I load my edited VRD output into DGIndex and save to a .d2v file, I receive "invalid field transition" errors from DGIndex.

Letting DGIndex create a fix resulted in a .d2v which was no longer in sync with the .ac3 audio of the edited video. Did this happen to you as well?

*Edit*
Don't know if this pertains to your case, but here's some info in the VideoRedo forum:
http://www.videoredo.net/msgBoard/showthread.php?t=6685

dgindex doesnt throw up any complaints when i've worked with 1080i. the file i'm currently working with is 720p however.

Guest
25th July 2010, 01:12
Are you cutting the TS with VideoRedo, or the ES?

If you end up with a bunch of pieces of TS, then if each one has a tiny bit more audio than video (due to the difference in granularity of a video frame versus an audio frame), then you can get progressive aysnc.

One solution is to demux with EAC3TO. Another is to use DGIndexNV, which will adjust for that for demuxed AC3.

b66pak
26th July 2010, 19:16
you can try to replace:
a1=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob1 PID 841 3_2ch 384Kbps DELAY 32ms.ac3").normalize()
a2=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob2 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a3=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob3 PID 841 3_2ch 384Kbps DELAY 32ms.ac3").normalize()
a4=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob4 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a5=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob5 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a6=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob6 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a7=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob7 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a8=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob8 PID 841 3_2ch 384Kbps DELAY 32ms.ac3").normalize()
a9=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob9 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a10=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob10 PID 841 3_2ch 384Kbps DELAY 32ms.ac3").normalize()
a11=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob11 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a12=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob12 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a13=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob13 PID 841 3_2ch 384Kbps DELAY 31ms.ac3").normalize()
a14=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob14 PID 841 3_2ch 384Kbps DELAY 32ms.ac3").normalize()
a=audiodub(v1,a1).delayaudio(0.032)
b=audiodub(v2,a2).delayaudio(0.031)
c=audiodub(v3,a3).delayaudio(0.032)
d=audiodub(v4,a4).delayaudio(0.031)
e=audiodub(v5,a5).delayaudio(0.031)
f=audiodub(v6,a6).delayaudio(0.031)
g=audiodub(v7,a7).delayaudio(0.031)
h=audiodub(v8,a8).delayaudio(0.032)
i=audiodub(v9,a9).delayaudio(0.031)
j=audiodub(v10,a10).delayaudio(0.032)
k=audiodub(v11,a11).delayaudio(0.031)
l=audiodub(v12,a12).delayaudio(0.031)
m=audiodub(v13,a13).delayaudio(0.031)
n=audiodub(v14,a14).delayaudio(0.032)
a++b++c++d++e++f++g++h++i++j++k++l++m++n

with:
a1=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob1 PID 841 3_2ch 384Kbps DELAY 32ms.ac3")
a2=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob2 PID 841 3_2ch 384Kbps DELAY 31ms.ac3")
a3=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob3 PID 841 3_2ch 384Kbps DELAY 32ms.ac3")
a4=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob4 PID 841 3_2ch 384Kbps DELAY 31ms.ac3")
a5=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob5 PID 841 3_2ch 384Kbps DELAY 31ms.ac3")
a6=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob6 PID 841 3_2ch 384Kbps DELAY 31ms.ac3")
a7=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob7 PID 841 3_2ch 384Kbps DELAY 31ms.ac3")
a8=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob8 PID 841 3_2ch 384Kbps DELAY 32ms.ac3")
a9=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob9 PID 841 3_2ch 384Kbps DELAY 31ms.ac3")
a10=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob10 PID 841 3_2ch 384Kbps DELAY 32ms.ac3")
a11=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob11 PID 841 3_2ch 384Kbps DELAY 31ms.ac3")
a12=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob12 PID 841 3_2ch 384Kbps DELAY 31ms.ac3")
a13=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob13 PID 841 3_2ch 384Kbps DELAY 31ms.ac3")
a14=directshowsource("C:\Users\Public\Recorded TV\HP GOB\gob14 PID 841 3_2ch 384Kbps DELAY 32ms.ac3")
a=audiodub(v1,a1).delayaudio(0.032).trim(0,0)
b=audiodub(v2,a2).delayaudio(0.031).trim(0,0)
c=audiodub(v3,a3).delayaudio(0.032).trim(0,0)
d=audiodub(v4,a4).delayaudio(0.031).trim(0,0)
e=audiodub(v5,a5).delayaudio(0.031).trim(0,0)
f=audiodub(v6,a6).delayaudio(0.031).trim(0,0)
g=audiodub(v7,a7).delayaudio(0.031).trim(0,0)
h=audiodub(v8,a8).delayaudio(0.032).trim(0,0)
i=audiodub(v9,a9).delayaudio(0.031).trim(0,0)
j=audiodub(v10,a10).delayaudio(0.032).trim(0,0)
k=audiodub(v11,a11).delayaudio(0.031).trim(0,0)
l=audiodub(v12,a12).delayaudio(0.031).trim(0,0)
m=audiodub(v13,a13).delayaudio(0.031).trim(0,0)
n=audiodub(v14,a14).delayaudio(0.032).trim(0,0)
a++b++c++d++e++f++g++h++i++j++k++l++m++n
normalize()

trim(0,0) will make audio and video length equal...normalizing segments is a very bad idea...
_