本文介绍了FFMPEG慢速VP8编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将网络摄像头中的视频编码为VP8流.使用Chrome从我的网络摄像头发送WebRTC流看起来非常不错,并且不占用大量CPU资源.当我尝试使用FFMPEG将网络摄像头流转码为VP8(webm)时,速度非常非常慢.

I am trying to encode video from my webcam into a VP8 stream. Sending a WebRTC stream from my webcam using Chrome looks pretty good and doesn't use a lot of CPU power. When I try to transcode my webcam stream to VP8 (webm) using FFMPEG then it's very, very slow.

在OS X上,我使用以下FFMPEG选项生成VP8 webm文件.来源是720p Facetime网络摄像头.这会耗尽我的CPU使用率(2011年末核心i7 MBP),质量也不是很好:

On OS X I use the following FFMPEG options to generate a VP8 webm file. The source is a 720p Facetime webcam. It drains my CPU usage (late 2011 core i7 MBP) and the quality isn't very good:

ffmpeg -f avfoundation -i 'default' -y -qmin 11 -qmax 45 -b:v 500k -cpu-used 0 -deadline realtime test.webm

WebRTC使用哪种协议,Chrome怎么能这么快?我给人的印象是VP8无法在硬件中完成.使用现代的Intel CPU,您可以使用QuickSync,但是我想那只是H.264,FFMPEG不支持.

Which protocol is used for WebRTC and how can Chrome be so fast? I was under the impression that VP8 cannot be done in hardware. Using modern Intel CPUs you could use QuickSync, but I guess that is H.264 only and not supported by FFMPEG.

推荐答案

这实际上是正常的.现在, WebM项目仍然相对较小,唯一的主要采用者是Google的YouTube流服务.

This is actually normal. Right now the WebM Project is still relatively small, with the only major adopter being Google's YouTube streaming service.

[使用VP8编解码器的] WebM编码极其慢,但是以某种方式,较新的VP9编解码器在消费类计算机上更加困难.对于Google的大型服务器来说,这似乎不是什么大问题,但是WebM视频(其高效压缩)的主要好处是它对普通用户的不利影响.

WebM encoding [using the VP8 codec] is extremely slow, but somehow the newer VP9 codec is even harder on consumer machines. It seems like it isn't too much of a problem for Google's massive servers, but the major benefit of WebM video [its highly effective compression] is its downfall for average users.

从WebM项目站点:

如今,以最佳质量"模式编码VP8是最慢的配置. >使用速度参数设置在0到5之间的高质量"模式>将提供一定范围的速度.我们相信,我们可以大幅提高VP8的速度,尤其是在您的帮助下.在2010年10月发布的"Aylesbury"发行版中,我们将VP8的整体解码器性能提高了约28%,并着眼于我们下一个发行版的编码器速度改进.

Today, encoding VP8 in "best quality" mode is the slowest configuration. >Using "good quality" mode with the speed parameter set between 0 and 5 will >provide a range of speeds. We believe that we can make substantial VP8 >speed improvements, especially with your help. We increased overall VP8 >decoder performance by ~28% in our October 2010 "Aylesbury" release and are >focusing on encoder speed improvements for our next named release.

希望这会有所帮助!

这篇关于FFMPEG慢速VP8编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 09:40