FFMPEG:尝试合并 mp3 和 webm 文件时编解码器参数不正确

FFMPEG:尝试合并 mp3 和 webm 文件时编解码器参数不正确

amerge尝试播放.mp3 文件和 .webm 文件后,我收到“(编解码器参数不正确)”错误

输出格式也是 .webm

这是我的 ffmpeg 命令:

ffmpeg -y -i native.mp3 -i 530f79494f2610e5058b4c73.webm -filter_complex \
'[0:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo,volume=0.5[a1]; \
[1:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo,volume=0.5[a2]; \
[a1][a2]amerge,pan=stereo:c0<c0+c2:c1<c1+c3[out]' -map 1:v -map '[out]' -c:v copy \
-c:a libfdk_aac -shortest -f webm output.webm

以及日志:

ffmpeg version N-60332-ga0d5204 Copyright (c) 2000-2014 the FFmpeg developers
  built on Feb  4 2014 21:31:51 with Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
  configuration: --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid
  libavutil      52. 63.100 / 52. 63.100
  libavcodec     55. 49.101 / 55. 49.101
  libavformat    55. 29.101 / 55. 29.101
  libavdevice    55.  7.100 / 55.  7.100
  libavfilter     4.  1.102 /  4.  1.102
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mp3, from 'native.mp3':
  Metadata:
    artist          : Freddie O. Moises
    title           : Native Blue
  Duration: 00:05:28.54, start: 0.025056, bitrate: 150 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 150 kb/s
    Stream #0:1: Video: mjpeg, yuvj420p(pc), 93x82, 90k tbr, 90k tbn, 90k tbc
    Metadata:
      title           : None
      comment         : Cover (front)
Input #1, matroska,webm, from '530f79494f2610e5058b4c73.webm':
  Metadata:
    encoder         : Lavf55.18.100
  Duration: 00:00:15.00, start: 0.000000, bitrate: 251 kb/s
    Stream #1:0(eng): Video: vp8, yuv420p, 484x252, SAR 112:121 DAR 16:9, 24 fps, 24 tbr, 1k tbn, 1k tbc (default)
    Stream #1:1(eng): Audio: vorbis, 44100 Hz, stereo, fltp (default)
[Parsed_pan_5 @ 0x7febd3e01e60] This syntax is deprecated. Use '|' to separate the list items.
[Parsed_amerge_4 @ 0x7febd3e016a0] No channel layout for input 1
[Parsed_amerge_4 @ 0x7febd3e016a0] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
[libvpx @ 0x7febd5000000] v1.3.0
[webm @ 0x7febd5009000] Only VP8,VP9 video and Vorbis,Opus(experimental, use -strict -2) audio and WebVTT subtitles are supported for WebM.
Output #0, webm, to 'output.webm':
  Metadata:
    artist          : Freddie O. Moises
    title           : Native Blue
    encoder         : Lavf55.29.101
    Stream #0:0(eng): Video: vp8 (libvpx), yuv420p, 484x252 [SAR 112:121 DAR 16:9], q=-1--1, 200 kb/s, 1k tbn, 24 tbc (default)
    Stream #0:1: Audio: aac (libfdk_aac), 44100 Hz, stereo, s16, 128 kb/s (default)
Stream mapping:
  Stream #0:0 (mp3) -> aformat (graph 0)
  Stream #1:1 (vorbis) -> aformat (graph 0)
  Stream #1:0 -> #0:0 (vp8 -> libvpx)
  pan (graph 0) -> Stream #0:1 (libfdk_aac)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

PS:libfdk_aac我相信流是需要的pan。嗯,如果我错了,请纠正我。

答案1

[webm @ 0x7febd5009000] Only VP8,VP9 video and Vorbis,Opus(experimental,
use -strict -2) audio and WebVTT subtitles are supported for WebM.

webm 输出容器仅支持 Vorbis 音频,并提供对 Opus 音频的实验性支持,因此请更改为libfdk_aaclibvorbis音频pan过滤器可以与任何输出音频格式一起使用(只要它可以处理通道数等)。

相关内容