我有3个文件:video.mp4,audionl.mp4& audioeng.mp4。 我尝试将它们一起添加到1个output.mp4文件中,如下所示:
ffmpeg -y -i video.mp4 -i audionl.mp4 -i audioeng.mp4 -map 0:v -map 1:a -map 2:a -metadata:s:a:0 language=nl -metadata:s:a:0 title="NL" -metadata:s:a:1 language=eng -metadata:s:a:1 title="ENG" -acodec copy -bsf:a aac_adtstoasc -vcodec copy -movflags faststart output.mp4 2>&1
这是我从ffmpeg看到的输出:
ffmpeg version 2.6.9 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.9.2 (Debian 4.9.2-10)
configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libpulse --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2 --enable-libvidstab --enable-libzvbi --enable-avresample --disable-htmlpages --disable-podpages --enable-libutvideo --enable-libfdk-aac --enable-libx265 --enable-libiec61883 --enable-vaapi --enable-libdc1394 --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: isomavc1mp42dash
creation_time : 2017-06-04 06:35:06
Duration: 00:20:52.80, start: 0.000000, bitrate: 1172 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 1168 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
Metadata:
creation_time : 2017-06-04 06:35:06
handler_name : VideoHandler
encoder : VideoHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'audionl.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: isomM4A mp42dash
creation_time : 2017-06-04 06:35:06
Duration: 00:20:52.80, start: 0.000000, bitrate: 96 kb/s
Stream #1:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 93 kb/s (default)
Metadata:
creation_time : 2017-06-04 06:35:06
handler_name : SoundHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'audioeng.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: isomM4A mp42dash
creation_time : 2017-06-04 06:35:06
Duration: 00:20:52.78, start: 0.000000, bitrate: 64 kb/s
Stream #2:0(eng): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 62 kb/s (default)
Metadata:
creation_time : 2017-06-04 06:35:06
handler_name : SoundHandler
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: isomavc1mp42dash
encoder : Lavf56.25.101
Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 1168 kb/s, 25 fps, 25 tbr, 90k tbn, 90k tbc (default)
Metadata:
creation_time : 2017-06-04 06:35:06
handler_name : VideoHandler
encoder : VideoHandler
Stream #0:1(nl): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 93 kb/s (default)
Metadata:
creation_time : 2017-06-04 06:35:06
handler_name : SoundHandler
title : NL
Stream #0:2(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 62 kb/s (default)
Metadata:
creation_time : 2017-06-04 06:35:06
handler_name : SoundHandler
title : ENG
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Stream #2:0 -> #0:2 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0xbb1320] Starting second pass: moving the moov atom to the beginning of the file
frame=31320 fps=20993 q=-1.0 Lsize= 204217kB time=00:20:52.79 bitrate=1335.4kbits/s
video:178734kB audio:23867kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.797284%
正如你在那里看到的那样:“Stream#0:0(eng)”,“Stream#0:1(nl)”& “Stream#0:2(eng)”。 所以看起来很好。
但是当我在VLC中打开它时,我会在Audio track下看到: NL - [英文] ENG - [英文]
所以我回去用“ffmpeg -i output.mp4”检查ffmpeg:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.25.101
Duration: 00:20:52.80, start: 0.000000, bitrate: 1335 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 1168 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 93 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2(eng): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 62 kb/s (default)
Metadata:
handler_name : SoundHandler
这里他们又是英国人......
之后我尝试了这个:
ffmpeg -y -i audionl.mp4 -c:a copy -metadata:s:a:0 language=nl output.mp4
但也无法在输出文件中设置正确的语言... 我在这里不知所措,希望有人能帮我正确设置这些语言。
非常感谢!
答案 0 :(得分:11)