Audio FFmpeg音频通道rematrix(5.1至立体声)
我有一个(非常大!)Apple ProRes 422文件,带有16通道音频。为了能够在功能较弱的计算机上使用它,我想将其转换为标准MP4文件(h264视频编解码器、立体声音频)。然而,原始文件有16个音频通道,当我试图转换它时,FFmpeg会给出一个错误(“需要Rematrix”)。如何重新组合音频频道?是否需要其他步骤 这是我使用的FFmpeg命令:Audio FFmpeg音频通道rematrix(5.1至立体声),audio,video,encoding,ffmpeg,h.264,Audio,Video,Encoding,Ffmpeg,H.264,我有一个(非常大!)Apple ProRes 422文件,带有16通道音频。为了能够在功能较弱的计算机上使用它,我想将其转换为标准MP4文件(h264视频编解码器、立体声音频)。然而,原始文件有16个音频通道,当我试图转换它时,FFmpeg会给出一个错误(“需要Rematrix”)。如何重新组合音频频道?是否需要其他步骤 这是我使用的FFmpeg命令: ffmpeg -y -i Capture0000.mov -vcodec libx264 -vb 2000k -pix_fmt yuv420p
ffmpeg -y -i Capture0000.mov -vcodec libx264 -vb 2000k -pix_fmt yuv420p -coder 0 -profile:v baseline -acodec libfaac -ab 128k /tmp/out.mp4
这是FFmpeg输出:
ffmpeg version 2.2.git Copyright (c) 2000-2014 the FFmpeg developers
built on May 8 2014 14:17:45 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --prefix=/usr/local/ffmpeg_build --extra-cflags=-I/usr/local/ffmpeg_build/include --extra-ldflags=-L/usr/local/ffmpeg_build/lib --bindir=/usr/local/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab --enable-libxvid --enable-libfaac
libavutil 52. 81.100 / 52. 81.100
libavcodec 55. 60.103 / 55. 60.103
libavformat 55. 37.102 / 55. 37.102
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 5.100 / 4. 5.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Capture0000.mov':
Metadata:
creation_time : 2014-08-17 18:30:31
Duration: 01:01:22.52, start: 0.000000, bitrate: 202001 kb/s
Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le, 1920x1080, 183513 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 2500 tbn, 2500 tbc (default)
Metadata:
creation_time : 2014-08-17 18:30:31
handler_name : Apple Alias Data Handler
encoder : Apple ProRes 422 (HQ)
Stream #0:1(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 16 channels, s32, 18432 kb/s (default)
Metadata:
creation_time : 2014-08-17 18:30:31
handler_name : Apple Alias Data Handler
[auto-inserted resampler 0 @ 0x3943da0] [SWR @ 0x39441a0] Rematrix is needed between 16 channels and 5.1 but there is not enough information to do it
[auto-inserted resampler 0 @ 0x3943da0] Failed to configure output pad on auto-inserted resampler 0
Error opening filters!
这是FFprobe输出:
ffprobe version 2.2.git Copyright (c) 2007-2014 the FFmpeg developers
built on May 8 2014 14:17:45 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --prefix=/usr/local/ffmpeg_build --extra-cflags=-I/usr/local/ffmpeg_build/include --extra-ldflags=-L/usr/local/ffmpeg_build/lib --bindir=/usr/local/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab --enable-libxvid --enable-libfaac
libavutil 52. 81.100 / 52. 81.100
libavcodec 55. 60.103 / 55. 60.103
libavformat 55. 37.102 / 55. 37.102
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 5.100 / 4. 5.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Capture0000.mov':
Metadata:
creation_time : 2014-08-17 18:30:31
Duration: 01:01:22.52, start: 0.000000, bitrate: 202001 kb/s
Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le, 1920x1080, 183513 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 2500 tbn, 2500 tbc (default)
Metadata:
creation_time : 2014-08-17 18:30:31
handler_name : Apple Alias Data Handler
encoder : Apple ProRes 422 (HQ)
Stream #0:1(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 16 channels, s32, 18432 kb/s (default)
Metadata:
creation_time : 2014-08-17 18:30:31
handler_name : Apple Alias Data Handler
找到了!仅提取音频后,发现前两个通道是立体声,其余四个通道是空的,因此我添加了以下内容:
-af 'pan=stereo:c0=FL:c1=FR'
它只使用左前和右前声道进行立体声混音
编辑:较新版本的FFMpeg需要使用|而不是:,因此应该是这样
stereo|c0=FL|c1=FR