Log in

View Full Version : Metadata Issues With MKV to MP4 using FFMpeg


Makaveli84
22nd June 2012, 11:32
Hello,
I use MKVToolNix for simple mkv container manipulations, muxing, demuxing, etc.. In MKVToolNix, when muxing, i usually set a language and a title for the video and audio tracks.

Now i'm trying to batch convert a bunch of mkv files to mp4 container without reencoding. The mkvs mostly consist of h264 video and aac audio, though i don't think that changes anything in what i'm trying to do. To do that, i'm using ffmpeg with the following command lines:

ffmpeg -i in.mkv -acodec copy -vcodec copy out.mp4 (for videos having 1 single video stream + 1 single audio stream)

and

ffmpeg -i in.mkv -map 0:0 -vcodec copy -map 0:1 -acodec copy -map 0:2 -acodec copy out.mp4 (for videos having 1 single video stream + 2 audio streams)

However, only the language "tags" or metadata are being transferred. For example, in MediaInfo, the mkvs have a "title: bla bla" entry, whilst the mp4s don't. I've been reading about -metadata, -map_metadata and metadata_specifier for stream tagging in ffmpeg, but can't seem to figure out how to achieve what i want.

So my 2 questions are:

1) How can i automatically transfer the "title" data from mkvs to mp4s (it probably has to do with -map_metadata in ffmpeg)?

2) At least, how can i set "title" metadata for individual streams using ffmpeg (regardless of the values present in the mkv files, meaning how to set new values, regardless of the batch conversion i'm trying to do)??

Makaveli84
29th June 2012, 18:15
Still haven't figured this out on my own.
Just to clear things out, i'm asking how to set individual track names in output files in ffmpeg.
Then, after that's done, maybe a way i can automatically transfer track names and languages from input to output files in ffmpeg.

Somebody??

Nemesis7
30th September 2013, 23:29
This is the exact same problem I'm facing now, did you manage to solve it?

Reino
2nd October 2013, 21:05
I may be wrong, but I've got a hunch the MP4-container doesn't support stream titles.
ffmpeg.exe -i in.mkv -c copy out.mp4...copies file-title and language-tag, but NOT stream-title (although ffmpeg tells you otherwise). MediaInfo and MPC-HC(LAV) don't show you any stream-titles. Not even when specifying manually:
ffmpeg.exe -i in.mkv -c copy -metadata:s:0 title="video stream" -metadata:s:1 title="audio stream" out.mp4

Nemesis7
24th January 2014, 01:09
However mp4tags or Subler can set the title for an mp4 file...