PDA

View Full Version : Need help getting 'StackHorizontal' to work through DVDRB filter editor


archaeo
13th March 2008, 17:06
Any ideas on how to successfully load the avisynth ‘stackhorizontal’ script into the DVDRB filter editor?
The goal is to be able to compare two clips (original, filtered) next to each other as an output to DVD that I can view on my flatscreen TV. This gives me a great way to compare filter results against the original material. So far no success on getting the script to work. One of the issues is that there are two sources that need to be loaded, and I’m not sure how to tweak the RB filter editor to be able to load them both.
Any ideas on getting this to work, or suggestions of other options with the same DVD output appreciated...

Here is what I have so far:

#StackHorizontal(clip1, clip2)

V1=MPEG2Source("Z:\testclip_orig\V01.VOB").Crop(0, 0, 360, 480)
V2=MPEG2Source("Z:\testclip_filtr\V01.VOB").Crop(360, 0, 360, 480)
StackHorizontal(v1.Subtitle("original"),v2.Subtitle("encoded"))

*does directshowsource() need to be used for VOB files?

Sharc
13th March 2008, 21:57
I think Mpeg2Source requires a .d2v project file.

Added:
... or you need DirectShowSource for a .vob. AFAIK it may give problems with random file access, so it's better to produce .d2v first and use Mpeg2Source.

archaeo
13th March 2008, 22:34
I think Mpeg2Source requires a .d2v project file.

Added:
... or you need DirectShowSource for a .vob. AFAIK it may give problems with random file access, so it's better to produce .d2v first and use Mpeg2Source.

Thanks. After looking through some previous threads after posting, I saw that DirectShowSource() is needed for loading VOB's. I will also try loading d2V directly with mpegsource().

Since there are two clips as sources, I am guessing I will have to use RBopt to add the additional line that contains the 2nd MPEGSource, then run through DVDRB?

There undoubtedly is an easier way to do this with an Avisynth script fed to an encoder directly, but I wanted to give this a shot using the DVDRB filter editor...

archaeo
14th March 2008, 00:46
1 - #------------------
2 - # AVS File Created by DVD Rebuilder
3 - # VOBID:01, CELLID:01
4 - #------------------
5 - LoadPlugin("C:\DVD_TOOLS\REBUILD\RB_v1.27.2\DGDecode.dll")
6 - mpeg2source("Z:\testorig\testorig.d2v",idct=3, cpu=3)
7 - mpeg2source("Z:\testseesaw\testseesaw.d2v",idct=3, cpu=3)
8 - StackHorizontal(DirectShowSource("Z:\testorig\testorig.d2v",audio=false),DirectShowSource("Z:\testseesaw\testseesaw.d2v",audio=false))
9 - trim(0,1873)
10 - ConvertToYUY2()
11 - AudioDub(BlankClip())


Above is script as generated by DVDRB when trying to load the two d2V's... I'm getting an error:
"AVIFile error 0x80004005"

jdobbs
14th March 2008, 00:52
Where do you want the two sources to differ and what is the purpose? Are you trying to make one that uses a filter (for example) and another one that doesn't so you can make a comparison? If I knew how you were planning to use it I could probably put together a quick example. You aren't going to be able to point to other sources and then run it through DVD-RB. It expects the framecount, etc. to remain consistent.

archaeo
14th March 2008, 03:27
Where do you want the two sources to differ and what is the purpose? Are you trying to make one that uses a filter (for example) and another one that doesn't so you can make a comparison? If I knew how you were planning to use it I could probably put together a quick example. You aren't going to be able to point to other sources and then run it through DVD-RB. It expects the framecount, etc. to remain consistent.

HI jdobbs - To answer your question, yes, I'd like the two sources to be of the same clip, one being the original, one being filtered with say, seesaw. The purpose is to have the ability to see them side by side in order to compare the results of the filtered to that of the original, but I want to view the results on my regular viewing medium - a large flat screen TV. If the examples aren't exactly synched, that's OK. I'd just like to be able to compare side by side instead of having to view one, then view another. It would be a really efficient way to quickly see the results of filter editing juxtaposed next to the original source.

This old thread http://72.14.205.104//search?q=cache:_ER-gSR7yjAJ:forum.doom9.org/showthread.php%3Ft%3D39888+site:forum.doom9.org+directshowsource+and+stackhorizontal&hl=en&ct=clnk&cd=4&gl=us has the same idea, but I'm only thinking of two clips, not four.

jdobbs
14th March 2008, 03:49
Ok. Here's an example of what you can put in the filter area. This one compares the results of tweak() to the same clip without tweak:

a=crop(last,0,0,360,480)
b=crop(last,0,0,360,480).tweak(0,1.5,0,1)
StackHorizontal(a,b)

or this would do the same thing:

a=crop(last,0,0,360,480)
b=crop(last,0,0,360,480)
b=tweak(b,0,1.5,0,1)
StackHorizontal(a,b)

archaeo
14th March 2008, 04:03
Ok. Here's an example of what you can put in the filter area. This one compares the results of tweak() to the same clip without tweak:

a=crop(last,0,0,360,480)
b=crop(last,0,0,360,480).tweak(0,1.5,0,1)
StackHorizontal(a,b)


Hmmm, not sure why but I just just tried both samples and received the "AVIFile error 0x80004005" in CCE, and with HCEnc it just said "encoder doesn't appear functional"

Script in RB for first sample was:
1 - #------------------
2 - # AVS File Created by DVD Rebuilder
3 - # VOBID:01, CELLID:01
4 - #------------------
5 - LoadPlugin("C:\DVD_TOOLS\REBUILD\RB_v1.27.2\DGDecode.dll")
6 - mpeg2source("Z:\TESTSTACK\D2VAVS\V01.D2V",idct=3, cpu=3)
7 - a=crop(last,0,0,360,480)
8 - b=crop(last,0,0,360,480).tweak(0,1.5,0,1)
9 - StackHorizontal(a,b)
10 - trim(0,1881)
11 - ConvertToYUY2()
12 - AudioDub(BlankClip())



*edit: I do get the idea though - one cannot load two sources into RB, but can selectively run a filter pass on the same clip and define it as a seperate source 'b'.

Sharc
14th March 2008, 08:26
I just tried jdobb's example and it works flawlessly here.

archaeo
14th March 2008, 09:47
I just tried jdobb's example and it works flawlessly here.


:confused:
Well, shoot.Obviously I have some other problem going on here. At first I thought perhaps it had something to do with me running the multithreaded MT 2.57 version avisynth... but I went ahead and reinstalled Avisynth 2.56 and the same error came up. I'm rather puzzled.

@Sharc:
Can you post your DVDRB generated AVS file (like in post #8) for me to check mine against? I just want to be sure I'm not missing something obvious here before I dig into this further.

I did a search regarding "AVIFileInfo error 0x80004005".
A previous post http://forum.doom9.org/showthread.php?t=96649mentions something about having too many dll's in the plugin folder (particularly MaskTools).

Sharc
14th March 2008, 18:20
@archaeo
As a filter I used deen() in this example.

Here is what I have in RB's AVS filter editor:
a=crop(last,0,0,360,576)
b=crop(last,0,0,360,576).deen()
StackHorizontal(a,b)

and here the script which RB produced:
#------------------
# AVS File Created by DVD Rebuilder
# VOBID:01, CELLID:01
#------------------
LoadPlugin("C:\Programme\Video\DVD Rebuilder\DGDecode.dll")
mpeg2source("C:\Dokumente und Einstellungen\User1\Eigene Dateien\DVD Rebuilder working\D2VAVS\V01.D2V", cpu=0)
a=crop(last,0,0,360,576)
b=crop(last,0,0,360,576).deen()
StackHorizontal(a,b)
trim(0,3714)
ConvertToYUY2()
AudioDub(BlankClip())

I am on avisynth v 2.5.7 since a while, no problems.

archaeo
14th March 2008, 19:15
Success.


I found that the CCE "AVIFileInfo error 0x80004005" is definitely related to the avisynth plugin folder. Removing the plugin folder was the only thing that allowed me to run without error (and I tried EVERYTHING).
As noted in the threads I linked to about this, there seems to be a problem with avisynth when too many .dll's are loaded in the plugin folder. What a headache. Now I've got to find out which dll's I can load back into the plug in folder, and which I cannot.


edit: thanks to jdobbs & sharc

steptoe
15th March 2008, 09:43
Related to the above thread and trying to work out what filter is causing the problems, try this :



Something I tried very recently and works as I have had exactly the same problems in the past was to have the basic stuff AviSynth installs as normal, but any filter chains I add after the initial AviSynth installation, especially the more complex filter functions I use, is to create their own folder within the plugins directory

I then create a filter chain list that I add to the DVD-Pro editor each time I want to do something specific. A bit like a filter index for each specific purpose


Two very good, but also incredibly slow and I mean sloooow, functions I use are MC_Spuds and RemoveNoiseMC. These are motion filters that use plenty of very slow filters and functions as they analsye the source then apply the filters to specific things on the source, so this is what takes time. But the results are very good. Time shouldn't be important though if you want to squeeze the best out of AviSynth and DVD-RB

These functions have their own folders, and all filters and functions that are needed are in each folder. Yes, it does mean filters are duplicated, but it also means you know exactly what filter is where and avoids having a huge plugins directory which you don't have a clue what filter is causing the problem or refusing to work due to something missing. And the extra space taken is hardly anything compared to the headaches and frustration when filters just won't do what you think it should be


You could do this for each filter as well, that way you know exactly where each filter is, if you don't use functions


I also load all filters manually into AviSynth as some don't seem to want to autoload into AviSynth when running with DVD-RB, functions that should autoload simply won't, but manually loading the filters and functions will work everytime in DVD-RB Pro, once you get everything needed. Filter functions and filter chains can be a real problem to get the sometimes very specific version of filters needed

If you had everything stored in the AviSynth plugins directory, you end up overwriting a specific filter version that may not work as it should, with my recent method of creating a directory for filters or functions I use, you avoid the problem of overwriting needed filter versions


EG

This is the filter chain I load into DVD-RB Pro's editor as a basic starting point before I tweak the functions settings when doing DVDs that have very old movies and cartoons that have horrendous scratches and white marks, mainly old B&W films, but it can be used to remove just grain as well from anything

This is for black and white sources, for colour just remove the 'Greyscale()' filter. The SetMTMode is for multi-core processors as I use HC Encoder now instead of CCE


SetMTMode(2,2)
SetMemoryMax(512)

LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\deblock.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\FFT3DFilter.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\mt_masktools.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\mvtools.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\removedirt.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\removegrain.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\repair.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\TTempSmooth.dll")

Import("D:\Video\AviSynth\Plugins\-filters\mc_spuds\LimitedSharpenFaster.avs")
Import("D:\Video\AviSynth\Plugins\-filters\mc_spuds\MC_Spuds.avs")

Greyscale()
MC_Spuds()




This should help and show those that use AviSynth with DVD-RB Pro how to avoid problems that I have had in the past and couldn't work out why a specific filter was just refusing to work

I also have backups of filter chains and their now associated directories once I get them working, so I don't have to go through the grief of tracking down filters and checking it all over again, some filters are difficult to find

archaeo
15th March 2008, 16:07
@steptoe

Yes, I know that you had posted on this very same problem previously. For a while I was thinking the error was from something else - until I pulled the plugin folder out completely and it ran flawlessly. Since then, I have been adding back various .dll's, and testing them- not real exact, and I get the feeling that the problem will probably occur again as I add additional filters. So I do like your idea of creating additional folders within the plugin folder and loading them manually into RB. I typically load them manually into RB anyway and I keep an index of notepad text files for each complex filter script. I then cut and paste these text files into the filter editor, and tweak as necessary. So, I think that your idea is a good one in that it would prevent that annoying 'AVIFileInfo' error, and better organize my increasingly crowded filter and script folders.



SetMTMode(2,2)
SetMemoryMax(512)

LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\deblock.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\FFT3DFilter.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\mt_masktools.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\mvtools.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\removedirt.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\removegrain.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\repair.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\-filters\mc_spuds\TTempSmooth.dll")

Import("D:\Video\AviSynth\Plugins\-filters\mc_spuds\LimitedSharpenFaster.avs")
Import("D:\Video\AviSynth\Plugins\-filters\mc_spuds\MC_Spuds.avs")

Greyscale()
MC_Spuds()



I also do a fair amount of work on my old movie collection dvd's, as well as some editing of converted Super 8mm home movies. Some of these have ridiculous amounts of grain and dirt. Lately I've been using the TemporalDegrain() script followed by either LimitedSharpenFaster or Seesaw with some excellent results, but I've also been eyeing that MC_spuds script you posted.
I'll give this a go on the next project.

thanks for the tip :thanks: