Log in

View Full Version : Script to compare video


Insane2986
29th December 2005, 08:26
Hi, I'm trying to use StackVertical to compare 2 different DVD encodings.

Here's what I have:
clip1 = DirectShowSource("I:\OUTPUT\HC Encoder\VIDEO_TS\VTS_01_1.VOB")
clip2 = DirectShowSource("I:\OUTPUT\QMatOp 6 Pass\VIDEO_TS\VTS_01_1.VOB")
StackVertical(clip1, clip2)

I loaded the .avs in virtualdubmod. However, the frames between the movies seem to be out of sync. Is there any way to correct this?

stickboy
29th December 2005, 09:24
Trim one of the clips until they match.

Pookie
29th December 2005, 10:08
From the AviSynth Site:

# If Videos start at different frames
frameadjust=0

# Videos to compare: (v1 is original, v2 is encoded or whatever)

v1 = AviSource("g:\v1.avi").trim(frameadjust,0)
v2 = AviSource("g:\v2.avi")

Insane2986
30th December 2005, 00:24
Thanks for the help, but I'm still having problems :(

The videos start at the same frame, and I have no problem with the frames staying sync'ed when I hit play in virtualdub (or go frame by frame). The minute I try to fast forward, or skip to another part of the movie, the frames become out of sync.

foxyshadis
30th December 2005, 00:52
Since you're working with vobs, perhaps you should try mpeg2source. Many DSS splitters are notoriously bad at seeking to exact frames so random access isn't guaranteed perfect.

Insane2986
31st December 2005, 08:24
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MPEG2Dec3.dll")

clip1 = MPEG2Source("I:\OUTPUT\HC Encoder\VIDEO_TS\VTS_01_1.VOB")
clip2 = MPEG2Source("I:\OUTPUT\QMatOp 6 Pass\VIDEO_TS\VTS_01_1.VOB")
StackVertical(clip1, clip2)

Virtualdub says "Avisynth open failure: MPEG2source: couldn't open file" :(

communist
31st December 2005, 08:33
MPEG2Source works by loading d2v files which you can create by using DGIndex, which also comes with a newer version of a MPEG2 decoder.

There are also other ways to compare videos. See here (http://forum.doom9.org/showthread.php?p=727216#post727216).

Insane2986
31st December 2005, 11:18
I demuxed the video and tried to open this script

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MPEG2Dec3.dll")

clip1 = MPEG2Source("I:\OUTPUT\HC Encoder\VIDEO_TS\VTS_01_1.d2v")
clip2 = MPEG2Source("I:\OUTPUT\QMatOp 6 Pass\VIDEO_TS\VTS_01_1.d2v")
StackVertical(clip1, clip2)

and I get "Avisynth open failure: couldn't open file (C:\Documents and Settings\admin1\Desktop\script.avs, line 3)"

Any ideas? :(

stickboy
31st December 2005, 11:28
Did you use DGIndex to create those d2v files?

Insane2986
31st December 2005, 11:46
Yes, I opened VTS_01_1.VOB and did "save project and demux video"

stickboy
31st December 2005, 11:54
It looks like you're using the old mpeg2dec3.dll.

You should be using dgdecode.dll that came with DGIndex.

If that doesn't help:
Double check the path to the d2v files.
Make sure you didn't move the VOB files after you generated the d2v files.

Insane2986
31st December 2005, 12:55
dgdecode.dll worked. Thanks :)

Also the frames appear to be sync'ed up with one another, so all is good.