-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blend-subtitles=yes
breaks subtitles when using video-crop
#13423
Comments
Does this issue still exist if you downgrade libass to 0.16.0? |
Yes, the issue still persists with Only the rendering of Neither seems particularly correct to me. |
Looks ok, your subtitles have
The same as above, but you crop only half.
Now that you disabled blending your subtitles are rendered at target resolution instead of video.
This is rightfully stretched, because All examples looks correct to me. Could you explain what do you expect and why? |
Shouldn't a cropped video behave the same though?
The video covers the entire window when cropped by the player, so not
So… you think that PlayRes is supposed to be set for the resolution before cropping? If that is true, why does it behave differently with |
I'm not touching this option. It has been in my opinion broken for years or I just don't understand it's purpose. Just put
It is kind of explained in docs, but in the same time they are not fully updated for gpu-next.
Either way, |
|
Yes, both EDIT: Intuitively, maybe it is true, that having |
I cannot reproduce, works fine for me on latest mpv and libass 0.17.1 EDIT: I didn't notice you mix different files with different subtitles...
With If you feel something is wrong, please focus on one example and describe what should be expected behavior. |
Fine… let's first focus on this clearly broken behaviour: Subtitles with
Expected behaviour… visible for at least one of them… |
With blend-subtitles=yes it stretches/squashes PlayRes to source video, meaning regardless if PlayResX is 816 or 1080, the subtitle line would end up in the black bar area fully. (for different test you can place something in the middle of screen) They would be stretched differently, but still end up there. After that we crop this area, so the subtitle that was there are also removed.
As explained above they wouldn't be visible. Or at least the part of subtitle that is active will be cropped off, but not all. You can use I don't want to sound dismissive, but is works as it works and there is logic behind it. While maybe not intuitive, it kind works as "expected". Note that I care only about gpu-next in this tests, I have not testes gpu. Also for gpu-next the difference with |
Okay, I think I understand now. Though even if technically it's "expected", I don't think it makes much Nobody will do that and one group will just end up with broken subs. |
To the best of my knowledge, Haali Media Splitter is the only thing that has supported Matroska container-level crop until it was added to mpv. As such, any files that use Matroska crop and were created before mpv introduced support expect the same behaviour that Haali exhibited (unless they expect it to be ignored completely, of course). The standard for subtitles in the same era was DirectVobSub (VSFilter loaded as a DirectShow filter). Here’s what the attached sample files look like with Haali + DirectVobSub. The report doesn’t explain which screenshots use which ASS track, so here are all of them for good measure. NB about LayoutResThe version of DirectVobSub I used in this test is older than the The cropping happens in Haali1 and DirectVobSub gets the video already cropped (which I’ve confirmed from DirectShow pin info). This is what mpv should emulate in my opinion. This also makes the most intuitive sense to me. I feel container-level cropping is a tool that pretends to hard-crop a video stream as if it is re-encoded without actually re-encoding it in order to avoid quality loss, size blow-up, codec change etc. As such, a container-cropped video stream should for all intents and purposes be treated the same as a hard-cropped video stream, including for subtitle display. This is a tool an author uses to get a video stream to design their subtitles for, not a tool someone uses to chop up an already-subtitled video. By the way, note how Haali 1080p-crop is entirely green, whereas the mpv screenshots have black bars. If these screenshots are true, mpv is in the wrong here. The cropped sample files declares Matroska
The spec notes reassert this:
(This also matches my own interpretation that the stream is meant to be treated as hard-cropped.) So the video is first to be cropped to 1920×816, and then this area is to be rescaled for display back to 1920×1080. If the Thus, if we drop the most likely unintended Footnotes
|
Actually, the aspect ratio of the text does. With proper LayoutRes support, the width of the subtitles should stay the same regardless of the (vertical) video cropping. In my screenshots, the text is narrowest in 1080-crop, wider in 1080-crophalf and widest in 1080p-native. With LayoutRes, the 816p ASS should always look as wide as the 1080p-crop pic and the 1080p ASS as wide as the 1080p-native pic. |
I agree, but we are past that point. Adding video-crop and subsequently container crop was not intended to break existing subtitles. And existing subtitles doesn't expect cropping. Nobody is using Haali anymore and to preserve compatibility with current subtitles and tooling the current behavior of crop exists which does not affect subtitles in practice. Well depending on settings. I agree though it is good approach to draw subtitles on cropped plane, but in practice this means that I have to add compat option. Doable, but this is more disruptive than current approach. That's why I opted to do that, until someone complains that want to change to, and now we can do this change. Also note the subtitles made for cropped video would not work if cropping is not applied, so they would essentially work only in mpv (and haali) currently. Another way would be to tag subtitles what frame of reference they expect.
I reverted this because people were complaining 81102b0 (there is one condition missing there, but not important for this argument) but it is my fault for listening to people with wrong files. We are just small media player I cannot break everything just like that. I think I will have too add another compat option for that though. And just for the record I blame MKVToolNix for this. Muxing a file with options likes that
Which is not expected IMHO and maybe it is my fault for not understanding how to use MKVToolNix, but here we are and I'm trying to make the least amount of people mad. EDIT: Also if you consider PGS or VobSub they are mastered with video resolution in mind. So if you add crop to your file, to remove black bars, you have to also crop PGS/VobSub. I don't think ASS in fact should work differently. I think it was Haali + DirectVobSub limitation at the time, that crop were added by the decoder before subtitles were drawn. But this basically break all PGS subs. While of course we can preserve this behavior, I don't except you will find any files that actually are made for "Haali + DirectVobSub" combo, because they would work wrong with anything else. Anyway, we are here to discuss. I would like to establish some sane behavior in mpv, because I know this will be used as a point of reference for many. |
Important Information
Provide following Information:
video-crop
Reproduction steps/Actual behaviour
Download the example video files.
816p-native.mkv
- 1920x816 video1080p-crop.mkv
- 1920x816 video (cropped from 1920x1080 using Matroska PixelCrop properties)1080p-crophalf.mkv
- 1920x948 (cropped from 1920x1080 using Matroska PixelCrop properties)1080p-native.mkv
- 1920x1080 (no crop applied, can apply yourself withvideo-crop
, will behave the same)Inconsistent SRT font size
blend-subtitles=yes
816p-native.mkv
video1080p-crop.mkv
video, font size is smaller than816p-native.mkv
Cropped ASS text
blend-subtitles=yes
andsid=2
816p-native.mkv
video, text appears correctly1080p-crop.mkv
video, text is not visible1080p-crophalf.mkv
video, text is half cropped and not blended with videoExpected behaviour
Inconsistent SRT font size
816p-native.mkv
and1080p-crop.mkv
should have the same font size.Cropped ASS text
816p-native.mkv
,1080p-crop.mkv
should look the same.1080p-crop.mkv
withblend-subtitles=no
looks identically to816p-native.mkv
withblend-subtitles=yes
(not sure how
1080p-crophalf.mkv
should look like regardless of theblend-subtitles
)Log file
Zipped logs of all test runs
Sample files
(UPDATED)
Zipped example Matroska files
Contents of the 816p ASS subtitles muxed in
Contents of the 1080p ASS subtitles muxed in
Screenshots
Inconsistent SRT font size
816p-native.mkv
withblend-subtitles=yes
1080p-crop.mkv
withblend-subtitles=yes
Cropped ASS text
816p-native.mkv
withblend-subtitles=yes
1080p-crop.mkv
withblend-subtitles=yes
1080p-crophalf.mkv
withblend-subtitles=yes
816p-native.mkv
withblend-subtitles=no
1080p-crop.mkv
withblend-subtitles=no
1080p-crophalf.mkv
withblend-subtitles=no
The text was updated successfully, but these errors were encountered: