2

我正在尝试拍摄一个具有 h264 视频轨道和 dts-ma 音轨的视频,并获取一个 .m4v 文件:

h264 视频轨道 DTS-ma 音轨 AC-3 5.1 音轨

我试图只复制视频和 dts-ma 音轨,然后让它转换 AC-3 音轨

Unable to find a suitable output format for 'ac3'从这个命令中得到一个错误:

ffmpeg -i "input.mkv" -map 0:0 -map 0:1 -map 0:1 -map 0:1 -c:v copy -c:a:0 copy -c:a:1 -acodec ac3 -ac 6 -ab 448k -c:a:2 -acodec ac3 -ac 6 -ab 256 -ar 48000 "output.m4v"

(这是由我的 C# 应用程序生成的)

这对于已经包含 h264 和 ac3 的不同文件可以正常工作:

ffmpeg -i "input.mkv" -map 0:0 -map 0:1 -c:v copy -c:a:0 copy "output.m4v"

显然它没有进行转换。

这是第一个命令的完整结果:

ffmpeg version N-46936-g8b6aeb1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov 20 2012 19:34:37 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass -
-enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-libo
pus --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-li
bvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52.  8.100 / 52.  8.100
  libavcodec     54. 74.100 / 54. 74.100
  libavformat    54. 37.100 / 54. 37.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 23.101 /  3. 23.101
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 17.101 /  0. 17.101
  libpostproc    52.  2.100 / 52.  2.100
Input #0, matroska,webm, from 'input.mkv':
  Metadata:
    creation_time   : 2012-12-07 22:11:56
  Duration: 01:41:23.38, start: 0.000000, bitrate: 33582 kb/s
    Chapter #0.0: start 0.000000, end 186.250000
    Metadata:
      title           : 00:00:00.000
    Chapter #0.1: start 186.250000, end 512.708000
    Metadata:
      title           : 00:03:06.250
    Chapter #0.2: start 512.708000, end 883.292000
    Metadata:
      title           : 00:08:32.708
    Chapter #0.3: start 883.292000, end 1354.000000
    Metadata:
      title           : 00:14:43.292
    Chapter #0.4: start 1354.000000, end 1865.458000
    Metadata:
      title           : 00:22:34.000
    Chapter #0.5: start 1865.458000, end 2122.500000
    Metadata:
      title           : 00:31:05.458
    Chapter #0.6: start 2122.500000, end 2386.125000
    Metadata:
      title           : 00:35:22.500
    Chapter #0.7: start 2386.125000, end 2801.167000
    Metadata:
      title           : 00:39:46.125
    Chapter #0.8: start 2801.167000, end 2923.000000
    Metadata:
      title           : 00:46:41.167
    Chapter #0.9: start 2923.000000, end 3388.500000
    Metadata:
      title           : 00:48:43.000
    Chapter #0.10: start 3388.500000, end 3808.167000
    Metadata:
      title           : 00:56:28.500
    Chapter #0.11: start 3808.167000, end 4071.375000
    Metadata:
      title           : 01:03:28.167
    Chapter #0.12: start 4071.375000, end 4378.750000
    Metadata:
      title           : 01:07:51.375
    Chapter #0.13: start 4378.750000, end 4681.583000
    Metadata:
      title           : 01:12:58.750
    Chapter #0.14: start 4681.583000, end 4989.792000
    Metadata:
      title           : 01:18:01.583
    Chapter #0.15: start 4989.792000, end 5311.667000
    Metadata:
      title           : 01:23:09.792
    Chapter #0.16: start 5311.667000, end 5629.083000
    Metadata:
      title           : 01:28:31.667
    Chapter #0.17: start 5629.083000, end 6083.382000
    Metadata:
      title           : 01:33:49.083
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn, 48 tbc (default)
    Stream #0:1(eng): Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
[NULL @ 03f4b020] Unable to find a suitable output format for 'ac3'
ac3: Invalid argument
4

1 回答 1

6

问题可能是因为添加了参数-acodec

-acodec-codec:aor的别名-c:a

由于您已经用 指定了轨道-c:a:X,因此您不需要-acodec在它之后的右边。

这应该有效:

ffmpeg -i "input.mkv" -map 0:0 -map 0:1 -map 0:1 -map 0:1 -c:v copy -c:a:0 copy -c:a:1 ac3 -ac 6 -ab 448k -c:a:2 ac3 -ac 6 -ab 256 -ar 48000 "output.m4v"
于 2012-12-31T02:44:56.353 回答