I want to add subtitles to a video, which has a strip with written text at the bottom (sorry for the clumsy phrasing – what is the specific name by the way ?).
If I use Avisynth's TextSub(), the subtitles (created with SubtitleEdit in SRT format) appear with a pleasant style, but are positioned partially over that strip, which affects their readability. I found a way to change the position of the subtitles by creating a .srt.style file (based on the template found in this thread) and setting the “MarginV” field to a suitable value. It works, but then, the margin is the same for 1 line subtitles as for 2 lines subtitles, whereas by default the subtitles are vertically centered, so that the 1 line subtitles appear in the middle of the lines of 2 lines subtitles, if that's clear enough.
I found this thread adressing a similar issue :
https://forum.videohelp.com/threads/373652-Positioning-subtitle-in-video
The main advice is to convert to ASS format and then edit the margin separately for 1 lines subtitles and 2 lines subtitles.
Isn't there a more simple way of achieving what I want, which is, to keep the default style and default behaviour of SRT files as rendered by TextSub() and only shift them a few pixels lower ?
Also, if I do have to convert to ASS format, what would be the settings which would mimic the default appearance with TextSub and SRT format ?
![]()
+ Reply to Thread
Results 1 to 16 of 16
-
-
Solution 1:
Use 2 srt files. One for dual lines and one for single lines. Then you can make separate .style files for each of them. (Not sure if/why this would be easier for you?)
Or use some AviSynth "magic" to move one up (e.g. use MaskSub() and crop the top by the amount of wanted margin, then overlay).
Solution 2 (preferred by me):
Use ASS file for all lines. Make 2 different styles. In Aegisub you can "Subtitle"->"Select lines" with "Text" "\N" (for line break). Then just set them to the Style you created for dual lines.
Try:
Code:[Script Info] Title: Style equivalent to SRT rendering by TextSub() ScriptType: v4.00+ WrapStyle: 0 ScaledBorderAndShadow: no YCbCr Matrix: none PlayResX: 1280 PlayResY: 720 [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding Style: Default,Arial,45,&H00FFFFFF,&H000000FF,&H00000000,&HC80000000,1,0,0,0,100,100,0,0,1,2,3,2,10,10,50,1
-
Alright then... but it seems quite convoluted for something that could be much more simple, considering what Avisynth can do in other areas. Isn't it possible to simply shift the subtitles overlay by a given amount of pixel with an extra Avisynth command ?
But then why are the 1 line subtitles centered by default ? Why isn't it possible to preserve that behaviour when adding a .style file ?
Actually I'm not so sure about that, looking back at the file I encoded yesterday, in fact the 1 line subtitles appear to be at the same height as the second line of 2 lines subtitles, it's just less conspicuous because they're not right at the edge of the frame... And in VLC Media Player the default behavious seems to be the same. (But in Subtitle Edit's interface the 1 line subtitles appear to be aligned with the first line of the 2 lines subtitles, perhaps that's what confused me.)
What is the standard way of displaying 1 line / 2 lines subtitles on that particular aspect ?
I found this quite thorough document on the general subject of standards in subtitling : https://translationjournal.net/journal/04stndrd.htm
I haven't read it completely but it doesn't seem to mention that specific question (and since it's entitled “a proposal” I'm not sure if it reflects professional trends or merely the author's POV.) -
Move the subs higher, not lower.
Or cover that text entirely with them by making the subs within a solid black rectangle. -
@ manono
Move the subs higher, not lower.
Or cover that text entirely with them by making the subs within a solid black rectangle.
Is there another possibility, with an Avisynth command ? (I don't think that it would work well with this video, but it's good to know.)
@ sneaker
The “Styles Manager” interface in Aegisub is quite confusing, but I could get the desired result.
The first solution would have been more “simple” in the sense that the SRT format is more simple, and that it would have revolved around methods I already knew, but more complicated to implement, while the second proved to be more straightforward (and more versatile).
By the way, what is the specific name of that kind of strip of text at the bottom of a video or broadcast ? -
video captions
maybe the simplest solution is to make subs appear top center instead of bottom..
aegisub has a move text function for. ass but that would be too complicated for you..Last edited by teodz1984; 19th Aug 2019 at 20:09.
-
Why? So you don't sometimes get that extra space between the subs and that already-existing text. That's what you're complaining about, isn't it? Or move them all the way to the top, as teodz1984 suggest. Not subtitles but top titles.
How? The same way you moved them lower, move them above the fixed text or all the way up near the top.
Is there another possibility, with an Avisynth command ? (I don't think that it would work well with this video, but it's good to know.)
Did you understand what I was suggesting with the black rectangle? It may not be what you like, but it'll solve the problem of the text interfering with the subtitles. Something like this: -
@ manono
Why? So you don't sometimes get that extra space between the subs and that already-existing text. That's what you're complaining about, isn't it? Or move them all the way to the top, as teodz1984 suggest. Not subtitles but top titles.
How? The same way you moved them lower, move them above the fixed text or all the way up near the top.
What I managed to do (screenshots above in post #5) is satisfactory to me. I was disturbed by the fact that single lines were placed right at the bottom edge of the frame. That way it flows better. Top titles would be weird, it's extremely rare and seems counter-intuitive. Placing subtitles above that banner would be problematic as well, as the bottom of the frame would be empty while an area located in the second quarter from the bottom would be cluttered (and it would often cover the face of the speaker, as he moves a lot during his speech).
The black rectangle solution : yes that's what I understood, and that's what I got when testing “BorderStyle” = “3” in the “.srt.style” file. I was asking if there was another method to get something similar, with an Avisynth command perhaps. In this case it would work better if the black rectangle occupied the full width of the frame.
Unless you're using the AviSynth Subtitle filter (you're not), there's no AviSynth command. The styles are set in the subtitle. And it's easier in an SSA or ASS file than an SRT.
What movie is this by the way ?
@ teodz1984
aegisub has a move text function for. ass but that would be too complicated for you.. -
Using AviSynth it's easy enough to create a black rectangle to cover that text permanently and so the subtitles would be displayed within it. I don't know how to create a black rectangle that "occupied the full width of the frame" only when the subs are displayed. Perhaps someone better versed in AviSynth or subtitle creation can do it.
The film? A 1958 Indian film called Parvarish I happen to be working on now. I had finished editing the subs and was working with the video so I used a frame from the film to show a line of subs within the black rectangle.
https://www.imdb.com/title/tt0052051 -
I'm currently banging my head at the wall because I didn't see the easiest solution.
Solution 3:
Set ASS subtitles to be top center aligned. Then make marginV so huge they are at the bottom. -
I wrote a small guide for that once:
https://forum.videohelp.com/threads/389973-How-can-I-create-this-translucent-rectangul...le#post2527186 -
Sample ASS Script
[Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: TV.709
PlayResX: 1280
PlayResY: 720
[Aegisub Project Garbage]
Last Style Storage: Default
Video AR Mode: 4
Video AR Value: 1.777778
Video Zoom Percent: 0.500000
Scroll Position: 41
Active Line: 49
Video Position: 6296
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Tox Typewriter,55,&H0012EDF0,&HC0000000,&H00000000,&HA 8000000,0,0,0,0,95,100,0,0,1,6,1,2,10,10,10,1
Style: Default-Italic,Tox Typewriter,55,&H00E8D577,&HC0000000,&H00000000,&HA 8000000,-1,-1,0,0,95,100,0,0,1,6,1,2,10,10,10,1
[Events]
Dialogue: 10,0:01:31.98,0:01:34.90,Default,,0,0,0,,Thank you, Teacher.
Dialogue: 10,0:03:14.17,0:03:15.87,Default,,0,0,0,,{\pos(640,637)}Let's go!
If you are willing to invest studying the AEGISUB as ASS subtitling, it is light years ahead of SRT subs
For more on ASS tags
http://docs.aegisub.org/3.2/ASS_Tags/Last edited by teodz1984; 20th Aug 2019 at 06:43.
-
IN Japanese Anime, TOPSUbs are common esp. on ANIME Opening and Endings...With English translation on top and Romanji or Kanji on Bottom...
And also if the the bottom half is heavy with detail that might be occluded by text subs..
ASS formatting allow you to put almost any place on the screen.. e.g. replace foreign text on signs, books. etc or thought bubbles ..
It can be formatted horizontally vertically or curved ..
You can even make lyric syllables recolor as they are sung like animation like karaoke in real time...
It just takes time to learn how to code it
e.g.[Script Info]
; Script generated by Aegisub 3.2.0
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: TV.709
PlayResX: 1920
PlayResY: 1080
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Cabin,77,&H00FFFFFF,&H000019FF,&H004C2C1B, &HDC000000,-1,0,0,0,97,100,0.9,0,1,3.9,1.8,2,240,240,63,1
Style: Alternative,Cabin,77,&H00FFFFFF,&H000019FF,&H00314 835,&HDC000000,-1,0,0,0,97,100,0.9,0,1,3.9,1.8,2,240,240,63,1
Style: OP-rom,Timeless,62,&H00BD9A0F,&H008F2D12,&H00FFFFFF,& H00000000,-1,0,0,0,100,100,0,0,1,2.7,0,8,10,10,25,1
Style: OP-eng,Timeless,62,&H00AD7800,&H008F2D12,&H00FFFFFF,& H00000000,-1,0,0,0,100,100,0,0,1,2.7,0,2,10,10,25,1
[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 2,0:01:35.03,0:01:38.10,OP-rom,,0,0,0,fx,{\fad(100,0)\pos(1181,25)\blur1}{\c& H20FFFFFF&}shi
Dialogue: 3,0:01:35.03,0:01:38.10,OP-rom,,0,0,0,fx,{\fad(100,0)\bord0\c&H008F2D12&\pos( 1181,25)}shi
Dialogue: 2,0:01:35.03,0:01:38.33,OP-rom,,0,0,0,fx,{\fad(100,0)\pos(1237,25)\blur1}{\c& H20FFFFFF&}ta
Dialogue: 3,0:01:35.03,0:01:38.33,OP-rom,,0,0,0,fx,{\fad(100,0)\bord0\c&H008F2D12&\pos( 1237,25)}ta
Dialogue: 2,0:01:35.03,0:01:38.67,OP-rom,,0,0,0,fx,{\fad(100,0)\pos(1322,25)\blur1}{\c& H20FFFFFF&}you
Dialogue: 3,0:01:35.03,0:01:38.67,OP-rom,,0,0,0,fx,{\fad(100,0)\bord0\c&H008F2D12&\pos( 1322,25)}you
Dialogue: 2,0:01:35.03,0:01:39.02,OP-rom,,0,0,0,fx,{\fad(100,0)\pos(1403,25)\blur1}{\c& H20FFFFFF&}ni
Dialogue: 3,0:01:35.03,0:01:39.02,OP-rom,,0,0,0,fx,{\fad(100,0)\bord0\c&H008F2D12&\pos( 1403,25)}ni
Dialogue: 3,0:01:35.03,0:01:39.53,OP-eng,,0,0,0,fx,{\blur1\fad(100,150)\pos(960,1055)}I silently take it all in, including the sound of the waves
Note: This move was done to temporary shift the location of the subs that would conflict with a text message put by the TV stationLast edited by teodz1984; 20th Aug 2019 at 06:44.
-
@ sneaker
I'm currently banging my head at the wall because I didn't see the easiest solution.
Solution 3:
Set ASS subtitles to be top center aligned. Then make marginV so huge they are at the bottom.
What I did (screenshots above, or the end result here) with two style templates in Aegisub, as per you “solution 2” suggestion, was to position the single line subtitles approximately centered relative to the 2 lines subtitles, I find is more “balanced” that way for lack of a better word. I set MarginV to 25 for the “1L” style template and 8 for the “2L” style template.
But that workaround would work with SRT too, wouldn't it ? (I'll do some more tests later on, right now I switched to a completely different task, and I have such a hard time finishing things these days that it would be a bad idea to get distracted...)
@ teodz1984
IN Japanese Anime, TOPSUbs are common esp. on ANIME Opening and Endings...With English translation on top and Romanji or Kanji on Bottom...
And also if the the bottom half is heavy with detail that might be occluded by text subs..I also loved Dragon Ball as a kid, but so far I haven't mustered the courage to re-watch the 500+ episodes in non-dubbed subtitled version...) The names of the attacks also receive the double-subtitling treatment, with the “karaoke” effect you described.
But for a relatively “formal” speech it would be odd and distracting.
“Stars are swinging in my lap
I silently take it all in, including the sound of the waves”
It's funny how those two quotes seem to reply to each other !... Could be the start of a sort of polyphonic poem...
Has anyone ever done this, cutting quotes from various movies to create a visual poem, or to tell a whole new story ? -
-
If you don't like the space between lines when using a black box background you can render the subs to a superwhite video, build a mask of everything that's not superwhite, expand the mask, then use the mask to overlay a black box where the subs are going to appear on the video, then render the subs onto the video. In short, grow the black boxes until they fill the space between them.
Code:LSmashVideoSource("filename.mp4") Black = BlankClip(last, color=$000000) White = BlankClip(last, color=$FFFFFF).ColorYUV(off_y=20) # force white to superwhite (Y=235 to Y=255) bmask = TextSub(white, "filename.ssa", 0, 0).mt_binarize(254, true).mt_expand().mt_expand().mt_expand().mt_expand(chroma="-128") Overlay(last, black, mask=bmask) # expanded black box TextSub("filename.ssa") # write subs
I don't have any SSA subs to test so I just used some SRT subs. They don't have a black box background but you can see the black outlines around the characters expanded and touched. Normal subs on top, expanded on bottom:
[Attachment 49870 - Click to enlarge]
Also, I highly recommend you not put subs too near the bottom of the frame. Many people will have TV's that overscan and the subs will not be visible, or only partially visible. That's why the title scroll is so high in the frame.Last edited by jagabo; 20th Aug 2019 at 22:20.
Similar Threads
-
Scrolling vertical hum bar(?) interference line
By Chief Mouse in forum RestorationReplies: 3Last Post: 7th Jul 2018, 10:21 -
Vertical line spacing in ass subtitle file
By spopic in forum SubtitleReplies: 3Last Post: 21st Jun 2017, 03:07 -
Green vertical line on left side of the screen after filtering in Avisynth?
By Srivas in forum RestorationReplies: 2Last Post: 19th Feb 2016, 00:03 -
Is there any change to set size srt-subtitles with Xmedia Recode?
By yamaneko in forum Video ConversionReplies: 1Last Post: 14th Feb 2015, 06:02 -
Two-line srt subtitles - can one be italic?
By Bully9 in forum SubtitleReplies: 10Last Post: 23rd Jan 2015, 16:48