Adding Extra Information to Saved Video Overlay (.ass)

Hi everybody, even if i read many post about overlay and .ass file i don’t understand yet how i can modify the infomation logged in a .tlog file. I’m able to change parameters that will be recorded from the relative widget, but the overly will be displayed in a standard position once i replay video.

My questions are:

  1. Is there the possibility to modify the position of a text before it will be recorded or i must customize my overlay only after a .ass file will be generated? I would add some extra information in my overlay like company name, inspected target’s name and so on.

  2. i have seen that in my .ass file information are organized like follow:

Dialogue: 0,0:00:00.9,0:00:01.9,Default,0,0,0,{\an3\pos(950,1075)}Roll:\NPitch:\NHeading:
Dialogue: 0,0:00:00.9,0:00:01.9,Default,0,0,0,{\pos(960,1075)}-0.7 deg\N4.4 deg\N123 deg

im trying to understand why there is one line assigned to the header and a second one relative to the value. How i can merge in only one line?

Thank you

Hi @Matte, welcome to the forum! :slight_smile:

Looking at the original post,

the ‘proposal’ that was linked to specifies the subtitle-generation process shouldn’t be user-configurable to keep things simple. Looking at the code in the pull request, that was indeed the case. To add extra custom information/content you would need to modify the subtitles after they’re generated, which you could presumably do in one of the available Software Packages, or possibly with some simple code if you’re consistently adding the same information.

If you look at the image in the original post, the data types/headings are right-aligned whereas the corresponding values are left-aligned, so that they all line up in the display, and there’s a consistent gap between each data type and its value. The \an3 command would appear to perform that right-aligning.

I don’t know enough about the Advanced SubStation specification to know if it’s possible to combine text with different formatting in the same Dialogue line. If it is possible then I would assume it could be done with something like

Dialogue: 0,0:00:00.9,0:00:01.9,Default,0,0,0,{\an3\pos(950,1075)}Roll:\NPitch:\NHeading:{\pos(960,1075)}-0.7 deg\N4.4 deg\N123 deg

but I have no idea if that’s the correct syntax, or whether all different formatting needs to be kept on its own Dialogue line to function correctly.

Hi @EliotBR ,
thank you very much for your reply now i understand.
I will try to customized my overlay working on ass file.

Have a good day.

No worries, glad to hear it was helpful :slight_smile:

See how you go. Adding text shouldn’t be very difficult, and it’s also possible to add images (e.g. company logo) but that will be a bit more complex.

As an example, the following line specifies some

  • semi-transparent text (\alpha&HAA&AA is 170 / 255 = 66.67\% transparent)
  • in the top right corner* (\an9 → aligned by top right, \pos(1910,5) → 10 pixels in from right side (of 1920x1080 video), 5 pixels down from the top)
  • that’s visible for the entire video (starts at earliest possible time (0:00:00.0), ends at latest possible time (9:59:59.99))
  • with a smaller font size (\fs18 → 18 pixels tall font size) for the lower two lines (after \N forced line break)
Dialogue: 0,0:00:00.0,9:59:59.99,Default,,0,0,0,,{\an9\pos(1910,5)\alpha&HAA&}Blue Robotics\N{\fs18}For: Another Company\NProject: PID-53871

You can try it out by adding it to the [Events] section of one of your existing .ass files (e.g. using a text editor) and playing the video :slight_smile:

*Note: if you leave it as \an9 with no \pos(x,y) specified it will auto-locate the text in the top right corner. The \pos is just for if you want to specify precisely where it ends up.


By the way, I tried this and it doesn’t work. That’s also consistent with the specification, which says that only the first alignment specifier is considered.

I spent a bit of time looking into this and managed to get the embedded encoding process working, but then hit something of a wall with software that’s actually able to render the images (it seems embedded images aren’t well supported, and it’s possible the Picture event type isn’t well supported either). It may be necessary to use vector graphics with the Drawings commands instead of pixel-based images, which I’ll try out a bit later.

My file encoding code (Python) and a bunch of notes are in this gist, for anyone interested :slight_smile:

Hi Eliot,
thank you very much for your interest. About add Company’s Logo/image i find a solution using VLC (How To Add Logo & Remove Watermark Using VLC Media Player - YouTube).

I’m not skilled yet enough with python but i can try to use it for modify Ass file in order to customized data.

1 Like

Oh cool, I hadn’t considered VLC might have that kind of functionality built in. That’s good to know :slight_smile:

The code I wrote is only relevant for encoding images for Picture events in subtitles, which don’t seem to be properly supported in any software I could find, so most likely it isn’t very useful. The image to vector idea I proposed in the notes at the bottom of the gist could definitely be useful, but that code doesn’t exist yet, and I’m not sure if/when I’ll have the time to try writing it.

If you’re interested in programmatically changing your .ass files (e.g. with a script that you consistently run when you have a new video) then you might want to use python-ass to parse and manipulate them (or just standard file handling) :slight_smile:

Thank for the tip about python-ass i will check how to use python with this kind of file. Thanks

1 Like