[FFmpeg-user] Adding audio track to MP4 seems to override the video stream

Cyle Hunter cylehunter at tactica.ca
Wed Jan 10 08:37:19 EET 2018


Hello,

I’m trying to add an audio track to an existing MP4 video. It seems when I add the new audio stream the video stream gets corrupted. Here’s the command that I’m running:

ffmpeg -y -I video.mp4 -i music.aac  -c copy -map 0:v:0 -map 1:a:0 video.mp4

I’m using the 3.4.1 release of ffmpeg available here: https://www.johnvansickle.com/ffmpeg/, interestingly I tested this command on my local machine with the same version and I didn’t have this issue.

Here’s the output.

ffmpeg version 3.4.1-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.4.0 (Debian 6.4.0-10) 20171112
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘video.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.83.100
Duration: 00:00:46.00, start: 0.000000, bitrate: 30182 kb/s
Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 30181 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
[aac @ 0x49321a0] Estimating duration from bitrate, this may be inaccurate
Input #1, aac, from ‘music.aac':
Duration: 00:00:48.88, bitrate: 136 kb/s
Stream #1:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 136 kb/s
Output #0, mp4, to ‘video.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.83.100
Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 30181 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 136 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1 fps=0.0 q=-1.0 Lsize= 1652kB time=00:00:51.08 bitrate= 264.9kbits/s speed=1.24e+03x 
video:841kB audio:816kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

I would appreciate if anybody has any idea what the issue might be or how I could go about diagnosing this further.


More information about the ffmpeg-user mailing list