![]() If you have a small number of positions that each subtitle will be displayed in, I think it's easier to define a Style for each position. Each actual subtitle will use one of these styles. The V4+ Styles section allows you to specify an arbitrary number of "Styles", which define color, position, font, and a lot of other things. I don't really understand the Script Info section yet. The actual file has many many more "Dialogue" lines after this, but I truncated for readability. I went with ASS because it seemed to work, and I discovered enough templates on the internet that I was able to figure out the most important features by trial and error.įirst, create a text file called desc.ass that looks like this: įormat: Name, Fontname, Fontsize, Primar圜olour, Alignment, MarginL, MarginVĭialogue: 00:00:01.00, 00:00:05.00, E, Text to display with the E styleĭialogue: 00:00:05.00, 00:00:05.50, N, Text to display with the N style In fact I found it very difficult to find clear documentation of ANY of the options for subtitles files. Here's the documentation on the subtitles filter, but it doesn't actually explain the syntax of the accompanying files. Others don't allow loading a long list of subtitles from a file, ie you have to encode them all into the ffmpeg command string, which is unwieldy. Some of methods don't allow arbitrary positioning (the subtitle will always be centered at the bottom). I wanted to write my own subtitles in a text file (to make it scriptable), not use a standalone GUI. Using a GUI/standalone program mentioned aegisub).Simply making the box taller to compensate will suffice, but will look ugly because the subtitles baseline remains static: the single line subtitles will have more padding on the top than the bottom. This may be useful if you want the box to span the width.ĭownside is that you have to account for line breaks or word wrapping for long subtitles. The drawbox filter can be used to create a background box. Thanks to sup and wm4 for the BorderStyle suggestion. ![]() Note that BorderStyle=4 is a non-standard value, so it may not work properly in all players. This will fill the bounding box background of each subtitle event. In the Style line change the value corresponding with BorderStyle to 4. ![]() Click on the shadow color to adjust the Alpha of the shadow color to your desired transparency level.Įdit the ASS file in a text editor. The alpha settings of the shadow will control the transparency of the background box.Changing the Outline and Shadow sizes to 0.If your subtitles contains multiple lines, due to auto-wrapping of long lines or an intentional line break, the backgrounds will overlap and potentially look ugly as shown below: See SubStation Alpha (ASS) style fields for formatting options. This will work with any text based subtitles supported by FFmpeg because the filter will automatically convert them to ASS. ffmpeg -i input -filter_complex "subtitles=subs.ass:force_style='OutlineColour=&H80000000,BorderStyle=3,Outline=1,Shadow=0,MarginV=20'" output If you want hardsubs you can use the subtitles filter to add the transparent background with the force_style option. Now you can use the AAS file to make hardsubs or softsubs with ffmpeg. Adjust the value of the Alpha box to change transparency. Under Colors click the color under Outline or Shadows.Experiment with the Outline and Shadow values.Under Current Script choose Default, then press the Edit button.The easiest way to do this is with aegisub. ASS subtitles can have a semi-transparent background for the text.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |