Mpv: Graphical subtitles (DVD, BD) positioning with keys 'r', 't' doesn't work

Created on 12 Apr 2015  路  16Comments  路  Source: mpv-player/mpv

Text subtitles (SRT, ASS) are positioning good but graphical subs (onto DVD & Blu-ray) aren't. They are unmovable at all.
Is it possible please to make them positionable (movable)?
Thanks.

subtitle filter feature-request low stalled

Most helpful comment

wm4 is suggesting that allowing users to move image-based subs would cause them to miss subtitles without knowing it. I'm confused by this, because the issue poster was noticing that keys 'r' and 't' don't work to reposition image-based subtitles. The man page says:

   r and t
         Move subtitles up/down.

Presumably these keys don't cause the subtitles to move all the way up/down at once, but rather just a little bit at a time? In which case the user would be able to see very clearly if the subtitles are starting to move off the screen. I think as long as there is some kind of OSD message saying how many pixels they have moved, it should be fine.

Given that we already have --stretch-image-subs-to-screen, I'd say it should be fairly easy to implement something which, instead of stretching the subtitle bitmap, just offsets it up or down. But I haven't looked at the code.

All 16 comments

It's not really possible, because they're explicitly positioned bitmaps. DVD subs are even just a single frame covering the whole screen (the decoder usually crops them to the visible part for efficiency). So I'm not sure how that'd even work.

Whole screen!
Is it possible not only crop but also resize, rotate, scroll them?

Image subtitles themselves can not do any such operations, if you mean this.

Can not themselves, can ourselves? :) I mean is it possible to do it programmatically? Write procedure from scratch?

If you have a suggestion how it should work...

If decoder can crop, may be it can crop more than needed to fit? If we cut off, for example, top half of subtitle frame, then we get possibility to move this frame vertically to the top...

So you're saying: if subtitles are moved upwards, then the parts that are moved out of the screen (like "toptitles") should simply remain invisible?

ASS text subtitles which are placed at the top of the screen are moved out of the screen too if we press 'r' many times. What's the difference?

What's the difference?

A big one. I explained above that the subtitle might consist of a single image.

So the main question is: can this single image be smaller than the video frame?
You wrote: "Image subtitles themselves can not do any such operations" but if resizing player window the subtitle scales too, together with video frame. So resizing is possible. Why cropping isn't?

Cropping and resizing them is possible. What I meant is that the subtitle decoders just output bitmaps (which are not cropped, scaled or rotated). But of course whatever renders them to the screen has to scale or possibly crop them.

So the main question is: can this single image be smaller than the video frame?

Yes. But it doesn't have to. vobsubs are RLE encoded fullscreen images, and the decoder just crops off the transparent parts for convenience. So if a frame has both subtitles and top titles, the subtitle image will be almost as big as the video frame, with lots of transparency between sub- and toptitle. The question is what would you do with this if the subtitles are meant to be moved upwards?

I think we see sub-titles much often then top-titles and then both them present. In this case we have lots of transparency above the subtitle and can move the subtitle upwards.
In case of both are present as you describe - may be we can scroll the whole frame up. Yes, top-title will be out of screen and will be lost. Not so bad because if we scroll up the text top-title it moves out too. It's the same behavior, isn't it? It's clear that if something places at the top and we move it up than it disappears. And if we move the bottom title down it disappears too. What do I not understand properly?
Is it possible to move such whole graphics bitmap left, right, up, down - in any direction - to make some parts of it invisible, lost?

Not so bad because if we scroll up the text top-title it moves out too. It's the same behavior, isn't it?

Well, text subtitles don't do this. Top titles will remain visible, even if subs are moved up.

Is it possible to move such whole graphics bitmap left, right, up, down - in any direction - to make some parts of it invisible, lost?

Yes, it's possible. But it doesn't sound terrible elegant to me, and users would miss the invisible text without knowing it.

Maybe not moving bitmaps only as much as they're still visible would be better? Then toptitles would barely change position. And if both top- and subtitles are visible, subtitles would remain subtitles.

Agree.

wm4 is suggesting that allowing users to move image-based subs would cause them to miss subtitles without knowing it. I'm confused by this, because the issue poster was noticing that keys 'r' and 't' don't work to reposition image-based subtitles. The man page says:

   r and t
         Move subtitles up/down.

Presumably these keys don't cause the subtitles to move all the way up/down at once, but rather just a little bit at a time? In which case the user would be able to see very clearly if the subtitles are starting to move off the screen. I think as long as there is some kind of OSD message saying how many pixels they have moved, it should be fine.

Given that we already have --stretch-image-subs-to-screen, I'd say it should be fairly easy to implement something which, instead of stretching the subtitle bitmap, just offsets it up or down. But I haven't looked at the code.

It works now, I can move PGS subtitles with 'r' and 't' (mpv 0.33).
Seems to be fixed by this commit: https://github.com/mpv-player/mpv/commit/27c5550de2693d27ed24d3838a4ae16a06a9dd5d

Was this page helpful?
0 / 5 - 0 ratings