HW Video Acceleration in Chrome/Chromium HTML5 video 视频播放硬件加速
2014-06-17 19:43
399 查看
Introduction
Video decode (e.g. YouTube playback) and encode (e.g. videochat applications) are some of the most complex compute operations on the modern web. Moving these operations from software running on general-purpose CPUs to dedicated hardware blocks means lower power consumption, longer battery life, higher quality (e.g.
HD instead of SD), and better interactive performance as the CPU is freed up to work on everything else it needs to do.
Design
media::VideoDecodeAccelerator(VDA) and media::VideoEncodeAccelerator
(VEA) (with their respective Client subclasses) are the interfaces at the center of all video HW acceleration in Chrome. Each consumer of HW acceleration implements the relevant Client interface and calls an object of the relevant V[DE]A interface.
In general the classes that want to encode or decode video
live in the renderer process (e.g. the <video> player, or WebRTC’s video encoders & decoders) and the HW being utilized is not accessible from within the renderer process, soIPC
is used to bridge the renderer<->GPU process gap.
Implementation Details
The main consumers of the acceleration APIs are: <video> pipeline(what plays media on the web), WebRTC (enabling plugin-free real-time video chat on the web), and Pepper API (offering HW acceleration to pepper plugins such as Adobe Flash).
The implementations of the acceleration APIs are specific to
the OS (and sometimes HW platform) due to radically different options offered by the OS and drivers/HW present.
and never-launched MacVDA).
Current Status
New devices are released all the time so this list is likelyalready out of date, but as of early June 2014, existing (public) support includes:
Decode
Windows: starting with Windows 7, HW accelerated decode of h.264 is used via DXVAVDA.CrOS/Intel (everything post-Mario/Alex/ZGB): HW accelerated decode of h.264 is used via VAVDA
CrOS/ARM: HW accelerated decode of VP8 and h.264 is available via V4L2VDA
Android: HW accelerated decode of VP8 is available on N10, N5, some S4’s, and a bunch of other
devices. (note that on Android this only applies to WebRTC, as there is no PPAPI and <video> uses the platform’s player)
Encode
CrOS/ARM: HW accelerated encode of h.264 (everywhere) and VP8 (2014 devices) is available viaV4L2VEA
Android: HW accelerated encode of VP8 is available on N5.
Results
Generally speaking offloading encode or decode from CPU to specialized HW has shown an overall battery-life extension of 10-25% dependingon the platform, workload, etc
转自
https://docs.google.com/document/d/1LUXNNv1CXkuQRj_2Qg79WUsPDLKfOUboi1IWfX2dyQE/preview#
根据Kitkat上的Chromium代码分析,HTML5 video播放硬件加速,最终是使用MediaCodec.java来利用本地native的硬件资源来做video视频播放加速的。
MediaPlayer的大致框图如下:
而Pipeline最终会通过GpuVideoDecoder调用到MediaCodec:
而具体的时序图则还没搞清楚。以MediaPlayer为切入点看Chromium的代码还真挺困难的
相关文章推荐
- HW Video Acceleration in Chrome/Chromium HTML5 video 视频播放硬件加速
- Chrome/Chromium HTML5 video 视频播放硬件加速
- Chrome/Chromium HTML5 video 视频播放硬件加速
- Chrome/Chromium HTML5 video 视频播放硬件加速
- Android WebView 总结 —— 硬件加速使用HTML5播放视频及全屏方案
- jqm视频播放器,html5视频播放器,html5音乐播放器,html5播放器,video开发demo,html5视频播放示例,html5手机视频播放器
- HTML5添加 video 视频标签后仍然无法播放的解决方法 IIS添加MIEI类型
- 低版本IE6/7/8浏览器中使用HTML5的audio和video标签播放视频音频
- 验证是否支持html5的Video标签及MP4视频播放
- HTML5添加 video 视频标签后仍然无法播放的解决方法 IIS添加MIEI类型
- HTML5添加 video 视频标签后仍然无法播放的解决方法 IIS添加MIEI类型
- HTML5添加 video 视频标签后仍然无法播放的解决方法
- 【实例】HTML5中video播放视频实现特效
- 怎样解决部分网站网页中IE9无法播放flash视频的问题--硬件加速功能存在冲突
- GStreamer播放教程08——视频解码的硬件加速
- 直接在低版本IE6/7/8浏览器中使用HTML5的audio和video标签播放视频音频的办法
- 一个html5播放视频的video控件只支持android的默认格式mp4和3gp
- Android HTML5 Video视频标签自动播放与自动全屏问题解决
- html5 Video控件视频播放,电脑和手机上都能兼容。(mp4格式 电脑和android、ios都能播放)
- 这个网站的的,首页有特点。它能根据浏览器是否支持HTML5或者是Silverlight,来决定是启用HTML5的Video还是Silverlight播放视频。