Log in

View Full Version : Subtitle help


Mounir
10th July 2021, 12:14
I'm trying to use the subtitle filter with applyrange to use the filter onto only a few frames of the video but i get a "align" argument does not exist

this works:
Subtitle("My Video", align=2,text_color = color_white,halo_color=color_black)

This don't:
ApplyRange(300,500,"Subtitle","My Video",align=2)

Perhaps a syntax problem, i'm not sure

Thanks for your help and time

source: http://avisynth.nl/index.php/Subtitle

Edit: stupid me! subtitle got a first frame/last_frame aswell.

But still, it'd be good to know for applyrange

wonkey_monkey
10th July 2021, 12:51
ApplyRange has no way to accept the named parameters of another filter, so you have to supply as many as required, in order, to get to the one you want. You can write a function to overwrite part of a clip with another easily enough (although this one does no sanity checking and I haven't tested it, and it might well fail in boundary cases):

function ReplaceFrames(clip a, clip b, int start, int end) {
return a.trim(0, a-1) + b.trim(a, b) + a.trim(b+1, 0)
}

then call it like this:

source = Avisource("source.avi")
subtitled = Subtitle("My video", align = 2)
ReplaceFrames(source, subtitled, 300, 500)