VideoHelp Forum

Try DVDFab and copy Ultra HD Blu-rays and DVDs! Or rip iTunes movies and music! Download free trial !
+ Reply to Thread
Results 1 to 15 of 15
Thread
  1. 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.
    Image Attached Thumbnails Click image for larger version

Name:	Screen Shot 2020-04-17 at 6.36.15 PM.png
Views:	27
Size:	2.01 MB
ID:	52774  

    Quote Quote  
  2. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    I moved your thread to the mac forum where you can get more help.
    I think,therefore i am a hamster.
    Quote Quote  
  3. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by tamarinera View Post
    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.
    https://www.videohelp.com/software/Aegisub
    Quote Quote  
  4. 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#post2527186
    Last edited by sneaker; 18th Apr 2020 at 07:12.
    Quote Quote  
  5. Originally Posted by johns0 View Post
    I moved your thread to the mac forum where you can get more help.
    Thank you!
    Quote Quote  
  6. Originally Posted by sneaker View Post
    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#post2527186
    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?
    Quote Quote  
  7. Indeed, I do not use mac but I imagine there must also be folders to put the .lua files? Some sub-folders of any of those mentioned here?
    Quote Quote  
  8. 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....
    Image Attached Thumbnails Click image for larger version

Name:	Screen Shot 2020-04-22 at 2.41.52 PM.png
Views:	31
Size:	996.6 KB
ID:	52828  

    Click image for larger version

Name:	Screen Shot 2020-04-22 at 3.03.56 PM.png
Views:	32
Size:	242.4 KB
ID:	52829  

    Quote Quote  
  9. 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).

    Originally Posted by tamarinera View Post
    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.
    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.)

    Originally Posted by tamarinera View Post
    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?
    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.
    Quote Quote  
  10. Originally Posted by tamarinera View Post
    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.
    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.

    Originally Posted by tamarinera View Post
    All I see is the positioning (1-9) and the margins don't push it around. [/B]
    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?)
    Quote Quote  
  11. 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?
    Quote Quote  
  12. Originally Posted by tamarinera View Post
    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?
    Just set 1280x720.

    Originally Posted by tamarinera View Post
    Does it make things look pixelated or grainy if it's wrong?
    No. But sizes/scaling changes.

    Originally Posted by tamarinera View Post
    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?
    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 ...)
    Quote Quote  
  13. 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!
    Image Attached Thumbnails Click image for larger version

Name:	Screen Shot 2020-04-27 at 11.13.26 PM.png
Views:	20
Size:	3.99 MB
ID:	52949  

    Click image for larger version

Name:	Screen Shot 2020-04-27 at 11.12.36 PM.png
Views:	32
Size:	2.92 MB
ID:	52950  

    Quote Quote  
  14. 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.
    Quote Quote  
  15. Originally Posted by tamarinera View Post
    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.
    It can actually mean one or the other. With \pos or \move tag it means where the anchor point is as you found out. Without those tags it means alignment on the whole screen.
    Quote Quote  



Similar Threads