1

I have a video with 4 language audio tracks that works nicely within the QuickTime player for 3 of the 4 audio tracks. I think the 4th audio track is encoded differently because the FFmpeg listing showed:

Metadata:
 encoder : Lavc61.3.100 aac

For the 3 audio tracks when the video was made and:

Metadata:
 encoder : LAME3.100

When the additional audio track was added. I've found posts on how to re-encode audio on video with only one audio track, but not on how to re-encode just one audio track in a video containing multiple audio tracks.

I also tried using .m4a and .ac3 audio files instead of .mp3 when making the above videos, but it did not help.

For more details, see a recent post which showed me how to add an additional audio track to a video containing 3 audio tracks. As I explained there, it kinda worked but I was still not able to see the added audio track in the QuickTime player; that's my goal, and I think the above encoding difference is the source of the problem.

Edit: Solved by @Gyan after adding -c:a:3 aac as follows

ffmpeg -i 3.mp4 -i eng.mp3 -i eng.srt -map 0:v -map 0:a -map 1 -map 0:s -map 2 -c copy -c:a:3 aac -c:s:3 mov_text -metadata:s:a:3 language=eng -metadata:s:s:3 language=eng -shortest 3plus1.mp4

media file listing requested by @Gyan

ffmpeg -i 3.mp4 -i eng.mp3 -i eng.srt -map 0:v -map 0:a -map 1 -map 0:s -map 2 -c copy -c:s:3 mov_text -metadata:s:a:3 language=eng -metadata:s:s:3 language=eng -shortest 3plus1.mp4
Output #0, mp4, to '3plus1.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf61.1.100
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 8 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 encoder : Lavc61.3.100 libx264
 Stream #0:1(ita): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
 Stream #0:2(fra): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
 Stream #0:3(ger): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
 Stream #0:4(eng): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 75 kb/s
 Metadata:
 encoder : LAME3.100
 Stream #0:5(ita): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
 Metadata:
 handler_name : SubtitleHandler
 Stream #0:6(fra): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
 Metadata:
 handler_name : SubtitleHandler
 Stream #0:7(ger): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
 Metadata:
 handler_name : SubtitleHandler
 Stream #0:8(eng): Subtitle: mov_text (tx3g / 0x67337874)
 Metadata:
 encoder : Lavc61.3.100 mov_text
ffmpeg -f lavfi -i "color=color=black:s=1280x720" \
-i ita.mp3 -i fre.mp3 -i ger.mp3 \
-i ita.srt -i fre.srt -i ger.srt \
-map 0:v -map 1:a:0 -map 2:a:0 -map 3:a:0 \
-map 4:s:0 -map 5:s:0 -map 6:s:0 \
-metadata:s:a:0 language=ita -metadata:s:a:1 language=fra -metadata:s:a:2 language=ger \
-metadata:s:s:0 language=ita -metadata:s:s:1 language=fra -metadata:s:s:2 language=ger \
-c:s:0 mov_text -c:s:1 mov_text -c:s:2 mov_text \
-shortest 3.mp4
Output #0, mp4, to '3.mp4':
 Metadata:
 encoder : Lavf61.1.100
 Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 12800 tbn
 Metadata:
 encoder : Lavc61.3.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
 Stream #0:1(ita): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s (default)
 Metadata:
 encoder : Lavc61.3.100 aac
 Stream #0:2(fra): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s
 Metadata:
 encoder : Lavc61.3.100 aac
 Stream #0:3(ger): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s
 Metadata:
 encoder : Lavc61.3.100 aac
 Stream #0:4(ita): Subtitle: mov_text (tx3g / 0x67337874) (default)
 Metadata:
 encoder : Lavc61.3.100 mov_text
 Stream #0:5(fra): Subtitle: mov_text (tx3g / 0x67337874)
 Metadata:
 encoder : Lavc61.3.100 mov_text
 Stream #0:6(ger): Subtitle: mov_text (tx3g / 0x67337874)
 Metadata:
 encoder : Lavc61.3.100 mov_text
asked Apr 23 at 10:02
8
  • Try : ffmpeg -i 3.mp4 -i eng.mp3 -i eng.srt -map 0:v -map 0:a -map 1 -map 0:s -map 2 -c copy -c:a:3 libmp3lame -c:s:3 mov_text -metadata:s:a:3 language=eng -metadata:s:s:3 language=eng -shortest 3plus1.mp4 Commented Apr 23 at 12:25
  • @Alain1A45 the result is the same: the additional (english) audio does not appear in the QT player. However, I notice that the encoder that is listed by ffmpeg is different now. It now shows as "encoder : Lavc61.3.100 libmp3lame" -- I also tried using .m4a and .ac3 when making both 3.mp4 and 3plus1.mp4 -- nothing seems to work. From what I've read the QT player is very difficult for things like this -- thanks again. Commented Apr 23 at 15:39
  • If you want, you can also try to put the English tracks first in the output file : ffmpeg -i 3.mp4 -i eng.mp3 -i eng.srt -map 0:v -map 1 -map 0:a -map 2 -map 0:s -c copy -c:s:0 mov_text -metadata:s:a:0 language=eng -metadata:s:s:0 language=eng -shortest 3plus1.mp4 Commented Apr 23 at 17:21
  • that didn't work either -- but at least through all these examples I'm understanding ffmpeg a little more... Commented Apr 23 at 17:34
  • 1
    3plus1.mp4 shows the reverse: the first 3 tracks are aac whereas the new one is mp3. Add -c:a:3 aac when generating 3plus1 and check. Commented Apr 24 at 5:10

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.