Log in

View Full Version : Textsub don't work together with blankclip


nel-son
18th November 2020, 08:50
Hi,

i have to replace a part of a video with blankclip show subtitles at that part of the video. But textsub don't work. This is the script

v = FFVideoSource("input.mkv", threads=1)
a = FFAudioSource("input.mkv")
z = AudioDub(v,a)
x = z.trim(0,7182)
y = blankclip(length=137, fps=25.000, width=1920, height=1080, pixel_type="yv12", channels=6, audio_rate=48000, color=$d4d0c8)
w = z.trim(7321,0)
return x+y+w
textsub("subtitles.ass")

This works:

v = FFVideoSource("input.mkv", threads=1)
a = FFAudioSource("input.mkv")
AudioDub(v,a)
textsub("subtitles.ass")

What is the problem with blankclip? Or is there an other problem that i don't see?

nel-son

videoh
18th November 2020, 11:01
Change it to this:

v = FFVideoSource("input.mkv", threads=1)
a = FFAudioSource("input.mkv")
z = AudioDub(v,a)
x = z.trim(0,7182)
y = blankclip(length=137, fps=25.000, width=1920, height=1080, pixel_type="yv12", channels=6, audio_rate=48000, color=$d4d0c8).textsub("subtitles.ass")
w = z.trim(7321,0)
return x+y+w

You were returning before applying textsub().

StainlessS
18th November 2020, 13:28
v = FFVideoSource("input.mkv", threads=1)
a = FFAudioSource("input.mkv")
z = AudioDub(v,a)
x = z.trim(0,7182)
y = z.blankclip(length=137, color=$d4d0c8).textsub("subtitles.ass") # Use z clip as template for blankclip
w = z.trim(7321,0)
return x+y+w

This would be easier, in future, use only Blankclip specific args, others default as z clip. [untested]

hello_hello
18th November 2020, 17:35
It'd also be easier to dump FFVideoSource and FFAudioSource, assuming the video and audio are from the same source and they're not being edited separately.

And should there be alignment of the splicing? (++ rather than +)
http://avisynth.nl/index.php/Splice

Clip = FFMS2("input.mkv", threads=1, atrack=-1)

Clip.Trim(0,7182) ++ \
BlankClip(Clip, color=$d4d0c8).Trim(0,136).textsub("subtitles.ass") ++ \
Clip.Trim(7321,0)

StainlessS
19th November 2020, 02:07
And should there be alignment of the splicing? (++ rather than +)

Trim() both chops excessive and pads deficient audio, so makes no difference either way (++ or +).