Hi there,
Happy to have found this forum as I'm a total newbie to video editing. Thank you all for offering advice to strangers!
All I need to do is burn in subtitles (I do the translating), and I need them to look like the attached image.
To describe it, it's a gray box (I have the hex code for the gray), semi-opaque, and the box does NOT correlate to the length of the subtitles themselves. In other words, the rectangular box should stay the same size, and the subtitles can be longer or shorter within that box.
I have used Handbrake in the past to burn in .srt files. I am wiling to use other OpenSource or extremely inexpensive software for my Mac, or an online option. I do have a Windows laptop but it's too low powered to do most anything, unfortunately.
I have searched around and seen how to add a black box with .ASS files (changing the BorderStyle to 3). But that box is deep opaque black, and it is also only as large as the subtitle line. I tried changing the BackColor, but that isn't the color of the box border, I guess.
1. Is there a way to add parameters to the .ASS file that would specify what I'm trying to do?
2. If not, is there another way to make this happen?
Any advice is super appreciated. Stay healthy, everyone.
+ Reply to Thread
Results 1 to 15 of 15
-
-
I moved your thread to the mac forum where you can get more help.
I think,therefore i am a hamster. -
It's possible to make the boxes have a fixed width albeit more complicated than just changing one parameter:
https://forum.videohelp.com/threads/389973-How-can-I-create-this-translucent-rectangul...le#post2527186Last edited by sneaker; 18th Apr 2020 at 07:12.
-
Thanks for this. That other thread appears to be for Windows machines...?
There is a script to automate this: https://github.com/Majid110/MasafAutomation
Download:
MasafAutomation.lua (right-click, save as. Put into folder Aegisub\automation\autoload)
utf8.lua (right-click, save as. Put into folder Aegisub\automation\include)
Then do:
1. open video file in Aegisub (you can click Audio->Close Audio to make the audio waveform/spectrum disappear)
2. load subtitle
3. click File->Properties and set correct video resolution and YCbCr Matrix (usually "TV.709" for HD and "TV.601" for SD resolution video)
4. click Automation->Masaf->Add backgrounds. This will make the script add one line of background.
5. now edit the line created in step 4 so it fits your subtitles
6. to edit the opaqueness edit the style "TextBackground". (edit its primary color's alpha level)
7. click Automation->Masaf->Add backgrounds again to copy the created background line to every real subtitle line
8. click File->Save subtitles as to save as an .ass file.
9. Now you can use the .ass file how you want. E.g. add into mkv container (you can put fonts in attachments) using mkvtoolnix. If your player doesn't like ASS format you can hardcode using e.g. HandBrake (open the mkv, select the subtitle track, tick "burn-in", then encode).
or, I don't know how to find the submenus to place those .lua files into on a Mac (this is my first Mac). I was going to just do it all manually (tedious, but perhaps faster than the learning required), but that didn't appear to work either, unless I'm not cutting and pasting the code from this section correctly:
Basically, you can create an ASS subtitle. And for each line of "real" subtitle you need a second line that looks something like this:
{\p1\pos(640,715)}m 0 0 l 1280 0 l 1280 50 l 0 50 l 0 0
1280 is the width of the box(=width of your video if you want the box to span it completely), 50 the height. 640 is video width divided by two. 715 is the bottom edge of box measured from the top of the video.
I am not a coder, I'm just okay at following instructions. I tried cutting and pasting that suggested line and it didn't work.
Am I correct about those instructions being for Windows? -
Thank you so much, Sneaker! I learned something new (how to get into the application bundle on a Mac: Apple makes applications appear to be one file (one icon) but their application icons are actually bundles, or packages, and all it takes is a right click to get access).
So I ran the protocol, and ran into some glitches, of course. Some of these are questions, and some are observations.
1) Even though I ran the Masaf protocol twice, it gave me an error message and so didn't insert the line everywhere: it just created one box at the beginning. I've attached that error message as a screenshot. What to do about that error?
2) The box was in place, but the subtitles were now tiny and way down at the bottom, and not in the format I had specified (for example, it outlined them when I said no outline). Another screenshot attached. It seems that the Default style got set for all the lines, so the other style I had made isn't in play. I edited the Default style and that helped, although, oddly, I had to make the font way huge for it to work.
3) I changed the Primary Color of the TextBackground in order to get the box to change color, so that was great (I figured this out after I took the screenshot of the black box).
4) As I ran the Masaf protocol the second time (to insert the line everywhere), a dialogue box appeared that asked me how many maximum seconds the box should display: what does that mean?
5) Sometimes my subtitles are one line, sometimes two or three. So it seems that I'll need to change the location of the subtitle line if there's only one line of text, so that it centers itself in the box? It seems very tedious to do that manually: is there another way? Also, how to move the subtitle line? All I see is the positioning (1-9) and the margins don't push it around.
6) Sometimes I even have three subtitle lines, so that will I guess require manually changing the code for those few incidences? If that's incorrect, please let me know.
This is surely an adventure in editing.... -
Can you share your .ASS file? I think there may be problems in it (i.e. a style name of a line not actually matching an existing style or vice versa or something like that).
Make sure video resolution is set correctly. Save and test the file before you run the MASAF scripts. I think you may have set the resolution wrong. (Note that ASS does some scaling, i.e. if script resolution is set to "640x480" on a 1920x1080 file then the lines will appear bigger. If you then change script resolution to "1920x1080" without changing font sizes then subtitles will become much smaller.)
It the gap between 2 lines is less than x seconds, then the black box will not disappear between them. I think a negative value ("-1") will leave gaps as is. Not sure. -
Yes, it's a bit more complicated. What you could do is select the long lines, move them (ctrl+x) to a new file and do the masaf things there separately and at the end re-combine them again.
Make sure you set the alignment and margins BEFORE running Masaf because it adds {\pos} tags. (Which makes me wonder if this is supposed to be automated in the first place?) -
Thanks so much for all this help.
1) File: I started with an .srt file and converted it with an online converter. Then I tweaked a lot of parameters to see if I could do the box myself. I will just start from scratch now and do it all within Aegisub, I guess. So the .ass file says this at the beginning, just after converting it from .srt:
[Script Info]
; This is an Advanced Sub Station Alpha v4+ script.
Title: phpr4l0Gt
ScriptType: v4.00+
Collisions: Normal
PlayDepth: 0
[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,20,&H00FFFFFF,&H0300FFFF,&H00000000, &H02000000,0,0,0,0,100,100,0,0,1,2,1,2,10,10,10 ,1
[Events]
Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.20,0:00:06.40,Default,,0,0,0,,Ciudadanos por un Clima Vivible (CCL) es una organización bipartidaria......
I would change the font to Ubuntu, and keep it white with no shadowing or outline, because it will all be on that rectangular box. And I guess adding the rectangular box adds another Style with the name TextBackground.
2) The resolution of the video is 1280 x 720. I guess I don't know which resolution to pick (the video is for online watching), but I did try changing the resolution and clicking Apply and nothing seemed to make the subtitles bigger on the little preview on the top left within Aegisub. I don't mind just making the font size 40 or 50 if that's what I have to do, I guess. Unless there's another reason the resolution parameter must be set? Does it make things look pixelated or grainy if it's wrong?
3) Thanks for the technique suggestion for the long lines. I guess that makes sense...the timing would stay the same, so separating and merging them should just put them back in order, right? -
Just set 1280x720.
No. But sizes/scaling changes.
Yes, timings stay the same. (To re-order after copy&pasting do "Subtitle"->"Sort All Lines"->"Start Time". Though the file will work fine even without sorting ...) -
Oh wow, I did it!!! It took several hours of perplexed finagling. I even tried a last ditch effort to avoid the work by going through Facebook because they box all their captions, but LORDY their subtitle editor is horrid.
@sneaker, I couldn't have done it without your help: thank you!
Your tip about the "-1" setting on that dialogue box for timing was critical.
I also had to find out that "\N" is how to put a line break where you want it, which was important to make sure the titles fit in the box no matter the length. (I learned "\N" from this video https://www.youtube.com/watch?v=PyKXdiNp2oA, which is not in a language I know, but whatev, it's decipherable! )
Since the subtitles are set in position by their center point, the Masaf automation does center them over the box, regardless of the number of line of titles. I think you are right, sneaker: Masaf puts them aligned over the box, regardless of where you set them before you run the automation the second time.
I tweaked the numbers in the Masaf-added TextBackground line to make the box smaller, and set the primary color and alpha level to get the right color and transparency. The end result was this:
{\p1\pos(640,648)}m 0 0 l 800 0 l 800 100 l 0 100 l 0 0
Tweaking that was not intimidating because as you change the numbers, they immediately change the box on your video preview, so you can see exactly which parameter you are altering. So the box can be a trapezoid if you want it, actually.
I cut the three titles that were three lines deep (and on a static slide so didn't need a shaded box) and pasted them into another file in order to spare them the Masaf box, then replaced them. I guess I could have used the {no_bg function on those lines instead, to specify No Backgroun. I can't find now where I read about that: either another thread here, or on documentation for Masaf? [For any future readers...I'm not sure about that exact phrasing so look it up elsewhere before using it.]
A couple other titles needed to be pulled off center to accommodate written text on the original video, which I did manually with the mouse-based typesetting functions on the left-hand side. Super easy and it looks superb.
I learned about those typesetting functions on these video tutorials by TJ FREE on Youtube, which had a tidbit here or there which pushed me over the threshold of understanding. https://www.youtube.com/watch?v=4gXF6Y-v6BE&list=PLqazFFzUAPc7BgGTaDAvvsGEoLolq09YP
In general, the documentation from Aegisub is too basic to really help much. So I'm deeply grateful for you, and for that TJ FREE guy.
This is all for an organization working on climate, so you are helping to save the world! -
There is one more thing I just figured out.
In editing a style, there is a Alignment indicator that corresponds to a number on a dialpad, 1 through 9. 1 is bottom left, 2 is bottom middle, 3 is bottom right, etc, through 9.
I thought that meant the title would automatically be aligned to those positions on the video screen, BUT rather, that means the point of positioning is in relation to that location ON THE SUBTITLE. So, if you choose 2 for your style, the point of position reference will be the bottom middle of the subtitle. If you choose 5, the point of reference will be the middle of the subtitle.
In order for the Masaf box to center itself automatically behind your subtitles no matter the number of subtitle wrapped lines, you must pick 5 as the position for BOTH the subtitle style, and the TextBackground style. That way, both are aligned according to their center points. -
Similar Threads
-
Tool to add opaque box and change transparency
By kodec in forum SubtitleReplies: 2Last Post: 29th Dec 2019, 11:27 -
Hardsub Burning Software with Opaque Box Support?
By modestyblaise in forum SubtitleReplies: 4Last Post: 1st Feb 2019, 16:32 -
How to make opaque box of subtitles semi-transparent?
By victorbireaud in forum SubtitleReplies: 2Last Post: 15th May 2018, 05:28 -
Problem with opaque box
By Robzkie in forum SubtitleReplies: 6Last Post: 16th May 2017, 06:14 -
Subtitles in a black box to cover up existing embedded subtitles.
By Leg_end in forum SubtitleReplies: 4Last Post: 7th Dec 2016, 00:23