1

Я хотел бы удалить аудио pt-br и конвертировать английский DTS в AC3, и я использую эту команду:

ffmpeg -i input.mkv -c:v copy -c:s copy -c:a ac3 -ac 2 -map 0:0 -map 0:2 -map 0:3 -aspect 16:9 test.mkv

ffmpeg version N-63968-g73d820e Copyright (c) 2000-2014 the FFmpeg developers
  built on Jun 15 2014 00:52:21 with gcc 4.8.3 (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-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  libavutil      52. 89.100 / 52. 89.100
  libavcodec     55. 66.101 / 55. 66.101
  libavformat    55. 43.100 / 55. 43.100
  libavdevice    55. 13.101 / 55. 13.101
  libavfilter     4.  8.100 /  4.  8.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[matroska,webm @ 0000000002c480c0] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, matroska,webm, from 'input.mkv':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.0
    creation_time   : 2013-09-16 21:13:05
  Duration: 01:22:52.47, start: 0.000000, bitrate: 9307 kb/s
    Chapter #0.0: start 0.000000, end 137.846000
    Metadata:
      title           : 00:00:00.000
    Chapter #0.1: start 137.846000, end 227.185000
    Metadata:
      title           : 00:02:17.846
    Chapter #0.2: start 227.185000, end 351.643000
    Metadata:
      title           : 00:03:47.185
    Chapter #0.3: start 351.643000, end 536.035000
    Metadata:
      title           : 00:05:51.643
    Chapter #0.4: start 536.035000, end 648.982000
    Metadata:
      title           : 00:08:56.035
    Chapter #0.5: start 648.982000, end 901.359000
    Metadata:
      title           : 00:10:48.982
    Chapter #0.6: start 901.359000, end 1144.685000
    Metadata:
      title           : 00:15:01.359
    Chapter #0.7: start 1144.685000, end 1338.462000
    Metadata:
      title           : 00:19:04.685
    Chapter #0.8: start 1338.462000, end 1515.723000
    Metadata:
      title           : 00:22:18.462
    Chapter #0.9: start 1515.723000, end 1746.244000
    Metadata:
      title           : 00:25:15.723
    Chapter #0.10: start 1746.244000, end 1976.057000
    Metadata:
      title           : 00:29:06.244
    Chapter #0.11: start 1976.057000, end 2061.476000
    Metadata:
      title           : 00:32:56.057
    Chapter #0.12: start 2061.476000, end 2329.160000
    Metadata:
      title           : 00:34:21.476
    Chapter #0.13: start 2329.160000, end 2400.690000
    Metadata:
      title           : 00:38:49.160
    Chapter #0.14: start 2400.690000, end 2498.413000
    Chapter #0.15: start 2498.413000, end 2742.615000
    Metadata:
      title           : 00:41:38.413
    Chapter #0.16: start 2742.615000, end 3057.054000
    Metadata:
      title           : 00:45:42.615
    Chapter #0.17: start 3057.054000, end 3142.556000
    Metadata:
      title           : 00:50:57.054
    Chapter #0.18: start 3142.556000, end 3441.772000
    Metadata:
      title           : 00:52:22.556
    Chapter #0.19: start 3441.772000, end 3575.947000
    Metadata:
      title           : 00:57:21.772
    Chapter #0.20: start 3575.947000, end 3749.204000
    Metadata:
      title           : 00:59:35.947
    Chapter #0.21: start 3749.204000, end 3945.650000
    Metadata:
      title           : 01:02:29.204
    Chapter #0.22: start 3945.650000, end 4204.742000
    Metadata:
      title           : 01:05:45.650
    Chapter #0.23: start 4204.742000, end 4368.739000
    Metadata:
      title           : 01:10:04.742
    Chapter #0.24: start 4368.739000, end 4533.154000
    Metadata:
      title           : 01:12:48.739
    Chapter #0.25: start 4533.154000, end 4699.403000
    Metadata:
      title           : 01:15:33.154
    Chapter #0.26: start 4699.403000, end 4972.468000
    Metadata:
      title           : 01:18:19.403
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      title           : input
      stereo_mode     : left_right
    Stream #0:1(por): Audio: ac3, 48000 Hz, 5.1(side), fltp, 256 kb/s
    Metadata:
      title           : PT-BR: CAPS
    Stream #0:2(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
    Metadata:
      title           : ENG
    Stream #0:3(por): Subtitle: hdmv_pgs_subtitle
    Metadata:
      title           : PT-BR
Overriding aspect ratio with stream copy may produce invalid files
Output #0, matroska, to 'test.mkv':
  Metadata:
    encoder         : Lavf55.43.100
    Chapter #0.0: start 0.000000, end 137.846000
    Metadata:
      title           : 00:00:00.000
    Chapter #0.1: start 137.846000, end 227.185000
    Metadata:
      title           : 00:02:17.846
    Chapter #0.2: start 227.185000, end 351.643000
    Metadata:
      title           : 00:03:47.185
    Chapter #0.3: start 351.643000, end 536.035000
    Chapter #0.4: start 536.035000, end 648.982000
    Metadata:
      title           : 00:08:56.035
    Chapter #0.5: start 648.982000, end 901.359000
    Metadata:
      title           : 00:10:48.982
    Chapter #0.6: start 901.359000, end 1144.685000
    Metadata:
      title           : 00:15:01.359
    Chapter #0.7: start 1144.685000, end 1338.462000
    Metadata:
      title           : 00:19:04.685
    Chapter #0.8: start 1338.462000, end 1515.723000
    Metadata:
      title           : 00:22:18.462
    Chapter #0.9: start 1515.723000, end 1746.244000
    Metadata:
      title           : 00:25:15.723
    Chapter #0.10: start 1746.244000, end 1976.057000
    Metadata:
      title           : 00:29:06.244
    Chapter #0.11: start 1976.057000, end 2061.476000
    Metadata:
      title           : 00:32:56.057
    Chapter #0.12: start 2061.476000, end 2329.160000
    Metadata:
      title           : 00:34:21.476
    Chapter #0.13: start 2329.160000, end 2400.690000
    Metadata:
      title           : 00:38:49.160
    Chapter #0.14: start 2400.690000, end 2498.413000
    Metadata:
      title           : 00:40:00.690
    Chapter #0.15: start 2498.413000, end 2742.615000
    Metadata:
      title           : 00:41:38.413
    Chapter #0.16: start 2742.615000, end 3057.054000
    Metadata:
      title           : 00:45:42.615
    Chapter #0.17: start 3057.054000, end 3142.556000
    Metadata:
      title           : 00:50:57.054
    Chapter #0.18: start 3142.556000, end 3441.772000
    Metadata:
      title           : 00:52:22.556
    Chapter #0.19: start 3441.772000, end 3575.947000
    Metadata:
      title           : 00:57:21.772
    Chapter #0.20: start 3575.947000, end 3749.204000
    Metadata:
      title           : 00:59:35.947
    Chapter #0.21: start 3749.204000, end 3945.650000
    Metadata:
      title           : 01:02:29.204
    Chapter #0.22: start 3945.650000, end 4204.742000
    Metadata:
      title           : 01:05:45.650
    Chapter #0.23: start 4204.742000, end 4368.739000
    Metadata:
      title           : 01:10:04.742
    Chapter #0.24: start 4368.739000, end 4533.154000
    Metadata:
      title           : 01:12:48.739
    Chapter #0.25: start 4533.154000, end 4699.403000
    Metadata:
      title           : 01:15:33.154
    Chapter #0.26: start 4699.403000, end 4972.468000
    Metadata:
      title           : 01:18:19.403
    Stream #0:0(eng): Video: h264 (H264 / 0x34363248), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 1k tbn, 1k tbc (default)
    Metadata:
      title           : input
      stereo_mode     : left_right
    Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      title           : ENG
      encoder         : Lavc55.66.101 ac3
    Stream #0:2(por): Subtitle: hdmv_pgs_subtitle
    Metadata:
      title           : PT-BR
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (dts (dca) -> ac3 (ac3))
  Stream #0:3 -> #0:2 (copy)
Press [q] to stop, [?] for help
[dca @ 0000000004f7d3a0] Overread auxiliary data by 32 bits
[dca @ 0000000004f7d3a0] error decoding block
Error while decoding stream #0:2: Invalid data found when processing input
[dca @ 0000000004f7d3a0] Overread auxiliary data by 32 bits4 bitrate=7071.6kbits/s
[dca @ 0000000004f7d3a0] error decoding block
Error while decoding stream #0:2: Invalid data found when processing input
[dca @ 0000000004f7d3a0] Overread auxiliary data by 32 bits5 bitrate=7762.9kbits/s
[dca @ 0000000004f7d3a0] error decoding block
Error while decoding stream #0:2: Invalid data found when processing input
[dca @ 0000000004f7d3a0] Overread auxiliary data by 32 bits2 bitrate=8015.3kbits/s
[dca @ 0000000004f7d3a0] error decoding block
Error while decoding stream #0:2: Invalid data found when processing input
[dca @ 0000000004f7d3a0] Overread auxiliary data by 32 bits3 bitrate=7842.7kbits/s
[dca @ 0000000004f7d3a0] error decoding block
Error while decoding stream #0:2: Invalid data found when processing input
frame=119220 fps=961 q=-1.0 Lsize= 4708393kB time=01:22:52.34 bitrate=7757.1kbits/s
video:4571784kB audio:116470kB subtitle:18062kB other streams:0kB global headers:0kB muxing overhead: 0.044125%

Затем, запустив ffmpeg -i test.mkv (это выходной файл вышеуказанной команды), вы увидите следующую информацию о соотношении сторон:

Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x1080, SAR 1:2 DAR 8:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)

Посмотрите на значение SAR/DAR в потоке 0:0. Это отличается от оригинального файла. Я пробовал с параметром -aspect и без него . Я пытался использовать -vf "DAR=16:9" но я получаю сообщение:

Filtergraph 'dar=16:9' was defined for video output stream 0:0 but codec copy was selected. Filtering and streamcopy cannot be used together."

Как сохранить соотношение сторон без перекодирования видео?

1 ответ1

0
-map 0:0 -map 0:1 -map 0:2
ffmpeg -i input.mkv -c:v copy -c:s copy -c:a ac3 -ac 2 -map 0:0 -map 0:1 -map 0:2 -aspect 16:9 test.mkv 

se não der certo evite usar o "copy" edite uma talkão.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .