我使用以下命令提取“ .MTS”记录(视频)的视频部分。
ffmpeg -i 00402.MTS -s 1280x720 -r 25 -ss 0:00:05.38608 -vcodec libxvid -qscale:v 2 -acodec ac3 -ar 48000 -ab 256k -t 0:00:06.613917 m001_mono.avi
音频流为立体声,但右声道仅记录了噪声。以下是输入信息:
Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1440x1080 [PAR 4:3 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
我希望输出的音频流是单声道的(仅具有原始的左声道)。我已经使用'-ac 1'选项进行了测试,但是在这种情况下,两个通道合并了,我损失了〜6dB的增益。
我应该使用什么选项来丢弃正确的声道并输出单声道音频流?
编辑:ffmpeg输出与map_channel选项
/home/eric/buildsys/ffmpeg-2.0.1/ffmpeg -i 00402.MTS -s 1280x720 -r 25 -ss 0:00:05.38608 -vcodec libxvid -qscale:v 2 -acodec ac3 -ar 48000 -ab 256k -t 0:00:06.61391 -map_channel -1 -map_channel 0.1.0 m001_test.avi
ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Sep 24 2013 05:31:18 with gcc 4.8 (Debian 4.8.1-10)
configuration: --extra-cflags=-I../static/include --extra-ldflags='-L../static/lib -static' --enable-gpl --enable-version3 --enable-static --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --disable-ffserver
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Input #0, mpegts, from '00402.MTS':
Duration: 00:01:18.25, start: 0.455556, bitrate: 12217 kb/s
Program 1
Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s
File 'm001_test.avi' already exists. Overwrite ? [y/N] y
-map_channel is forwarded to lavfi similarly to -af pan=0x3:c1=c0.
[pan @ 0x248a560] This syntax is deprecated. Use '|' to separate the list items.
[pan @ 0x248a560] Pure channel mapping detected: M 0
Output #0, avi, to 'm001_test.avi':
Metadata:
ISFT : Lavf55.12.100
Stream #0:0: Video: mpeg4 (libxvid) (xvid / 0x64697678), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 tbn, 25 tbc
Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 256 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> libxvid)
Stream #0:1 -> #0:1 (ac3 -> ac3)
Press [q] to stop, [?] for help
frame= 166 fps= 23 q=2.0 Lsize= 4012kB time=00:00:06.64 bitrate=4950.3kbits/s
video:3787kB audio:207kB subtitle:0 global headers:0kB muxing overhead 0.464949%