-
Notifications
You must be signed in to change notification settings - Fork 15
Description
HandBrake removes IETF BCP-47 language tags from MKV files during encoding.
See related FFmpeg issue ticket for a similar problem.
See HandBrake forum post, I could not create a HandBrake GitHub issue.
See related HandBrake GUI issue
See Matroska IETF Draft Spec
See Languages in Matroska and MKVToolNix WiKi
See Matroska EBML LanguageIETF tag
Summary: When HandBrake creates MKV files from MKV files, the LanguageIETF tags from the original file is not written, and the language granularity is lost.
Create media file snippet: mkvmerge --split parts:00:00:00-00:01:00 --output MKV-IETF-Snippet.mkv MKV-IETF.mkv
MkvMerge: mkvmerge --identify MKV-IETF-Snippet.mkv --identification-format json
"language": "eng","language_ietf": "en""language": "spa","language_ietf": "es-ES""language": "srp","language_ietf": "sr-Latn-RS"
MediaInfo: mediainfo --Output=XML MKV-IETF-Snippet.mkv
<Language>en</Language><Language>es-ES</Language><Language>sr-Latn-RS</Language>
Encode using HandBrake: HandBrakeCLI --input MKV-IETF-Snippet.mkv --output MKV-IETF-Snippet-HandBrake.mkv --format av_mkv --encoder x264 --quality 22 --encoder-preset medium --all-audio --aencoder copy --audio-fallback ac3 --all-subtitles
Notice that some of the extended languages are not recognized in the console output:
[20:00:40] * subtitle track 1, English [UTF-8] (track 0, id 0x2, Text) -> Passthrough
[20:00:40] * subtitle track 2, English [UTF-8] (track 1, id 0x3, Text) -> Passthrough
[20:00:40] + name: SDH
[20:00:40] * subtitle track 3, ????????? [UTF-8] (track 2, id 0x4, Text) -> Passthrough
[20:00:40] * subtitle track 4, cestina [UTF-8] (track 3, id 0x5, Text) -> Passthrough
[20:00:40] * subtitle track 5, dansk [UTF-8] (track 4, id 0x6, Text) -> Passthrough
[20:00:40] * subtitle track 6, español [UTF-8] (track 5, id 0x7, Text) -> Passthrough
[20:00:40] + name: Spanish (Latin America)
[20:00:40] * subtitle track 7, español [UTF-8] (track 6, id 0x8, Text) -> Passthrough
[20:00:40] + name: Spanish (Latin America) (SDH)
[20:00:40] * subtitle track 8, español [UTF-8] (track 7, id 0x9, Text) -> Passthrough
[20:00:40] + name: Spanish (Spain)
[20:00:40] * subtitle track 9, suomi [UTF-8] (track 8, id 0xa, Text) -> Passthrough
[20:00:40] * subtitle track 10, hrvatski [UTF-8] (track 9, id 0xb, Text) -> Passthrough
[20:00:40] * subtitle track 11, magyar [UTF-8] (track 10, id 0xc, Text) -> Passthrough
[20:00:40] * subtitle track 12, ?????????? [UTF-8] (track 11, id 0xd, Text) -> Passthrough
[20:00:40] * subtitle track 13, Nederlands [UTF-8] (track 12, id 0xe, Text) -> Passthrough
[20:00:40] * subtitle track 14, norsk [UTF-8] (track 13, id 0xf, Text) -> Passthrough
[20:00:40] * subtitle track 15, polski [UTF-8] (track 14, id 0x10, Text) -> Passthrough
[20:00:40] * subtitle track 16, Portugues [UTF-8] (track 15, id 0x11, Text) -> Passthrough
[20:00:40] * subtitle track 17, româna [UTF-8] (track 16, id 0x12, Text) -> Passthrough
[20:00:40] * subtitle track 18, slovenscina [UTF-8] (track 17, id 0x13, Text) -> Passthrough
[20:00:40] * subtitle track 19, srpski [UTF-8] (track 18, id 0x14, Text) -> Passthrough
[20:00:40] * subtitle track 20, svenska [UTF-8] (track 19, id 0x15, Text) -> PassthroughMkvMerge --identify differences:
"language_ietf", ``: "en": Removed the IETF language tag"language_ietf", ``: "es-ES": Removed the IETF language tag"language_ietf", ``: "sr-Latn-RS": Removed the IETF language tag
Tested using master:
> ./HandBrakeCLI --version
[20:06:57] Compile-time hardening features are enabled
[20:06:57] qsv: is available on this system
Cannot load nvEncodeAPI64.dll
[20:06:57] vcn: not available on this system
[20:06:57] hb_init: starting libhb thread
[20:06:57] thread 1 started ("libhb")
HandBrake 20230329184118-13ae00bdf-master
HandBrake has exited.