I've used AviSynth+ a few times. I want to add credits at the end of a show on several lines and would rather avoid repeating the settings and tune the alignment for each line. The page below uses newline characters (\n) to introduce newlines in a subtitle in AviSynth:
https://compactvideo.wordpress.com/2011/03/26/how-to-create-titles-and-captions-using-avisynthCode:subtitle("First line\nNext line\nLast line", ...)
I tried this code on AviSynth+ and it fails.
What is the simplest way to include newlines in subtitles?
+ Reply to Thread
Results 1 to 4 of 4
-
Last edited by miguelmorin; 22nd Feb 2020 at 03:10. Reason: fixed hyperlink
-
You have to specify lsp (line spacing parameter) for \n line breaks
Code:subtitle("First line\nNext line\nLast line", lsp=10)
http://avisynth.nl/index.php/Subtitle
int lsp =
Line Spacing Parameter; enables multi-line text (where "\n" enters a line break). If lsp is less than zero, inter-line spacing is decreased; if greater, the spacing is increased, relative to Windows' default spacing. By default, multi-line text disabled.
In the unlikely event that you want to output the characters "\n" literally in a multi-line text, you can do this by using "\\n".
-
On the AviSynth Subtitle page it says to do it like so:
Print text on multiple lines with no halo border
BlankClip()
Subtitle( \
"Some text on line 1\\nMore text on line 1\n" + \
"Some text on line 2", \
lsp=10, halo_color=$ff000000)
It results in:
Some text on line 1\nMore text on line 1
Some text on line 2
Me, I'd just create a real SSA subtitle file and add it to the script using the TextSub filter (part of the VSFilter). -
My bad, I missed the argument lsp at the end of the command in the page that I mentioned, and also the example on the wiki. Thanks both!
On this occasion I prefer to keep the credits as subtitles since they are at most 1 minute in a one hour show with no audio. I'll definitely use SubStation Alpha in the future for creating subtitles related to the audio.
Similar Threads
-
Insert Forced subtitles in Original subtitles (.srt)
By VideoOn in forum EditingReplies: 1Last Post: 12th Feb 2020, 01:43 -
Burning in Subtitles with AviSynth?
By TE16 in forum Video ConversionReplies: 1Last Post: 22nd Apr 2017, 07:32 -
problem "burning in" subtitles on download video that has soft subtitles
By kasfig in forum SubtitleReplies: 2Last Post: 1st Feb 2017, 16:47 -
Avisynth: Loading images like we load subtitles
By ReubenMru in forum EditingReplies: 2Last Post: 27th Jan 2017, 16:30 -
Subtitles in a black box to cover up existing embedded subtitles.
By Leg_end in forum SubtitleReplies: 4Last Post: 7th Dec 2016, 00:23