Skip to content

show languages on statusbar#627

Merged
clsid2 merged 8 commits into
clsid2:developfrom
adipose:patch152
Sep 20, 2020
Merged

show languages on statusbar#627
clsid2 merged 8 commits into
clsid2:developfrom
adipose:patch152

Conversation

@adipose

@adipose adipose commented Sep 19, 2020

Copy link
Copy Markdown

No description provided.

@clsid2

clsid2 commented Sep 20, 2020

Copy link
Copy Markdown
Owner

When track language is unknown it incorrectly shows the locale language. It also shows squares (invalid char) for the two unicode chars here.

@lifegpc

lifegpc commented Sep 20, 2020

Copy link
Copy Markdown

It seems it only works for internal track.

@clsid2

clsid2 commented Sep 20, 2020

Copy link
Copy Markdown
Owner

I fixed it by checking if lcid is null.

@clsid2

clsid2 commented Sep 20, 2020

Copy link
Copy Markdown
Owner

Yes, it also seems to fail for external subs.

@lifegpc

lifegpc commented Sep 20, 2020

Copy link
Copy Markdown

Do not display subtitle on statusbar may become better in this situation.
image

@clsid2

clsid2 commented Sep 20, 2020

Copy link
Copy Markdown
Owner

Another bug: it only updates the audio language when creating the menu, not when changing the selection in the menu

@clsid2

clsid2 commented Sep 20, 2020

Copy link
Copy Markdown
Owner

External sub can signal language in filename: movie.eng.srt
Maybe store sub lang when generating the sub menu?

@clsid2

clsid2 commented Sep 20, 2020

Copy link
Copy Markdown
Owner

Good sample to test the audio menu issue:
https://www.sendspace.com/file/vwxuh2

@adipose

adipose commented Sep 20, 2020

Copy link
Copy Markdown
Author

Another bug: it only updates the audio language when creating the menu, not when changing the selection in the menu

should be fixed

Yes, it also seems to fail for external subs.

Will look into that

@adipose

adipose commented Sep 20, 2020

Copy link
Copy Markdown
Author

It seems GetStreamInfo() doesn't get the lcid without passing the pName as well, should be fixed.

@lifegpc

lifegpc commented Sep 21, 2020

Copy link
Copy Markdown

It seems has bug when deal with internal subtitle.
Try this video, external subtitles can be find here.
The internal subtitle:
image
The external subtitle:
image

@lifegpc

lifegpc commented Sep 21, 2020

Copy link
Copy Markdown

Chinese have many variants, such as zh_cn, zh_tw, zh_hk, zh_hans, zh_hant etc. It seems mpc-hc identify them all as zh_hans. This is another problem.

@adipose

adipose commented Sep 21, 2020

Copy link
Copy Markdown
Author

Maybe, but I misread your other statement, it was talking about internal (which I had thought before was working, but in this case it wasn't).

@lifegpc

lifegpc commented Sep 21, 2020

Copy link
Copy Markdown

Yea. It also only display zh- on OSD. It seems missing the variant of a language.

@adipose

adipose commented Sep 21, 2020

Copy link
Copy Markdown
Author

LAVFilters did not get an LCID at all. The name gets [zh-] only.

@adipose

adipose commented Sep 22, 2020

Copy link
Copy Markdown
Author

I'm not sure it's mpc-hc's fault. VLC only identifies the tracks as "Chinese":

image

@lifegpc

lifegpc commented Sep 22, 2020

Copy link
Copy Markdown

So vlc has same bugs.
zh_cn Chinese(China)
zh_hans Simplified Chinese
zh_tw Chinese(Taiwan)
zh_hk Chinese(HongKong)
zh_hant Traditional Chinese

@adipose

adipose commented Sep 22, 2020

Copy link
Copy Markdown
Author

How do you know it's a bug?

@adipose

adipose commented Sep 22, 2020

Copy link
Copy Markdown
Author

This is what I could extract using mkvinfo:

| + Track
| + Track number: 3 (track ID for mkvmerge & mkvextract: 2)
| + Track UID: 3
| + Lacing flag: 0
| + Name: 中文(简体)
| + Language: zh-Hans
| + Default track flag: 0
| + Codec ID: S_TEXT/ASS
| + Track type: subtitles
| + Codec's private data: size 853
| + Track
| + Track number: 4 (track ID for mkvmerge & mkvextract: 3)
| + Track UID: 4
| + Lacing flag: 0
| + Name: 中文(中国)
| + Language: zh-CN
| + Default track flag: 0
| + Codec ID: S_TEXT/ASS
| + Track type: subtitles
| + Codec's private data: size 851

Looks like it knows more about the languages than mpc-hc

@lifegpc

lifegpc commented Sep 22, 2020

Copy link
Copy Markdown

Maybe MPC-HC should just display Chinese but not Chinese(Simplified).

@adipose

adipose commented Sep 22, 2020

Copy link
Copy Markdown
Author

Looks like it's a bug in MatroskaParser. It's quite an old source and can only read 3 characters of the lang, hence the zh- that shows up.

@adipose

adipose commented Sep 22, 2020

Copy link
Copy Markdown
Author

I do think matroskaparser is pulling too little data, as the matroska spec allows for a 639-2 code plus a dash and country code. But this mkv is actually not following spec. The "Language" tag cannot have a bcp47 code, yet that's exactly what zh-Hans is. And mkvtoolnix does not recognize it but changes it to zh.

If you want to use bcp47 you have to use languageietf. Once I've done that, the mkv actually shows ZHO, and chose "chi" in the menu. I'm not sure how it did that, as matroskaparser doesn't even understand languageietf--maybe it defaulted to something else.

So, mpc-hc doesn't parse the whole tag, but it's not a valid tag anyway. If it were a valid tag, it probably would work better. But to get zh-hans you would need ietf tag, which mpc-hc doesn't support.

@adipose

adipose commented Sep 24, 2020

Copy link
Copy Markdown
Author

Some related PRs:

clsid2/FFmpeg#1
clsid2/LAVFilters#2

After these changes and updating your MKV to have the same tags, but in a valid field (LanguageIETF), we get the following:

image

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants