Я знаю, что могу поменять местами аудио 0 и аудио 1, указав отдельные потоки, как это
ffmpeg -i input.mkv -map 0:v:0 -map 0:a:1 -map 0:a:0 -c copy output.mkv
Тем не менее, это только копирует два именованных потока в выходной файл (и у меня есть несколько видео, которые имеют больше) и без субтитров. Но если я включу инструкции для дополнительных аудиопотоков и субтитров, а их нет, команда завершится неудачно. Вот как я думал это должно быть написано
ffmpeg -i input.mkv -map 0 -c copy -c:a:1 copy -c:a:0 copy output.mkv
но это тоже не работает. Где здесь ошибка?
Приложение: Ниже приведен мой вывод консоли после попытки рекомендованного решения:
ffmpeg version git-2015-02-23-29bbc1b Copyright (c) 2000-2015 the FFmpeg develop
ers
built with gcc 4.9.2 (Rev4, Built by MSYS2 project)
configuration: --arch=x86 --disable-debug --disable-shared --disable-doc --dis
able-w32threads --enable-gpl --enable-version3 --enable-runtime-cpudetect --enab
le-avfilter --enable-bzlib --enable-zlib --enable-decklink --enable-librtmp --en
able-gnutls --enable-avisynth --enable-frei0r --enable-filter=frei0r --enable-li
bbluray --enable-libcaca --enable-libopenjpeg --enable-fontconfig --enable-libfr
eetype --enable-libass --enable-libgsm --enable-libilbc --enable-libmodplug --en
able-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-l
ibvo-amrwbenc --enable-libschroedinger --enable-libsoxr --enable-libtwolame --en
able-libspeex --enable-libtheora --enable-libutvideo --enable-libvorbis --enable
-libvo-aacenc --enable-libopus --enable-libvidstab --enable-libvpx --enable-libw
avpack --enable-libxavs --enable-libx264 --enable-libx265 --enable-libxvid --ena
ble-libzvbi --enable-nonfree --enable-libfaac --enable-libfdk-aac
libavutil 54. 19.100 / 54. 19.100
libavcodec 56. 25.101 / 56. 25.101
libavformat 56. 23.104 / 56. 23.104
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.100 / 5. 11.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, matroska,webm, from 'TestClip.mkv.mkv':
Metadata:
creation_time : 2017-06-18 01:22:02
ENCODER : Lavf56.23.104
Duration: 00:00:20.32, start: 0.000000, bitrate: 1108 kb/s
Stream #0:0: Video: hevc (Main), yuv420p(tv), 1280x720, SAR 1:1 DAR 16:9, 23
.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
Metadata:
BPS : 958029
BPS-eng : 958029
DURATION : 00:00:20.145000000
DURATION-eng : 00:00:20.145000000
NUMBER_OF_FRAMES: 482
NUMBER_OF_FRAMES-eng: 482
NUMBER_OF_BYTES : 2412437
NUMBER_OF_BYTES-eng: 2412437
_STATISTICS_WRITING_APP: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_DATE_UTC: 2017-06-18 01:22:02
_STATISTICS_WRITING_DATE_UTC-eng: 2017-06-18 01:22:02
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1: Audio: aac (HE-AACv2), 48000 Hz, stereo, fltp
Metadata:
BPS : 48003
BPS-eng : 48003
DURATION : 00:00:20.180000000
DURATION-eng : 00:00:20.180000000
NUMBER_OF_FRAMES: 473
NUMBER_OF_FRAMES-eng: 473
NUMBER_OF_BYTES : 121089
NUMBER_OF_BYTES-eng: 121089
_STATISTICS_WRITING_APP: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_DATE_UTC: 2017-06-18 01:22:02
_STATISTICS_WRITING_DATE_UTC-eng: 2017-06-18 01:22:02
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2: Audio: aac (HE-AACv2), 48000 Hz, stereo, fltp
Metadata:
BPS : 52409
BPS-eng : 52409
DURATION : 00:00:20.180000000
DURATION-eng : 00:00:20.180000000
NUMBER_OF_FRAMES: 473
NUMBER_OF_FRAMES-eng: 473
NUMBER_OF_BYTES : 132203
NUMBER_OF_BYTES-eng: 132203
_STATISTICS_WRITING_APP: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_DATE_UTC: 2017-06-18 01:22:02
_STATISTICS_WRITING_DATE_UTC-eng: 2017-06-18 01:22:02
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:3: Audio: aac (HE-AACv2), 48000 Hz, stereo, fltp
Metadata:
BPS : 52430
BPS-eng : 52430
DURATION : 00:00:20.180000000
DURATION-eng : 00:00:20.180000000
NUMBER_OF_FRAMES: 473
NUMBER_OF_FRAMES-eng: 473
NUMBER_OF_BYTES : 132256
NUMBER_OF_BYTES-eng: 132256
_STATISTICS_WRITING_APP: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_DATE_UTC: 2017-06-18 01:22:02
_STATISTICS_WRITING_DATE_UTC-eng: 2017-06-18 01:22:02
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:4(eng): Subtitle: subrip
Metadata:
title : English
LANGUAGE : eng
BPS : 47
BPS-eng : 47
DURATION : 00:00:01.668000000
DURATION-eng : 00:00:01.668000000
NUMBER_OF_FRAMES: 1
NUMBER_OF_FRAMES-eng: 1
NUMBER_OF_BYTES : 10
NUMBER_OF_BYTES-eng: 10
_STATISTICS_WRITING_APP: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_DATE_UTC: 2017-06-18 01:22:02
_STATISTICS_WRITING_DATE_UTC-eng: 2017-06-18 01:22:02
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:5(fre): Subtitle: subrip
Metadata:
title : English
LANGUAGE : fre
BPS : 47
BPS-eng : 47
DURATION : 00:00:01.668000000
DURATION-eng : 00:00:01.668000000
NUMBER_OF_FRAMES: 1
NUMBER_OF_FRAMES-eng: 1
NUMBER_OF_BYTES : 10
NUMBER_OF_BYTES-eng: 10
_STATISTICS_WRITING_APP: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_DATE_UTC: 2017-06-18 01:22:02
_STATISTICS_WRITING_DATE_UTC-eng: 2017-06-18 01:22:02
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:6(ita): Subtitle: subrip
Metadata:
title : English
LANGUAGE : ita
BPS : 47
BPS-eng : 47
DURATION : 00:00:01.668000000
DURATION-eng : 00:00:01.668000000
NUMBER_OF_FRAMES: 1
NUMBER_OF_FRAMES-eng: 1
NUMBER_OF_BYTES : 10
NUMBER_OF_BYTES-eng: 10
_STATISTICS_WRITING_APP: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_DATE_UTC: 2017-06-18 01:22:02
_STATISTICS_WRITING_DATE_UTC-eng: 2017-06-18 01:22:02
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream map '0:a:3?' matches no streams.