buffyangel108
21st March 2016, 03:40
I'm probably missing something simple, but here goes!
I have hundreds of .MKV files with the following streams:
- video
- audio 1 (DTS)
- audio 2 (AAC)
- subtitle 1
- subtitle 2
I'm trying to replace the DTS track in each of these with a newly created AC3 (which I've mastered in another program) using FFMPEG to mux. So the new file looks like:
- video
- audio 1 (new AC3)
- audio 2 (AAC)
- subtitle 1
- subtitle 2
How do I correctly map the metadata from the original file to the new one? If I use -map_metadata 0, the video, subtitle and audio 2 tracks have the correct metadata in the new file but the metadata from the original audio 1 (DTS) isn't copied over to the new audio 1 (AC3). But if I manually map the metadata from the original audio 1 to the new audio 1, the metadata from the other tracks isn't carried across. I can't find a way to combine the two - if that makes sense!
I would just do a manual -map_metadata for each stream, but I'm looking to do this in a batch file and some of the .mkvs have less than 2 subtitle streams (and FFMPEG balks if I try to map metadata to a stream that doesn't exist).
Any ideas?
I have hundreds of .MKV files with the following streams:
- video
- audio 1 (DTS)
- audio 2 (AAC)
- subtitle 1
- subtitle 2
I'm trying to replace the DTS track in each of these with a newly created AC3 (which I've mastered in another program) using FFMPEG to mux. So the new file looks like:
- video
- audio 1 (new AC3)
- audio 2 (AAC)
- subtitle 1
- subtitle 2
How do I correctly map the metadata from the original file to the new one? If I use -map_metadata 0, the video, subtitle and audio 2 tracks have the correct metadata in the new file but the metadata from the original audio 1 (DTS) isn't copied over to the new audio 1 (AC3). But if I manually map the metadata from the original audio 1 to the new audio 1, the metadata from the other tracks isn't carried across. I can't find a way to combine the two - if that makes sense!
I would just do a manual -map_metadata for each stream, but I'm looking to do this in a batch file and some of the .mkvs have less than 2 subtitle streams (and FFMPEG balks if I try to map metadata to a stream that doesn't exist).
Any ideas?