当我尝试将 avi 文件与 wav 文件合并时,它显示错误“打开输出流 #0:1 的编码器时出错 - 可能是不正确的参数,例如 bit_rate、rate、width 或 height”。
我将在此处包含我的代码以及命令行输出。
代码:
ffmpeg -i“C:\Users\admin\Desktop\SUNP0001.AVI”-i“C:\Users\admin\Desktop\temp.wav”-c:v 复制-c:a aac -strict 实验“C:\Users\admin\Desktop\new1.avi”
命令行输出
E:\vishnu>ffmpeg -i "C:\Users\admin\Desktop\SUNP0001.AVI" -i "C:\Users\admin\De
sktop\temp.wav" -c:v copy -c:a aac -strict experimental "C:\Users\admin\Deskto
p\new1.avi"
ffmpeg version N-59036-g5d8e4f6 Copyright (c) 2000-2013 the FFmpeg developers
built on Dec 12 2013 22:01:01 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aa
cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp
ack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 58.100 / 52. 58.100
libavcodec 55. 45.101 / 55. 45.101
libavformat 55. 22.100 / 55. 22.100
libavdevice 55. 5.102 / 55. 5.102
libavfilter 3. 92.100 / 3. 92.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
[avi @ 03715e40] non-interleaved AVI
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from 'C:\Users\admin\Desktop\SUNP0001.AVI':
Duration: 00:00:11.24, start: 0.000000, bitrate: 16310 kb/s
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc), 1280x720, 30.08
tbr, 30.08 tbn, 30.08 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 11025 Hz, mono, s16,
176 kb/s
Guessed Channel Layout for Input Stream #1.0 : mono
Input #1, wav, from 'C:\Users\admin\Desktop\temp.wav':
Duration: 00:00:14.68, bitrate: 384 kb/s
Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 24000 Hz, mono, s16,
384 kb/s
[aac @ 0371a720] Too many bits per frame requested
Output #0, avi, to 'C:\Users\admin\Desktop\new1.avi':
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p, 1280x720, q=2-31, 9
0k tbn, 30.08 tbc
Stream #0:1: Audio: aac, 11025 Hz, mono, fltp, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (pcm_s16le -> aac)
Error while opening encoder for output stream #0:1 - maybe incorrect parameters
such as bit_rate, rate, width or height
E:\vishnu>
请帮忙。
答案1
对于 11,025 Hz 单声道音频来说,您的比特率太高。128 kBit/s 对编码器来说太多了。
您需要通过添加-b:a 32k
或类似操作来降低比特率。