【问题标题】:Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height打开输出流 #0:1 的编码器时出错 - 可能是不正确的参数,例如 bit_rate、rate、width 或 height
【发布时间】:2019-10-25 03:47:06
【问题描述】:

我正在尝试使用以下命令通过 FFMPEG 将 avi 视频文件转换为 flv 格式:

-i C:\files\input\test.avi -y -ab 448k -ar 48000 -vcodec mpeg4 -s 640x480 -f flv C:\files\output\test.flv

这是我从 ffmpeg 得到的回复:

输入:

Input #0, avi, from 'C:\files\input\test.avi':
  Metadata:
    encoder         : VirtualDubMod 1.5.10.2 (build 2540/release)
  Duration: 00:01:00.00, start: 0.000000, bitrate: 1813 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 640x272 [SAR 1:1 DAR 40:17], 25 tbr, 25 tbn, 25 tbc
    Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), s16, 448 kb/s

输出:

Output #0, flv, to 'C:\files\output\test.flv':
  Metadata:
    encoder         : VirtualDubMod 1.5.10.2 (build 2540/release)
    Stream #0:0: Video: mpeg4, yuv420p, 640x480 [SAR 30:17 DAR 40:17], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Stream #0:1: Audio: mp3, 48000 Hz, 5.1(side), s16, 448 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 -> mpeg4)
  Stream #0:1 -> #0:1 (ac3 -> libmp3lame)
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

你能告诉我这里有什么吗?上面有什么问题?

【问题讨论】:

  • -i inputfile outputfile 没有用吗?你试过其他参数吗?而且,顺便说一句,为什么是 C# 标签?
  • 我也试过了,但错误是一样的:(

标签: ffmpeg


【解决方案1】:

您必须明确指定所有编解码器:

-c:v mpeg4 *parameters* -c:a copy -c:s copy

(如果有字幕)

【讨论】:

  • 因为问题出在流 0:1(音频)上,-c:a copy 在这里就足以消除错误消息。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-11-16
  • 1970-01-01
  • 2019-02-27
  • 2015-05-06
  • 1970-01-01
  • 2022-07-27
相关资源
最近更新 更多