View Full Version : Quick question about TextSub


madoka
11th December 2002, 07:51
It has been mentioned (when I searched the forum) that TextSub supports YUY2. However, it's only provided as a VirtualDub plug-in, which AviSynth can only use it in RGB. So does it or does it not work in YUY2 with AviSynth?


If the answer is no, then is there a substitute for it?

Schultz
11th December 2002, 08:41
Yes you can just use

LoadPlugin("Path\To\Textsub.vdf")
TextSub("Path\To\Subtitle.ext")

its all built into one file. ;o)

madoka
12th December 2002, 00:44
Originally posted by Schultz
Yes you can just use

LoadPlugin("Path\To\Textsub.vdf")
TextSub("Path\To\Subtitle.ext")

its all built into one file. ;o)
Hmm, but aren't AviSynth plug-ins DLLs? I assume that AviSynth is "smart" and automatically uses the correct handlers to load plug-ins.

This, and the fact that AviSynth implicitly converts YUY2 to RGB if required makes me nervous.

However, suppose I'm wrong (which is frequent), then why don't Gabest package Vobsub similarly. For that matter why don't all authors who wrote the same filter for both AviSynth and VirtualDub (Graft's decomb and msharpen, for example)?

Schultz
12th December 2002, 00:57
Originally posted by madoka
Hmm, but aren't AviSynth plug-ins DLLs? I assume that AviSynth is "smart" and automatically uses the correct handlers to load plug-ins.

This, and the fact that AviSynth implicitly converts YUY2 to RGB if required makes me nervous.

However, suppose I'm wrong (which is frequent), then why don't Gabest package Vobsub similarly. For that matter why don't all authors who wrote the same filter for both AviSynth and VirtualDub (Graft's decomb and msharpen, for example)?

Yes AviSynth uses dll's and the textsub filter is a DLL just renamed to vdf so that VirtualDub will autoload it when it starts.. And each program look for a Initialization call in the dll for its own thing.. thus why VirtualDub and AviSynth can load that one file because they have there own.. and TextSub will stay in YUY2 i use it all the time.

And what do you mean why don't gabest package vobsub similarily? Right now he has a plugin file vobsub_vd.vdf file in the VirtualDub dir which calls vobsub.dll in the System file to work.. Along with SubResync which also calls for the common stuff. and then if you wish to use the AviSynth version of vobsub it is also in vobsub.dll so you just load that dll file.

And i don't know why other people don't put both calls into the same dll file..

ErMaC
15th December 2002, 13:09
Because most people don't write plugins for both Vdub and AVISynth ^_^

As for AVISynth converting colorspaces:
AVISynth NEVER implicitly converts colorspaces for a video stream unless the filter ITSELF is written to do so.
If you try to run a filter on a stream which is the wrong colorspace, AVISynth will throw an error - it will not convert to the proper colorspace. The only area which it does something similar is in audio conversions - when information is passed between audio plugins in a chain it will implicitly convert between integer/floating point/16-bit/whatever. But not video.

The only time I can think of where it might change colorspaces on you is if someone writes a filter that accepts both YUY2 and RGB, and in order to process for example YUY2 it converts it to RGB internally, does its thing, and then down converts to YUY2. To my knowledge no often-used filters do this.

Just doing LoadPlugin() on the textsub.vdf file loads it as an AVISynth plugin. I actually just renamed mine to TextSub.dll and dumped it in the autoload folder for convenience.
Remember that a VDF is just a renamed DLL file, and LoadPlugin() will load things as AVISynth plugins - the only time it will load as a vdub plugin is if there is no AVISynth entry point in the DLL or if you explicitly load it as LoadVirtualDubPlugin(dll,filtername).