Log in

View Full Version : Use of subtitle through Invoke


vcmohan
3rd June 2005, 11:23
I have a need to show the parameters being used on every frame in a range of frames where some testing is done by varying parameters each frame . The user needs to select suitable parameter visually by inspecting the frames. The result of my test is a clip from work frames. It is not at all clear to me as to how I can do this. Subtitle expects a clip as parameter, not frame. Since I have not yet returned the clip, the child clip will not be what I want the subtitles be on. How can I do this? I can not add subtitles prior to my processing, as the display characters will interfere with test.

mg262
3rd June 2005, 15:24
Do it with a script? cf the 'phase script' in

http://forum.doom9.org/showthread.php?t=94091

-- basically, wrap the filter in a script fn which adds the subtitle, then use animate on the script fn.

vcmohan
4th June 2005, 03:35
Do it with a script

-- basically, wrap the filter in a script fn which adds the subtitle, then use animate on the script fn.

Use of script assumes that I know how the parameters are arrived at in each frame by the main function. If it is done on some charecteristics of the image one can not guess then there is no way of using script.

If such a facility does not exist ( looks in the present Avisynth core it does not) then can the development team consider having a function that can put a text on a frame?

stickboy
4th June 2005, 07:16
I can not add subtitles prior to my processing, as the display characters will interfere with test.Can you add the subtitles after processing? Is the subtitle text constant, or does it need to change every frame?

If it can be constant, then you can simply invoke the Subtitle filter on your PClip before you return it.

vcmohan
5th June 2005, 05:04
Can you add the subtitles after processing? Is the subtitle text constant, or does it need to change every frame?

The text changes every frame.

If it can be constant, then you can simply invoke the Subtitle filter on your PClip before you return it.

I am not sure about this. Since PClip remains the original Clip handed over to the plugin, refering to it will place it prior in status.

For Eg: Can I part process a frame, then env->Invoke("blur"....) and then continue. I think you can not do this. Does this mean that Invoke can only be used for any preprocess only. This can be as well done through script.

stickboy
5th June 2005, 06:38
I am not sure about this. Since PClip remains the original Clip handed over to the plugin, refering to it will place it prior in status.No. Your filter returns a clip. If you want to do additional processing, before returning it, simply call Invoke on it first and return that result instead. (You can see the source code to my Shuffle plug-in as an example.)

But anyway, since your text needs to change from frame to frame, it doesn't matter, because Subtitle isn't going to help you. You'll need to render text onto each of the frames yourself. It would be nice if AviSynth's internal text rendering routines were exposed for this purpose, though.