![FFMpeg - 负向映射重复字幕轨道](https://linux22.com/image/1513414/FFMpeg%20-%20%E8%B4%9F%E5%90%91%E6%98%A0%E5%B0%84%E9%87%8D%E5%A4%8D%E5%AD%97%E5%B9%95%E8%BD%A8%E9%81%93.png)
我正在尝试使用以下命令从现有媒体项目中删除 DTS-HD 音轨:
ffmpeg.exe -i source.m4v -map 0 -map -0:a:1 -c copy output.m4v
ffprobe
原文如下:
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x800 [SAR 1:1 DAR 12:5], 4365 kb/s, 23.98 fps, 47.95 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2016-01-13 03:57:02
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)
Metadata:
creation_time : 2016-01-13 03:57:02
handler_name : Stereo
Stream #0:2(eng): Audio: dts (DTS-HD MA) (mp4a / 0x6134706D), 48000 Hz, 7.1, s32p (24 bit), max. 200 kb/s
Metadata:
creation_time : 2016-01-13 03:57:02
handler_name : Surround
Stream #0:3(eng): Subtitle: mov_text (text / 0x74786574)
Metadata:
creation_time : 2016-01-13 03:57:02
handler_name : SubtitleHandler
ffmpeg
以及上面运行的命令的结果的 ffprobe :
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x800 [SAR 1:1 DAR 12:5], 4365 kb/s, 23.98 fps, 47.95 tbr, 90k tbn, 180k tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574) (default)
Metadata:
handler_name : SubtitleHandler
Stream #0:3(eng): Subtitle: mov_text (text / 0x74786574)
Metadata:
handler_name : SubtitleHandler
如您所见,字幕轨道已复制,并设置为默认显示。有人能解释一下我该如何只删除 DTS-HD 轨道并保留其余所有内容吗?
ffmpeg
版本信息:
ffmpeg version N-79277-g0c90b2e Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 20.100 / 55. 20.100
libavcodec 57. 34.100 / 57. 34.100
libavformat 57. 32.100 / 57. 32.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 41.100 / 6. 41.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
尝试使用较新版本时ffmpeg
:
ffmpeg version N-82579-g28d8789 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-g
nutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-lib
mp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-l
ibsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-lib
x264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 40.100 / 55. 40.100
libavcodec 57. 66.106 / 57. 66.106
libavformat 57. 58.100 / 57. 58.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 67.100 / 6. 67.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.10
运行上述相同的命令时,我得到以下结果:
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x800 [SAR 1:1 DAR 12:5], 4365 kb/s,
23.98 fps,
47.95 tbr,
90k tbn,
180k tbc
(default)
Metadata:
creation_time : 2016-01-13T03:57:02.000000Z
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)
Metadata:
creation_time : 2016-01-13T03:57:02.000000Z
handler_name : Stereo
Stream #0:2(eng): Audio: dts (DTS-HD MA) (mp4a / 0x6134706D), 48000 Hz, 7.1, s32p (24 bit)
Metadata:
creation_time : 2016-01-13T03:57:02.000000Z
handler_name : Surround
Stream #0:3(eng): Data: bin_data (text / 0x74786574)
Metadata:
creation_time : 2016-01-13T03:57:02.000000Z
handler_name : SubtitleHandler
[ipod @ 000000000302fb20]
Tag text/0x74786574 incompatible with output codec id '100359' ([0][0][0][0])
Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input
Stream mapping:
Stream #0:0 -> #0:0
(copy)
Stream #0:1 -> #0:1 (copy)
Stream #0:3 -> #0:2 (copy)
Last message repeated 1 times
以下是最新命令的输出的 Pastebin:http://pastebin.com/K4TErxh8