Skip to content
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

Embedded subtitle detected but not displayed #446

Open
rmtjokar opened this issue Dec 18, 2024 · 3 comments
Open

Embedded subtitle detected but not displayed #446

rmtjokar opened this issue Dec 18, 2024 · 3 comments

Comments

@rmtjokar
Copy link

Hi,
It seems that FFmpegInteropX can detect subtitles in this file, but selecting one does not display anything.

https://1drv.ms/u/c/4fffd835406c45f6/EZp0KGHrPb5PoW5hII3fbTYBNJLUjjjvF96DYssZ3E6V0Q?e=8VN9iQ

File info (truncated):

E:\ffmpeg\SubtitleSamples\starwarssub2.vob
General
Complete name                  : E:\ffmpeg\SubtitleSamples\starwarssub2.vob
Format                         : MPEG-PS
File size                      : 36.1 MiB
Duration                       : 38 s 200 ms
Overall bit rate mode          : Variable
Overall bit rate               : 7 935 kb/s
Frame rate                     : 25.000 FPS
Conformance errors             : 1
 General compliance            : Element size 2025 is more than maximal permitted size 1935 (offset 0x2421817)

Video
ID                             : 224 (0xE0)
Format                         : MPEG Video
Format version                 : Version 2
Format profile                 : Main@Main
Format settings                : CustomMatrix / BVOP
Format settings, BVOP          : Yes
Format settings, Matrix        : Custom
Format settings, GOP           : M=3, N=12
Duration                       : 38 s 200 ms
Bit rate mode                  : Variable
Bit rate                       : 6 689 kb/s
Maximum bit rate               : 9 800 kb/s
Width                          : 720 pixels
Height                         : 576 pixels
Display aspect ratio           : 16:9
Frame rate                     : 25.000 FPS
Standard                       : Component
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 8 bits
Scan type                      : Progressive
Scan order                     : Top Field First
Compression mode               : Lossy
Bits/(Pixel*Frame)             : 0.645
Time code of first frame       : 01:50:31:01
Time code source               : Group of pictures header
GOP, Open/Closed               : Open
GOP, Open/Closed of first fram : Closed
Stream size                    : 30.5 MiB (84%)
Color primaries                : BT.601 PAL
Transfer characteristics       : BT.470 System B/G
Matrix coefficients            : BT.470 System B/G

Audio #1
ID                             : 189 (0xBD)-128 (0x80)
Format                         : AC-3
Format/Info                    : Audio Coding 3
Commercial name                : Dolby Digital
Muxing mode                    : DVD-Video
Duration                       : 38 s 112 ms
Bit rate mode                  : Constant
Bit rate                       : 448 kb/s
Channel(s)                     : 6 channels
Channel layout                 : L R C LFE Ls Rs
Sampling rate                  : 48.0 kHz
Frame rate                     : 31.250 FPS (1536 SPF)
Compression mode               : Lossy
Delay relative to video        : -232 ms
Stream size                    : 2.04 MiB (6%)
Service kind                   : Complete Main
Dialog Normalization           : -27 dB
compr                          : -0.86 dB
cmixlev                        : -3.0 dB
surmixlev                      : -3 dB
dialnorm_Average               : -27 dB
dialnorm_Minimum               : -27 dB
dialnorm_Maximum               : -27 dB

Text #1
ID                             : 189 (0xBD)-32 (0x20)
Format                         : RLE
Format/Info                    : Run-length encoding
Muxing mode                    : DVD-Video
Duration                       : 35 s 176 ms
Delay relative to video        : 1 s 40 ms

Text #2
ID                             : 189 (0xBD)-33 (0x21)
Format                         : RLE
Format/Info                    : Run-length encoding
Muxing mode                    : DVD-Video
Duration                       : 35 s 176 ms
Delay relative to video        : 1 s 40 ms

Text #3
ID                             : 189 (0xBD)-34 (0x22)
Format                         : RLE
Format/Info                    : Run-length encoding
Muxing mode                    : DVD-Video
Duration                       : 35 s 176 ms
Delay relative to video        : 1 s 40 ms

Text #4
ID                             : 189 (0xBD)-35 (0x23)
Format                         : RLE
Format/Info                    : Run-length encoding
Muxing mode                    : DVD-Video
Duration                       : 35 s 176 ms
Delay relative to video        : 1 s 40 ms

PotPlayer, however, shows the subtitles correctly:
image

Thanks in advance

@lukasf
Copy link
Member

lukasf commented Dec 18, 2024

Interesting case. The subs are detected and codec open works, but we do not get any size info, which is why we do not render them. I created a PR #447 to optimistically assume subtitle size == video size. Then at least, the subs do appear. Not sure if it is such a good idea though.

And looking at your screenshots, I just noticed that our colors are wrong as well, after applying the PR. They have black text and grey outline. That's the color info we get from ffmpeg, not much we can do about it.

To me this looks like some pretty broken mux. I don't know much about PotPlayer internals, but many players use their own stream parsing and only do the decoding with ffmpeg. That could explain why PotPlayer displays the subtitles fine, maybe it's just more fault tolerant.

@brabebhin
Copy link
Collaborator

The colors I think is something potplayer does, looks like some kind of accent color.
VLC displays gray with black outline. Still different than ours though.

@rmtjokar
Copy link
Author

Thanks, it worked perfectly.
They change the color palette for image subtitles by replacing every pixel. When I checked SubtitleEdit around 4–5 years ago, I discovered that you could replace one color with another while reading it.

This how SubtitleEdit handles it as well:

https://github.com/SubtitleEdit/subtitleedit/blob/966ab93bc23e4de00237e8c63a2ec49076ad22a7/src/libse/VobSub/SubPicture.cs#L70

I've been using PotPlayer for over a decade, and for me, it's way better than KMPlayer or even VLC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants