November 27, 2021, 04:45:53 PM

News:

--


Subtitles positioning

Started by Andrew546, September 10, 2021, 08:47:20 PM

Previous topic - Next topic

Andrew546

September 10, 2021, 08:47:20 PM Last Edit: September 10, 2021, 08:50:05 PM by Andrew546
Hello, I have used Avidemux to add subtitles to a video. However I now want to raise the positioning of the subtitles up a bit higher. I have watched old videos showing a slider that could be used to move the subs to the desired position but I don't see this option in the program where it was in the videos. Any help would be appreciated, thanks.

eumagga0x2a

As subtitles processed by the libass plugin in Avidemux become hardcoded (this is the purpose of this video filter), they have become an integral part of the picture and cannot be modified without modifying the picture itself. As long as you have the original video without subtitles and the subtitle file (.ass or .srt), you can redo the processing with an increased bottom margin.

Andrew546

September 10, 2021, 09:36:30 PM #2 Last Edit: September 10, 2021, 09:39:05 PM by Andrew546
Quote from: eumagga0x2a on September 10, 2021, 09:11:18 PMAs subtitles processed by the libass plugin in Avidemux become hardcoded (this is the purpose of this video filter), they have become an integral part of the picture and cannot be modified without modifying the picture itself. As long as you have the original video without subtitles and the subtitle file (.ass or .srt), you can redo the processing with an increased bottom margin.

Thanks for replying, i do have the original video without subs to work on. Increasing the bottom margin doesn't appear to move the subs from what i can see, and even if it did this isn't a great solution since I don't want larger margins on the video than I already have. All I want to do is move the subs, which used to be possible on avidemux using the slider but appears to no longer be an option.

eumagga0x2a

Quote from: Andrew546 on September 10, 2021, 09:36:30 PMIncreasing the bottom margin doesn't appear to move the subs from what i can see

In this case you need to edit the .ass file in Aegisub. There might have been some rudimentary styling / positioning controls in Avidemux 2.5.x removed during the rewrite of the application which led to Avidemux 2.6.x.

Andrew546

Quote from: eumagga0x2a on September 10, 2021, 10:13:22 PM
Quote from: Andrew546 on September 10, 2021, 09:36:30 PMIncreasing the bottom margin doesn't appear to move the subs from what i can see

In this case you need to edit the .ass file in Aegisub. There might have been some rudimentary styling / positioning controls in Avidemux 2.5.x removed during the rewrite of the application which led to Avidemux 2.6.x.

Could you point me to some instructions for how to do that please, thanks.

eumagga0x2a

If you open the corresponding .ssa (or .ass) file with a text editor, you will find a section [V4+ Styles] similar to

[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,30,&H00ffffff,&H0000ffff,&H00000000,&H00000000,0,0,0,0,100,100,0,0.00,1,2,2,2,30,30,10,0

In this example, "Default" in the second line is the name of the style and penultimate field with value "10" (in units of resolution, usually in pixel, when the values of PlayResX and PlayResY match the pixel size of the picture) is the vertical margin relative to the bottom border of the picture. Increase this value if you want the subtitles to be rendered higher.

Of course, you can use Aegisub to perform these changes graphically without danger of messing up the syntax.

Reference: https://aegi.vmoe.info/docs/3.0/Styles/

eumagga0x2a

Quote from: Andrew546 on September 10, 2021, 09:36:30 PMIncreasing the bottom margin doesn't appear to move the subs from what i can see, and even if it did this isn't a great solution since I don't want larger margins on the video than I already have.

You're absolutely right, I'm sorry. I've got finally a chance to check what this option really does (it adds margins to the output picture, changing the aspect ratio, and enables libass to render subtitles into those margins).

eumagga0x2a

Quote from: eumagga0x2a on September 10, 2021, 10:13:22 PMThere might have been some rudimentary styling / positioning controls in Avidemux 2.5.x removed during the rewrite of the application which led to Avidemux 2.6.x.

I've checked the code of Avidemux 2.5.6: at least in that version, there were no styling / positioning controls beyond those present in current 2.7.9 builds.

Andrew546

September 13, 2021, 09:24:57 PM #8 Last Edit: September 13, 2021, 09:32:30 PM by Andrew546
Quote from: eumagga0x2a on September 12, 2021, 06:55:46 PMIf you open the corresponding .ssa (or .ass) file with a text editor, you will find a section [V4+ Styles] similar to

[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,30,&H00ffffff,&H0000ffff,&H00000000,&H00000000,0,0,0,0,100,100,0,0.00,1,2,2,2,30,30,10,0

In this example, "Default" in the second line is the name of the style and penultimate field with value "10" (in units of resolution, usually in pixel, when the values of PlayResX and PlayResY match the pixel size of the picture) is the vertical margin relative to the bottom border of the picture. Increase this value if you want the subtitles to be rendered higher.

Of course, you can use Aegisub to perform these changes graphically without danger of messing up the syntax.

Reference: https://aegi.vmoe.info/docs/3.0/Styles/
Quote from: eumagga0x2a on September 12, 2021, 07:06:42 PM
Quote from: Andrew546 on September 10, 2021, 09:36:30 PMIncreasing the bottom margin doesn't appear to move the subs from what i can see, and even if it did this isn't a great solution since I don't want larger margins on the video than I already have.

You're absolutely right, I'm sorry. I've got finally a chance to check what this option really does (it adds margins to the output picture, changing the aspect ratio, and enables libass to render subtitles into those margins).
Quote from: eumagga0x2a on September 12, 2021, 07:13:37 PM
Quote from: eumagga0x2a on September 10, 2021, 10:13:22 PMThere might have been some rudimentary styling / positioning controls in Avidemux 2.5.x removed during the rewrite of the application which led to Avidemux 2.6.x.

I've checked the code of Avidemux 2.5.6: at least in that version, there were no styling / positioning controls beyond those present in current 2.7.9 builds.

Thanks a lot, you've been very helpful! FYI I downloaded an older version of Avidemux which has the feature I was talking about. The version is 2.5.3. The filter which contains the slider is called ''Subtitler''. Here are two pictures:    https://ibb.co/pjN2Fvf     https://ibb.co/4Tw0f7g Unfortunately that old version of Avidemux crashes all the time for some reason so it's not usable. I will try to do it through Aegisub as you suggested.

eumagga0x2a

Quote from: Andrew546 on September 13, 2021, 09:24:57 PMThe filter which contains the slider is called ''Subtitler''.

This explains everything. I wasn't aware of its existence, so I didn't look for it. The Srt ("Subtitler") video filter is present in 2.5.6 too, it supported only subtitles in SRT format and used Freetype directly to render glyphs into the video instead of delegating all the magic to a powerful specialized library (libass) with many more capabilities.

As SRT doesn't support styles, position and such, the renderer has to decide on its own, allowing user-adjustable positioning.