Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Video FFMPEG中的2个源视频。。。如何映射音频?_Video_Filter_Ffmpeg_Video Processing - Fatal编程技术网

Video FFMPEG中的2个源视频。。。如何映射音频?

Video FFMPEG中的2个源视频。。。如何映射音频?,video,filter,ffmpeg,video-processing,Video,Filter,Ffmpeg,Video Processing,我目前在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 lib

我目前在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
从第一个输入中获取两个音频通道并使用它们。我不断得到错误:

[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!

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

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

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

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


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

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

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

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


谢谢,这很有道理。不幸的是,我仍然收到同样的错误“输入通道布局不受支持错误打开过滤器!”,我恢复到ffmpeg(0.7.8)的macports版本,并且我能够完成我的操作-可能有新的东西被破坏了?可能。我使用0.10.2进行测试。很好,不管怎样,它现在可以工作了。谢谢,这很有意义。不幸的是,我仍然收到同样的错误“输入通道布局不受支持错误打开过滤器!”,我恢复到ffmpeg(0.7.8)的macports版本,并且我能够完成我的操作-可能有新的东西被破坏了?可能。我使用0.10.2进行测试。很好,不管怎么说,它现在起作用了。
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