0

I have several videos that have video, AAC audio, some with an additional alternate content audio stream, and subtitles.

What I want to do is to copy EVERYTHING as-is while inserting a converted a:0 from AAC to AC3 into the a:0 position (so all existing audio streams are "bumped" down by one spot) and making the new a:0 the default audio stream. End result is the same video file but with one new additional audio stream. (AAC stream is kept, not replaced.)

I've tried this, but I think I'm doing something wrong because it seems to take a long time (compared to converting the audio and then merging it in separately).

ffmpeg -i "AAC.mkv" -map 0:v -c:v copy -c:a:0 ac3 -b:a:0 640k -map 0:a:0 -map 0:a -map 0:s? -c:s copy "AC3.mkv"

It does appear to work, but as I said, seems to take longer than it really should. So, am I just being impatient, or am I doing something wrong that is slowing it down?

2 Answers 2

1

I started to use ffmpeg just a few days ago, so I might be wrong but I think this method is slower because it reencodes both the original and the new audio since this code doesn't include "-c:a copy":

ffmpeg -i "AAC.mkv" -map 0:v -c:v copy -c:a:0 ac3 -b:a:0 640k -map 0:a:0 -map 0:a -map 0:s? -c:s copy "AC3.mkv"

While the other code contains "-c copy" which means that this one copies everything (including the original audio) and only reencodes the new audio via conversion and that's why it takes less time:

ffmpeg -i "AAC.mkv" -c copy -map 0:v -c:a:0 ac3 -b:a:0 640k -map 0:a:0 -map 0:a -map 0:s? -to 5:00 "AC3.mkv"
1
  • Pretty sure this is faster only because of the -to 5:00 part, which cuts out everything after 5 minutes...
    – Guillochon
    Commented Mar 12 at 21:37
0

After reviewing another Q/A about something similar, which I had viewed before and partially tried, I made another attempt with it and got a much faster result. Comments on why it works faster would be greatly appreciated.

ffmpeg -i "AAC.mkv" -c copy -map 0:v -c:a:0 ac3 -b:a:0 640k -map 0:a:0 -map 0:a -map 0:s? -to 5:00 "AC3.mkv"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .