使用ffmpeg

时间:2019-05-28 20:05:14

标签: ffmpeg

我使用Skype通话记录器记录Skype采访。该应用程序以2个音频通道保存.mov格式的文件。

当我提交这些文件进行转录时,它们总是以一个通道被转录回来。

我需要1.)合并曲目,并2.)将.mov文件转换为.mp3格式。

现在我正在使用的命令是:

ffmpeg -i input.mov -map 0:a output.mp3

我收到以下错误:

 Invalid audio stream. Exactly one MP3 audio stream is required.
 Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

我想念什么?

这是完整的控制台输出,如果有帮助的话:

ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.6.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  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 'input.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2019-05-18 15:00:59
  Duration: 00:11:41.82, start: 0.000000, bitrate: 120 kb/s
    Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 58 kb/s (default)
    Metadata:
      creation_time   : 2019-05-18 15:00:59
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 58 kb/s (default)
    Metadata:
      creation_time   : 2019-05-18 15:00:59
      handler_name    : Apple Alias Data Handler
[mp3 @ 0x7fd8b1003c00] Invalid audio stream. Exactly one MP3 audio stream is required.
Output #0, mp3, to 'output.mp3':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    encoder         : Lavf56.25.101
    Stream #0:0(eng): Audio: mp3 (libmp3lame), 44100 Hz, mono, fltp (default)
    Metadata:
      creation_time   : 2019-05-18 15:00:59
      handler_name    : Apple Alias Data Handler
      encoder         : Lavc56.26.100 libmp3lame
    Stream #0:1(eng): Audio: mp3 (libmp3lame), 44100 Hz, mono, fltp (default)
    Metadata:
      creation_time   : 2019-05-18 15:00:59
      handler_name    : Apple Alias Data Handler
      encoder         : Lavc56.26.100 libmp3lame
Stream mapping:
  Stream #0:0 -> #0:0 (aac (native) -> mp3 (libmp3lame))
  Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

1 个答案:

答案 0 :(得分:1)

两个单声道流变为单声道

使用amix过滤器:

ffmpeg -i input.mov -filter_complex "[0:a]amix=inputs=2" output.mp3

两个单声道流到立体声

使用joinamerge过滤器:

ffmpeg -i input.mov -filter_complex "[0:a]join=inputs=2:channel_layout=stereo" output.mp3

另请参阅FFmpeg Wiki: Audio Channel Manipulation