Opened 13 months ago

Last modified 13 months ago

#10291 open enhancement

FFmpeg removes IETF BCP-47 language tags from MKV files during remuxing or encoding

Reported by: ptr727 Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mkv
Cc: Jérôme Martinez Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary:
When FFmpeg creates MKV files from MKV files, the LanguageIETF tags from the original file is not written, and the language granularity is lost.

For reference see:

Create media file snippet from MKV that contains IETF BCP-47 tags:

mkvmerge --split parts:00:00:00-00:01:00 --output MKV-IETF-Snippet.mkv MKV-IETF.mkv

Use MkvMerge to create a JSON file describing the MKV contents:

mkvmerge --identify MKV-IETF-Snippet.mkv --identification-format json

Note the presence of language and language_ietf tags in the file:

"language": "srp"
"language_ietf": "sr-Latn-RS"

Similar output can be produced using MediaInfo and FfProbe:

mediainfo --Output=XML MKV-IETF-Snippet.mkv
<Language>sr-Latn-RS</Language>
ffprobe -loglevel quiet -show_streams -show_format -print_format json MKV-IETF-Snippet.mkv
"language": "srp"

Note that FfProbe only uses the ISO693-3 tags, and ignores the IETF BCP-47 tags.

ReMux the file using FfMpeg

ffmpeg -i MKV-IETF-Snippet.mkv -map 0 -codec copy -f matroska MKV-IETF-Snippet-FfMpeg.mkv

Repeat the steps above to get the MKV tag information, and note that the IETF language tags have been stripped from the output file.

"language": "srp"

The "sr-Latn-RS" detailed language has been reduced the "srp", losing the regional specifics.

Observed behavior: ffmpeg strips IETF language tags from files.
Expected behavior: ffmpeg retains IETF tags (or all Matroska tags even if not interpreted) from the source file.
Nice to have behavior: FfProbe emits IETF language tags.

Attachments (1)

FfMpeg_IETF.zip (150.5 KB ) - added by ptr727 13 months ago.
JSON and XML and report LOG

Download all attachments as: .zip

Change History (3)

by ptr727, 13 months ago

Attachment: FfMpeg_IETF.zip added

JSON and XML and report LOG

comment:1 by Jérôme Martinez, 13 months ago

Cc: Jérôme Martinez added

comment:2 by James, 13 months ago

Component: ffmpegavformat
Status: newopen
Type: defectenhancement

There is no support for the LanguageBCP47 element in either muxer or demuxer, so this needs to be implemented.

Note: See TracTickets for help on using tickets.