Fetts
Fetts

Reputation: 21

ffmpeg convert MKV to MP4 while keeping Audio and Subtitle titles

I am using ffmpeg to batch convert a bunch of MKV videos to MP4 videos. The code I use for this is:

for %%a in ("*.*") do ffmpeg -i "%%a" -codec copy -map 0 "newfiles\%%~na.mp4"

However, I cannot figure out how to keep the title for each audio track. For example, here is what I see when converting one of my videos:

Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp
    Metadata:
      title           : Director Commentary

 Stream #0:3(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp
    Metadata:
      title           : Production Commentary

While these tracks appear in the converted MP4 file, the titles "Director Commentary" and "Production Commentary" are not kept. I've tried using different variations of map_metadata, but it doesn't seem to work.

Any thoughts would be appreciated.

Upvotes: 1

Views: 1586

Answers (1)

Fetts
Fetts

Reputation: 21

I figured it out. MP4 does not use "title" when describing the name of audio or subtitle tracks. Apparently it uses "handler".

Upvotes: 1

Related Questions