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

show languages on statusbar #627

Merged
merged 8 commits into from
Sep 20, 2020
Merged

show languages on statusbar #627

merged 8 commits into from
Sep 20, 2020

Conversation

adipose
Copy link

@adipose adipose commented Sep 19, 2020

No description provided.

@clsid2
Copy link
Owner

clsid2 commented Sep 20, 2020

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

@lifegpc
Copy link

lifegpc commented Sep 20, 2020

It seems it only works for internal track.

@clsid2
Copy link
Owner

clsid2 commented Sep 20, 2020

I fixed it by checking if lcid is null.

@clsid2
Copy link
Owner

clsid2 commented Sep 20, 2020

Yes, it also seems to fail for external subs.

@lifegpc
Copy link

lifegpc commented Sep 20, 2020

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

@clsid2
Copy link
Owner

clsid2 commented Sep 20, 2020

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

@clsid2
Copy link
Owner

clsid2 commented Sep 20, 2020

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

@clsid2
Copy link
Owner

clsid2 commented Sep 20, 2020

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

@adipose
Copy link
Author

adipose commented Sep 20, 2020

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
Copy link
Author

adipose commented Sep 20, 2020

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

@lifegpc
Copy link

lifegpc commented Sep 21, 2020

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
Copy link

lifegpc commented Sep 21, 2020

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
Copy link
Author

adipose commented Sep 21, 2020

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
Copy link

lifegpc commented Sep 21, 2020

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

@adipose
Copy link
Author

adipose commented Sep 21, 2020

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

@adipose
Copy link
Author

adipose commented Sep 22, 2020

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

image

@lifegpc
Copy link

lifegpc commented Sep 22, 2020

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
Copy link
Author

adipose commented Sep 22, 2020

How do you know it's a bug?

@adipose
Copy link
Author

adipose commented Sep 22, 2020

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
Copy link

lifegpc commented Sep 22, 2020

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

@adipose
Copy link
Author

adipose commented Sep 22, 2020

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
Copy link
Author

adipose commented Sep 22, 2020

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
Copy link
Author

adipose commented Sep 24, 2020

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