来源:http://stackoverflow.com/questions/19256897/when-does-videotoolbox-vtcompressionsession-benefit-from-hardware-acceleration

I've been working on the gstreamer applemedia encoder plugins and improved the VideoToolbox based video encoding. Running a gstreamer pipeline like:

$ gst-launch-1.0 filesrc location=source.avi ! decodebin  ! vtenc_h264 ! h264parse ! qtmux name=mux ! filesink location=sink.mp4

I was expecting to see a very low CPU usage when encoding h264 video using VTCompressionSession on Mac OS systems. However, on the systems I've tested: Mid 2009 Macbook Pro with GeForce 9600M and Mid 2011 Mac mini with Radeon HD 6630M the encoding still consumes between 80% and 130% CPU - which indicates it's not hardware accelerated.

On which hardware configurations, or given which compression parameters (for example for which kVTCompressionPropertyKey_ProfileLevel) does VTCompressionSession use hardware accelerated encoding?

asked Oct 8 '13 at 19:44
drott
393211
 

2 Answers

up vote
3
down vote

accepted

According to http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/sys/applemedia/vtenc.c
you are passing in NULL to VTCompressionSessionCreate() for the
encoderSpecification parameter. Create an encoder specification
dictionary with
kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder set
to kCFBooleanTrue.

answered Feb 1 '14 at 2:17

 
    
Yes, that's a good answer. In
the meantime, I also found this Handbrake branch where they have more
details on these undocumented (?) parameters for the API. github.com/galad87/HandBrake-QuickSync-Mac/commit/… - Any additional to pointers to documentation or more details would be helpful.
– drott
Feb 3 '14 at 12:44
 

The above pipeline will not help you much on determining whether it's
actually the encoding process that's responsible for the high CPU
usage. There is no sync with the clock in the stream, which means the
whole process of decode/encode will go as fast as it can.

Since decodebin is probably using a software decoder, the high CPU
usage you are experiencing is most likely due to the decoding process.

I would recommend to compare the output with:

gst-launch-1.0 videotestsrc is-live=true ! vtenc_h264 ! qtmux ! filesink location=test.mp4

Note specially the property "is-live=true" which is instructing videotestsrc to act as a live source and therefore pushing buffers at a constant rate and not as fast as downstream can consume them.

answered Oct 17 '13 at 0:51
ylatuya
1662
 

When does VideoToolbox' VTCompressionSession benefit from hardware acceleration?的更多相关文章

  1. emulator: ERROR: x86 emulation currently requires hardware acceleration!

    emulator: ERROR: x86 emulation currently requires hardware acceleration!Please ensure Intel  is prop ...

  2. 启动安卓模拟器报错 emulator: ERROR: x86_64 emulation currently requires hardware acceleration! CPU acceleration status:HAXM must be updated(version 1.1.1<6.0.1) 解决办法

    启动安卓模拟器报错 emulator: ERROR: x86_64 emulation currently requires hardware acceleration!  CPU accelerat ...

  3. 运行android模拟器,emulator: ERROR: x86 emulation currently requires hardware acceleration!

    运行android模拟器,emulator: ERROR: x86 emulation currently requires hardware acceleration! 问题: 运行android模 ...

  4. android ------ Emulator: error: x86 emulation currently requires hardware acceleration

    我创建 Android 模拟器,运行项目时出现了一个这样的错误: 如下: emulator ERROR:x86 emulation currently requires hardware accele ...

  5. emulator: ERROR: x86 emulation currently requires hardware acceleration!Please ensure Intel HAXM is properly installed and usable.CPU acceleration status: HAX kernel module is not installed!

    Android Studio 1.0 已经放出来了,以后的Android平台开发激昂逐步从Eclipse向Android Studio迁移,为了能不落伍我也特意从Google下载了Android St ...

  6. Android Studio ERROR: x86 emulation currently requires hardware acceleration!报错解决傻瓜教程~

    很早之前就碰到过Android Studio模拟器无法启动的问题,今天终于尝试去解决了下,下面将我解决的方法记录下. 模拟器报错信息为: emulator: ERROR: x86 emulation ...

  7. Android AVD启动报错:emulator: ERROR: x86_64 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable.

    打开Android SDK manager查看安装发现HAXM在windows上无法安装 可以去 http://www.androiddevtools.cn/index.html 下载 Android ...

  8. Android Studio3.1.2运行模拟器出错Emulator:emulator:ERROR:x86 emulation currently requires hardware acceleration!

    出错截图如下所示: 解决方法: 由于我是已经解决了这个问题,安装了Intel x86 Emulator Accelerator,所以显示后面显示的是 Installed,如果报错和我贴的图一样,就可以 ...

  9. Android studio 中,遇到报错:ERROR: x86_64 emulation currently requires hardware acceleration! CPU acceleration status:HAXM must be updated(version 1.1.1<6.0.1)的解决方法

    在 Android SDK 的安装目录下找到intelhaxm-android.exe安装即可.忘记目录位置直接在“计算机”中搜索,如果没有,返回Android studio 的“设置”,找到 这个图 ...

随机推荐

  1. VC 静态库与动态库(三)动态库创建与使用_隐式链接

    动态库分为二种,一种隐式链接,另一种显示调用.不论哪种动态库,本质都是运行时动态加载 隐式链接:程序运行时,由编译系统自动加载动态库,然后根据程序的引入表进行重定位,当程序退出时自动卸载动态库 显示调 ...

  2. selenium 2定位方式实例

    #########百度输入框的定位方式########## #通过id方式定位 browser.find_element_by_id("kw").send_keys("s ...

  3. gradle-在一个模块中引入其它模块

    现在有两个项目pet-api和pet-provider,这两个项目都在pet-parent当中,项目结构如下: 现在要在pet-provider中调用pet-api 先在parent中的setting ...

  4. Codeforces Round #549 (Div. 2) F 数形结合 + 凸包(新坑)

    https://codeforces.com/contest/1143/problem/F 题意 有n条形如\(y=x^2+bx+c\)的抛物线,问有多少条抛物线上方没有其他抛物线的交点 题解 \(y ...

  5. [LeetCode] 146. LRU Cache 最近最少使用页面置换缓存器

    Design and implement a data structure for Least Recently Used (LRU) cache. It should support the fol ...

  6. 编程哲理小故事:Tina的运动会方阵

    自从接到任务后,Tina一直 烦恼着如何让这群繁忙又缺乏才艺的程序员在运动会开幕式上做出一个有趣的方阵表演. 接到了运动会的方阵表演的任务 时间回到1个月前. Tina正在工位上繁忙地进行着下一期准备 ...

  7. SpringCloud Ribbon 负载均衡 通过服务器名无法连接的神坑一个

    一,问题 采取eureka集群.客户端通过Ribbon调用服务,Ribbon端报下列异常 java.net.UnknownHostException: SERVICE-HI java.lang.Ill ...

  8. @JsonView的使用

    1.使用场景 在某一些请求返回的JSON中,我们并不希望返回某些字段.而在另一些请求中需要返回某些字段. 例如: 在查询列表请求中,不返回password字段 在获取用户详情中,返回password字 ...

  9. 《Interest Rate Risk Modeling》阅读笔记——第四章:M-absolute 和 M-square 风险度量

    目录 第四章:M-absolute 和 M-square 风险度量 思维导图 两个重要不等式的推导 关于 \(M^A\) 的不等式 关于 \(M^2\) 的不等式 凸性效应(CE)和风险效应(RE)的 ...

  10. 【MySQL】MariaDB10.2新特性--Flashback

    MariaDB10.2新特性--Flashback Flashback可以回滚到旧的数据,用于解决用户误删除数据的问题. 实战例子 MariaDB [zsd]> select * from te ...