PDA

View Full Version : tfm / tdecimate hangs on second pass


showergel
1st April 2007, 23:48
I was curious if anyone could help me on this. I'm using GK and have a problem getting the 2nd pass using tfm to do a hybrid deinterlace for ST: Voyager. The first pass runs correctly, but on the nth (second) pass, it will not process past the first frame.

Here is my 1st pass .avs:
# Created with Gordian Knot
#
# http://gknot.doom9.org

# PLUGINS
LoadPlugin("C:\Program Files\GordianKnot\Newest Plugins\DGIndex v1.4.9b9\DGDecode.dll")
LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\TIVTC\TIVTC.dll")

# SOURCE
mpeg2source("C:\Documents and Settings\User\Desktop\dvd\1\e189.d2v", idct=0)
tfm(d2v="C:\Documents and Settings\User\Desktop\dvd\1\e189.d2v",output="matches.txt")
tdecimate(mode=4,output="metrics.txt")

# CROPPING
crop(10,0,702,480)

# RESIZING
LanczosResize(640,480)

..and my second pass .avs:

# Created with Gordian Knot
#
# http://gknot.doom9.org

# PLUGINS
LoadPlugin("C:\Program Files\GordianKnot\Newest Plugins\DGIndex v1.4.9b9\DGDecode.dll")
LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\TIVTC\TIVTC.dll")

# SOURCE
mpeg2source("C:\Documents and Settings\User\Desktop\dvd\1\e189.d2v", idct=0)
tfm(d2v="C:\Documents and Settings\User\Desktop\dvd\1\e189.d2v",input="matches.txt")
tdecimate(mode=5,hybrid=2,vfrDec=1,input="metrics.txt",tfmIn="matches.txt",mkvOut="mkv-timecodesfile.txt")

# CROPPING
crop(10,0,702,480)

# RESIZING
LanczosResize(640,480)

I've also altered the GK default DivX Firstpass Settings file to allow the DivX codec (v6.5.0.53) to write the logfile to the current working directory. I'm able to open the logfile and it is located where I expect it. On the nth (second) pass job setup, I specify the logfile for the nth pass - and have tried specifying the .ac3 audio file and disabling muxing but it has no effect.

What's important to know is VirtualDubMod doesn't lock up.. the time indicator keeps on moving, but the framecount on the status window stays at 1. I've also enabled the DivX Feedback window to see what's going on behind the scene and the codec is actively processing frames.. black frames.. they're all I-Frames (if that means anything) at a rate of 14 frames/sec.

Further- I've also tried this without GK and used the same .avs scripts in VirtualDubMod v1.5.10.2 b2542, VirtualDub v.1.6.15 & v1.6.17 with the exact same result. FWIW, I'm using TVITC v1.0.1 from 19-Feb-2007.

Any ideas?

tritical
2nd April 2007, 10:49
To make sure, you are running both DivX passes on the second pass script correct?

If so, does the problem still occur if you use only:

mpeg2source("C:\Documents and Settings\User\Desktop\dvd\1\e189.d2v", idct=0)
crop(10,0,702,480)
LanczosResize(640,480)

(i.e. no tfm/tdecimate) as your script?

showergel
3rd April 2007, 02:29
On the 1st divx pass, I'm running in Multipass, 1st pass (fast) mode with the .avs for the 1st pass.

On the 2nd divx pass, I'm running in Multipass, Nth pass mode with the .avs for the 2nd pass.

I'm still able to run those without tfm/tdecimate as I've been doing for about a year now with GK/DivX/Telecide or TomsMoComp (I'm not that impressed with telecide's results but it works).

From what I've read it's my understanding that I need to make a matches.txt & metrics.txt file using tfm & tdecimate (in mode4). Then those two logfiles are used on the next pass to create the final output (mode5). The examples in the documentation seem to support that method...

tritical
3rd April 2007, 05:14
The passes for divx (first, second, third, etc...) all have to be on the second script (the one with hybrid=2, where tdecimate generates the mkvOut file). The output of the first script wont match the output of the second script (since tdecimate can't know how many frames it will generate w/o having the metric and match information for each frame). Usually, I just just use "file->run video analysis pass" in vdub on the initial script that generates the output files for tfm/tdecimate. And since the video output doesn't matter for that script (its only purpose it to allow tfm/tdecimate to gather info), you might as well crop it down to 16x16 or something small to speed things up. So the first script would be:

mpeg2source("C:\Documents and Settings\User\Desktop\dvd\1\e189.d2v", idct=0)
tfm(d2v="C:\Documents and Settings\User\Desktop\dvd\1\e189.d2v",output="matches.txt")
tdecimate(mode=4,output="metrics.txt")
crop(352,232,-352,-232) // crops 720x480 to 16x16

open that in vdub and do "file->run video analysis pass." Once that finishes, close the first script and then open the second script in vdub and set up the passes for divx.

Using the 'batch' options in tfm/tdecimate it is possible to set all of that up in vdub's job control so that you don't actually have to be there to close the first script and open the second script.

showergel
4th April 2007, 02:47
I understand what you're saying now. Basically, there are three steps to getting a complete 2-pass DivX encode.

1: Scanning the source video with tfm/tdecimate to create the metrics & matches files

2: Run 1st pass multipass (fast) using DivX with tfm/tdecimate's metrics & matches files created during the 1st step

3: Run 2nd pass multipass nth pass using DivX with the same .avs script used in step 2.

What I haven't had any success with is getting step 1 to put something IN the metrics & matches files. They're created but empty. I tried your suggestion with the cropping (great idea) .. it scans at 60fps but the files are empty. Also tried without the cropping and still have empty files. SO.. at the moment I'm going out on a limb and running a 1-pass quality-based divx run to produce the matches & metrics file to use in passes 2 & 3. I can get a divx encode log...

:cool:

showergel
4th April 2007, 13:47
Steps 1 and 2 were successful. On step 3 (the nth pass), it still stops on frame one. I'm out of ideas. :(

tritical
5th April 2007, 19:08
So you got the output files from tfm/tdecimate created successfully? I forgot to mention that nothing is actually written to those files until the tfm/tdecimate objects are destroyed (will happen when you do file->close video file in vdub). On the problem with divx I'm not sure. I don't have divx installed here, but it works fine for me with xvid and other codecs. Maybe you could try it with another codec?

showergel
6th April 2007, 04:07
From what I've been able to tell is it works fine for 1-pass (or Single Pass) DivX. I get the impression that after the 1st pass for multipass on DivX I'd have to somehow handle the video differently. What that change is, i'm not sure yet. This weekend I'll put some more time into it and see what I come up with.

showergel
23rd April 2007, 01:50
After giving this lots of thought I believe I have an answer:

If I wanted to do a single-pass divx file then two passes are required for tfm to work. Pass one (using the example script provided in the TIVTC bundle) will scan the media and generate the information it needs for pass two. Pass two will use the gathered information to do what it needs to for the second pass. But here's the kicker. As far as DivX is concerned, you set up two 1-Pass jobs.

So, if I wanted to do a standard two-pass DivX Multipass 1st pass / Nth Pass (or 2-pass) I would need to set up 3 jobs. Job 1 would be in standard DivX 1-pass mode running TFM's data-gathering pass (using the lowest quality settings possible for speed). Job 2 would be DivX Multipass 1st Pass set the way I want using TFM's 2nd pass. Job 3 would tbe the DivX Multipass Nth Pass with identical settings to job 2 including running the TFM 2nd pass job again.

Job 1: DivX Pass Type: 1-Pass Quality Based TFM Pass: 1
Job 2: DivX Pass Type: MP 1st Pass (Fast) TFM Pass: 2
Job 3: DivX Pass Type: MP Nth Pass TFM Pass: 2 (repeat)

..if that makes sense. I'll run the job and make sure it works but I believe that is the answer I've been looking for.

showergel
24th April 2007, 02:10
It still hangs on the DivX Nth pass (Job 3). I'm out of ideas.

The exact same thing happens as before at the exact same time, in the exact same sequence.

What is interesting is tfm/tdecimate works just fine on Single Pass mode and Multipass 1st Pass mode. I can set up two Single Pass jobs to get most of the result I want, but without the refinement a Nth pass provides.

If I had the hard drive space, I'd simply decompress the whole thing to an .AVI with tfm/tdecimate then encode it to DivX .. it adds a step and extra time but the resulting .AVI wouldn't need an avs script or any filters at that point for DivX to do its magic. [Walks around his elbow to get to his...]

showergel
3rd June 2007, 07:25
When DivX v6.6.0.28 was released, the bug went away for me.

I was doing the right steps but DivX was not working properly with VDub/VDubMod. There is a listing in v6.6.1 for how/why DivX was updated.