FFMPEG仅从MP4转换为WEBM,只处理某些文件。

时间:2013-09-25 12:20:37

标签: video ffmpeg transcoding

我使用FFMPEG的streamio包装器尝试了以下URL。 网址是

http://static.bouncingminds.com/ads/5secs/baileys_5sec.mp4 (works)
http://techslides.com/demos/sample-videos/small.mp4 (doesn't work) 

对于后者,我收到以下错误:

Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

我用来转码的代码:

movie.transcode("test.webm", "-vcodec libvpx -strict -2") { |p| puts p }

如上所述,这适用于第一个视频。为了使用所有mp4视频,我需要具体的设置吗?

1 个答案:

答案 0 :(得分:3)

音频编码器(vorbis)将发出以下消息:

[vorbis @ 0x7ffcc292f600] Current FFmpeg Vorbis encoder only supports 2 channels.

原来该文件只有单声道。

指定-ac 2强制使用两个频道(假立体声)或-map v:0放弃音频频道。

(或等待opus to become available in webm,或要求ffmpeg开发人员修改编码器以支持单声道流)