28
动手实验:利用基于英特尔凌动E6XX处理器的平台开 发嵌入式图形视频应用 合作者: Stewart Christie, Abhishek Girotra, Nikki He, Lori Matassa 指导教师: 张宇, 英特尔亚太区嵌入互联解决方案实验室经理 EMBL001

Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

动手实验:利用基于英特尔凌动™ E6XX处理器的平台开发嵌入式图形视频应用

合作者: Stewart Christie, Abhishek Girotra, Nikki He, Lori Matassa

指导教师: 张宇, 英特尔亚太区嵌入互联解决方案实验室经理

EMBL001

Page 2: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

议程

• 背景

• 英特尔凌动™ E6XX系列处理器视频解码性能

• 支持视频解码硬件加速的Fedora* 软件栈– Gstreamer*

– 音视频插件(Audio Video Plug-in)

– 视频加速API (VAAPI)

– 英特尔嵌入式媒体图形驱动 (Intel® EMGD)

• 实验– 媒体文件

– 实验开始

• 总结

2

Page 3: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

议程

• 背景

• 英特尔凌动™ E6XX系列处理器视频解码性能

• 支持视频解码硬件加速的Fedora* 软件栈– Gstreamer*

– 音视频插件(Audio Video Plug-in)

– 视频加速API (VAAPI)

– 英特尔嵌入式媒体图形驱动 (Intel® EMGD)

• 实验– 媒体文件

– 实验开始

• 总结

3

Page 4: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

背景

很多嵌入式行业要求高清视频回放:游戏,家庭电源管理,医疗,多媒体电话,车载信息娱乐系统等

英特尔凌动™ E6XX系列处理器

• 高性能计算资源用于高清视频回放

• 专用硬件实现实时视频解码

• 极低功耗

• 支持开源多媒体软件栈

4

Page 5: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

议程

• 背景

• 英特尔凌动™ E6XX系列处理器视频解码性能

• 支持视频解码硬件加速的Fedora* 软件栈– Gstreamer*

– 音视频插件(Audio Video Plug-in)

– 视频加速API (VAAPI)

– 英特尔嵌入式媒体图形驱动 (Intel® EMGD)

• 实验– 媒体文件

– 实验开始

• 总结

5

Page 6: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

英特尔凌动™ E6XX系列处理器 – 高清视频解码性能

Format Profile LevelsMax

ResolutionMax

Frame RateMax

Bit Rate(Mbps)

H.264 Baseline Profile L1,L1.2,L1.3,L2,L2.2,L3 1 480p 30 fps

H.264 Main Profile L1,L1.2,L1.3,L2,L2.2,L3,L3.1,L3.2, L4.1 1080p720p

30 fps60 fps

H.264 High Profile L1,L1.2,L1.3,L2,L2.2,L3,L3.1L3.2L, L4.1

1080p 30 fps 45

MPEG-4 Simple Profile L0,L1,L2,L3 480p 30 fps

MPEG-4 DivX HD 3 720p 30 fpsMPEG-4 Advanced

Simple ProfileL0,L1,L2,L3,L5 2 720p 30 fps 8

VC-1 Simple Profile LL,ML CIF

VC-1 Main Profile LL,ML,HL 1080p 30 fpsVC-1 Advanced

ProfileL0,L1,L2,L3 1080p 30 fps 40

WMV9 Simple Profile LL,ML

WMV9 Main Profile LL,ML,HL 1080p 30 fps 20MPEG-2 Simple Profile Main Level

MPEG-2 Main Profile Low, Main, High1440, High Level 1080p 30 fps 80

1L3.1 may be supported where the toolset use is those common to both Baseline and Main Profile.2At L5 resolution, only Simple Profile Toolset is supported.3DivX is based on MPEG4 ASP but ignores the levels defined by MPEG4. There are two variants of DivX. The “certified” version does not require GMC or quarter pixel motion compensation prediction. The “non-certified” does support these features.6

Page 7: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

议程

• 背景

• 英特尔凌动™ E6XX系列处理器视频解码性能

• 支持视频解码硬件加速的Fedora* 软件栈– Gstreamer*

– 音视频插件(Audio Video Plug-in)

– 视频加速API (VAAPI)

– 英特尔嵌入式媒体图形驱动 (Intel® EMGD)

• 实验– 媒体文件

– 实验开始

• 总结

7

Page 8: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

Fedora* 视频解码软件栈

8

Container/Source

Splitter/

Demux

Audio Decoder

Video Processing Pipeline

Raw Audio

Raw Video

PSTSMP4…

Elementary VideoBit-StreamH264MPEG-4MPEG-2….

ElementaryAudio

(Intel® EMGD)

VAAPI*

Intel® Hardware

Soft Audio Codec(s)MP3AAC…

Hardware Video Codec(s)H264MPEG -4 Part-2VC-1….

Soft Video Codec(s)Theora*H263H264MPEG

System Level ComponentsMPEG….

Player/Codec Framework

Intel® Embedded Media and Graphics Driver (Intel® EMGD)

Page 9: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

Gstreamer* http://www.gstreamer.net/

9

*

Page 10: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

音视频插件

• Gstreamer* 音频插件示例

– FAAD/FAAD2. AAC 播放(GStreamer-bad plug-ins)

– MAD. MP3 播放(GStreamer-ugly plug-ins)

– FFMPEG-Plug-ins

– ALSA. Audio output sink (GStreamer-base plug-ins)

• Gstreamer 视频插件示例

– Theora*, H263. Soft Video Codec (GStreamer–base plug-ins)

– MixVideoDecoder. VC-1, H264, WMV, MPEG-4, MPEG-2 Hardware accelerated codec (3rd party plug-in)

– Ximagesink, XVimagesink. Video Output sink (GStreamer-base plug-ins)

– MixVideoSink. Video Output sink (3rd party plug-in; Works with MixVideoDecoder)

10

Page 11: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

视频加速API (VAAPI)VAAPI - http://www.freedesktop.org/wiki/Software/vaapi 将应用和编解码器处理的不同类型的数据交给图形处理硬件单元进行解码

11

Video Decoder Application

VAAPIEMGD

DRMLib DRILib

X Server

DRI

DRM Kernel Module

Hardware (video decode, 3D graphics, etc)

Page 12: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

英特尔嵌入式媒体图形驱动(Intel® EMGD)

英特尔嵌入式媒体图形驱动(Intel® EMGD) http://edc.intel.com/Software/Downloads/EMGD/ 连接英特尔凌动™ E6XX系列处理器的显示/解码硬件与VAAPI

Graphics Hardware GMCH Hardware Encode/decode Hardware

core state

display

DRM & Resource ManagementGraphics Micro-kernel

IF

Graphics Services

2D Services (opt)

OpenGL*/ES/VG X11/2D VA API

IAL VideoIAL Display

User

Kernel

DRI

12

Page 13: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

议程

• 背景

• 英特尔凌动™ E6XX系列处理器视频解码性能

• 支持视频解码硬件加速的Fedora* 软件栈– Gstreamer*

– 音视频插件(Audio Video Plug-in)

– 视频加速API (VAAPI)

– 英特尔嵌入式媒体图形驱动 (Intel® EMGD)

• 实验– 媒体文件

– 实验开始

• 总结

13

Page 14: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

下一步? 实验开始

搭建自己的实验平台,体验基于英特尔凌动™ E6XX系列处理器的平台视频播放硬件加速的优势

说明: Fedora* 和英特尔嵌入式媒体图形驱动(Intel® EMGD)已经安装

步骤:1. 安装VAAPI,安装开发头文件2. 安装Gstreamer* 框架和所需的视频插件3. 运行测试示例验证视频加速已工作4. 比较硬件加速视频播放和使用软解压的VLC播放器性能

14

Page 15: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

基于英特尔凌动™E6XX系列处理器平台概述

主要: 实际硬件平台可能不同

Display Network Keyboard, Mouse, and

ResetPowerOn/Off

15

Page 16: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

媒体文件

为了方便,如下媒体文件已经被存在你的系统中:1. AAC 例子文件2. MP4例子文件,具有如下特征

- 分辨率1280 x 720- MPEG-4 Base Media System Layer (qtdemux plug-in)- H.264/AVC Video Bit-stream (MixVideoDecoder plug-in)- AAC Audio Bit-stream (faad plug-in)

提示: 1. 开源工具,如MediaInfo和FormatFactory是很好的媒体文件分析

工具2. 分析媒体文件可以帮助你确认系统需要哪些音视频插件来保证硬件

正常工作

16

Page 17: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

开始实验

• 在教师的指导下操作

• 参考实验指南: /home/inforce/lab

17

Page 18: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

议程

• 背景

• 英特尔凌动™ E6XX系列处理器视频解码性能

• 支持视频解码硬件加速的Fedora* 软件栈– Gstreamer*

– 音视频插件(Audio Video Plug-in)

– 视频加速API (VAAPI)

– 英特尔嵌入式媒体图形驱动 (Intel® EMGD)

• 实验– 媒体文件

– 实验开始

• 总结

18

Page 19: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

总结

基于英特尔凌动™E6XX系列处理器的平台可以为用户提供优异的性能和灵活性来实现高清视频播放:

• 支持多流• 没有视频停顿和丢帧• CPU资源占用低,留有足够的资源从事额外工作• 功耗低

19

Page 20: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

英特尔新出版的书籍

"This is an essential guide to working with the Intel® Atom™ processors that should be read by anyone who wants to understand how to use the platform effectively. The book covers key concepts including power management, parallel applications, and machine virtualization, while providing a clear explanation of the system architecture and how to use it to its fullest advantage."

- Paul Krzyzanowski, CTO, OpenPeak Inc.

http://www.intel.com/intelpress/sum_ms2a.htm

20

Page 21: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

参考资料

• Gstreamer*: http://www.gstreamer.net/

• Intel® Embedded Design Center: http://edc.intel.com/

• Intel® Embedded Media and Graphics Drivers web site: http://edc.intel.com/Software/Downloads/EMGD

• Embedded Linux* for Intel® Processors: http://www.timesys.com/supported/processors/intel

• VAAPI: http://www.freedesktop.org/wiki/Software/vaapi

• White papers:– Using Gstreamer for hardware accelerated video decoding on Intel®

Atom™ Processor E6xx series: http://download.intel.com/design/intarch/PAPERS/324294.pdf

– Video Encoding Accelerator Solution for Intel Atom Processor E6xx Series: http://download.intel.com/design/intarch/PAPERS/324328.pdf

21

Page 22: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

22

实验指南: 安装GStreamer* 和VAAPI (page 1 of 5)Edit /boot/grub/grub.conf:

• Find the line containing your boot kernel options. It will be similar to

“Kernel /boot/vmlinux-2.6.29-11 ro root=UUID= ..”

• To the end of this line, add:

vmalloc=256MB

Reboot the system:

• reboot

Download the rpm files:

• libxcb-1.7-1.fc14.i686.rpm

• libxcb-devel-1.7-1.fc14.i686.rpm

*Note: You also can find the two files under /home/inforce/rpms

Install the rpm files with the command:

• rpm -Uvh libxcb-1.7-1.fc14.i686.rpm

• rpm –Uvh libxcb-devel-1.7-1.fc14.i686.rpm

*Note: You could see error message. This is ok.

Page 23: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

23

实验指南: 安装GStreamer* 和VAAPI (page 2 of 5)Download the libva rpms from the following locations:

• http://repo.meego.com/MeeGo/releases/1.0.1/core/repos/ia32/packages/i586/

libva-1.0.1-3.4.i586.rpm

• http://repo.meego.com/MeeGo/releases/1.0.1/core/repos/ia32/packages/i586/

libva-devel-1.0.1-3.4.i586.rpm

*Note: you also can find the two files under /home/inforce/rpms

Install the rpms with the following commands:

• rpm -ivh --force libva-1.0.1-3.4.i586.rpm

• rpm -ivh --force libva-devel-1.0.1-3.4.i586.rpm

Install the MI-X package from the driver directory:

• cd /etc/X11/emgd/f…/IEMGD_HEAD_Linux/ IEMGD_HEAD_Linux /common/video_plugin

• rpm -Uvh mixcommon-0.1.8-1.1.moblin2.i586.rpm

• rpm -Uvh mixvbp-0.1.15-1.1.moblin2.i586.rpm

• rpm -Uvh mixvideo-0.1.15-3.1.moblin2.i586.rpm

• rpm -Uvh gst-plugins-mixvideo-0.10.16-1.2.moblin2.i586.rpm

Page 24: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

24

实验指南: 安装GStreamer* 和VAAPI (page 3 of 5)Copy emgd_drv_video.so to /usr/lib/dri:

• cp /usr/lib/xorg/modules/drivers/emgd_drv_video.so /usr/lib/dri

Play Video Files:

• cd /home/inforce/Videos

• gst-launch filesrc location=<video file name> ! qtdemux ! queue ! MixVideoDecoder ! MixVideoSink

Page 25: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

25

实验指南: 安装VLC Media Player (page 4 of 5)

Create a temporary directory and change directories (cd) to it.

Download fedora13+rpmfusion+planetccrma-repos.tgz from http://nielsmayer.com/meego/fedora13+rpmfusion+planetccrma-repos.tgz

*Note: you also can find this under /home/inforce/rpms

Uncompress the file using:

• tar xzvf fedora13+rpmfusion+planetccrma-repos.tgz

Edit the following files:

• <temp dir>/etc/yum.repos.d/rpmfusion-free.repo

• <temp dir>/etc/yum.repos.d/rpmfusion-nonfree.repo

• <temp dir>/etc/yum.repos.d/rpmfusion-free-updates.repo

• <temp dir>/etc/yum.repos.d/rpmfusion-nonfree-updates.repo

Page 26: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

26

实验指南: 安装VLC Media Player (page 5 of 5)

Make these changes to the specified files:

• To the first listed repository in each file only, change the line beginning with:

• 'name' – Change 'Fedora 13' to 'Fedora 11'

• 'baseurl' – Change 'releases/13' or 'updates/13' to 'releases/11' or 'updates/11'

• respectively

• 'enabled' – Change its value from 0 to 1

• 'gpgcheck' – Change its value from 1 to 0

Move the four files mentioned above to /etc/yum.repos.d/.

Install VLC:

• yum install vlc*

*Note: sometimes you could get error messages about timeout because the server is busy. Just run this command again

Play video files in two ways:

• From the menu, open “application-> VLC”

• Open a terminal,

• cd /home/inforce/Videos

• vlc <file name>

Page 27: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

Legal Disclaimer• INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS. NO LICENSE,

EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPETY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL’S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL® PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.

• Intel may make changes to specifications and product descriptions at any time, without notice.• All products, dates, and figures specified are preliminary based on current expectations, and are subject to

change without notice.• Intel, processors, chipsets, and desktop boards may contain design defects or errors known as errata, which

may cause the product to deviate from published specifications. Current characterized errata are available on request.

• Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark* and MobileMark*, are measured using specific computer systems, components, software, operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when combined with other products.

• Intel, the Intel logo, Atom, Sponsors of Tomorrow. and Sponsors of Tomorrow. Logo are trademarks of Intel Corporation in the United States and/or other countries.

• *Other names and brands may be claimed as the property of others.• Copyright ©2011 Intel Corporation.

27

Page 28: Presentation Headline To Go Here - eetrend.com · 2017-07-01 · 议程 •背景 •英特尔凌动™ E6XX系列处理器视频解码性能 •支持视频解码硬件加速的Fedora*

Risk Factors

28

The above statements and any others in this document that refer to plans and expectations for the first quarter, the year and the future are forward-looking statements that involve a number of risks and uncertainties. Many factors could affect Intel’s actualresults, and variances from Intel’s current expectations regarding such factors could cause actual results to differ materially from those expressed in these forward-looking statements. Intel presently considers the following to be the important factors that could cause actual results to differ materially from the corporation’s expectations. Demand could be different from Intel's expectations due to factors including changes in business and economic conditions; customer acceptance of Intel’s and competitors’ products; changes in customer order patterns including order cancellations; and changes in the level of inventory at customers. Intel operates in intensely competitive industries that are characterized by a high percentage of costs that are fixed or difficult to reduce in the short term and product demand that is highly variable and difficult to forecast. Revenue and the gross margin percentage are affected by the timing of Intel product introductions and the demand for and market acceptance of Intel's products; actions taken by Intel'scompetitors, including product offerings and introductions, marketing programs and pricing pressures and Intel’s response to such actions; and Intel’s ability to respond quickly to technological developments and to incorporate new features into its products. The gross margin percentage could vary significantly from expectations based on capacity utilization; variations in inventory valuation, including variations related to the timing of qualifying products for sale; changes in revenue levels; product mix and pricing; the timing and execution of the manufacturing ramp and associated costs; start-up costs; excess or obsolete inventory; changes in unit costs; defects or disruptions in the supply of materials or resources; product manufacturing quality/yields; and impairments of long-lived assets, including manufacturing, assembly/test and intangible assets. Expenses, particularly certain marketing and compensation expenses, as well as restructuring and asset impairment charges, vary depending on the level of demand for Intel's products and the level of revenue and profits. The majority of Intel’s non-marketable equity investment portfolio balance is concentrated in companies in the flash memory market segment, and declines in this market segment or changes in management’s plans with respect to Intel’s investments in this market segment could result in significant impairment charges, impacting restructuring charges as well as gains/losses on equity investments and interest and other. Intel's results could be impacted byadverse economic, social, political and physical/infrastructure conditions in countries where Intel, its customers or its suppliers operate, including military conflict and other security risks, natural disasters, infrastructure disruptions, health concerns and fluctuations in currency exchange rates. Intel’s results could be affected by the timing of closing of acquisitions and divestitures. Intel's results could be affected by adverse effects associated with product defects and errata (deviations from published specifications), and by litigation or regulatory matters involving intellectual property, stockholder, consumer, antitrust and other issues, such as the litigation and regulatory matters described in Intel's SEC reports. An unfavorable ruling could include monetary damages or an injunction prohibiting us from manufacturing or selling one or more products, precluding particular business practices, impacting Intel’s ability to design its products, or requiring other remedies such as compulsory licensing of intellectual property. A detailed discussion of these and other factors that could affect Intel’s results is included in Intel’s SEC filings, including the report on Form 10-Q for the quarter ended September 25, 2010.

Rev. 1/13/11