1

我目前在 FFMPEG 中并排放置 2 个视频。这是命令:

ffmpeg -i input.mov -vf "[in] scale=1280:720, pad=2*1280:720 [left]; movie=right.mov, scale=1280:720 [right]; [left][right]  overlay=1280:0 [out]" -b:v 1000k -vcodec libx264 -an sidebyside.mp4

我现在需要管理音频。我一直在尝试指定:

-acodec libfaac -ac 2 -map 0:1 -map 0:2

从第一个输入中获取 2 个音频通道并使用它们。我不断收到错误:

[aformat @ 0x7febf2e01fc0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat'
    [aresample @ 0x7febf2e02180] [SWR @ 0x7febf40dd000] Input channel layout isnt supported
Error opening filters!

我正在寻找指定哪个视频提供音频的最佳方式!感谢您的任何建议!

这是完整的输出:

ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jun  9 2012 21:40:17 with clang 3.0 (tags/Apple/clang-211.10.1)
  configuration: --prefix= --enable-gpl --enable-version3 --enable-nonfree --enable-libx264 --enable-libxvid --enable-postproc --enable-swscale --enable-avfilter --enable-pthreads --enable-yasm --enable-libfaac --enable-libmp3lame --cc=clang --enable-libvorbis
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'left.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2012-06-19 21:13:20
  Duration: 00:02:28.81, start: 0.000000, bitrate: 36378 kb/s
    Stream #0:0(eng): Video: mpeg2video (Main) (xdvf / 0x66766478), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 35000 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 59.94 tbc
    Metadata:
      creation_time   : 2012-06-19 21:13:20
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 1 channels (FL), s16, 768 kb/s
    Metadata:
      creation_time   : 2012-06-19 21:13:20
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 1 channels (FR), s16, 768 kb/s
    Metadata:
      creation_time   : 2012-06-19 21:13:20
      handler_name    : Apple Alias Data Handler
    Stream #0:3(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      creation_time   : 2012-06-19 21:13:20
      handler_name    : Apple Alias Data Handler
      timecode        : 02:20:28;08
File 'output.mp4' already exists. Overwrite ? [y/N] y
w:1920 h:1080 pixfmt:yuv420p tb:1/2997 sar:1/1 sws_param:flags=2
[buffersink @ 0x7febf2c18c80] No opaque field provided
[movie @ 0x7febf2c191c0] seek_point:0 format_name:(null) file_name:/Users/danielpcoffey/Desktop/tommy.mov stream_index:0
[scale @ 0x7febf2c19320] w:1920 h:1080 fmt:yuv420p sar:1/1 -> w:1280 h:720 fmt:yuv420p sar:1/1 flags:0x4
[pad @ 0x7febf2c19800] w:1280 h:720 -> w:2560 h:720 x:0 y:0 color:0x000000FF
[scale @ 0x7febf2c1ca40] w:1920 h:1080 fmt:yuv420p sar:1/1 -> w:1280 h:720 fmt:yuva420p sar:1/1 flags:0x4
[overlay @ 0x7febf2c1ce20] main w:2560 h:720 fmt:yuv420p overlay x:1280 y:0 w:1280 h:720 fmt:yuva420p
[overlay @ 0x7febf2c1ce20] main_tb:1/2997 overlay_tb:1/2997 -> tb:1/2997 exact:1
[aformat @ 0x7febf2e01fc0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat'
[aresample @ 0x7febf2e02180] [SWR @ 0x7febf40dd000] Input channel layout isnt supported
Error opening filters!
4

1 回答 1

1

电影视频过滤器只接收视频流,而不是音频,因此您可能根本不需要映射音频。

如果您确实想更好地控制音频,使用较新版本的 FFmpeg,您可以按类型而不是仅按数字选择输出流,即,-map 0:a -map 1:v这更简单,更不容易出错。

因此,对于您的情况,我建议(从输入中获取所有音频):

ffmpeg -i input.mov -vf "...movie=right.mov..." -c:a libfaac -ac 2 out.mp4

或(从输入中获取第一个和第二个音频流)

ffmpeg -i input.mov -vf "...movie=right.mov..." -c:a libfaac -ac 2 -map 0:v -map 0:a:0 -map 0:a:1 out.mp4
于 2012-06-21T00:46:50.107 回答