来源: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. 201871010133-赵永军《面向对象程序设计(java)》第十四周学习总结

    201871010133-赵永军<面向对象程序设计(java)>第十四周学习总结 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ ...

  2. 史上最全NOIP初赛知识点

    CSP-J/S 第一轮知识点选讲 \(NOIP\)(全国青少年信息学奥林匹克竞赛)于2019年取消.取而代之的是由\(CCF\)推出的非专业级软件能力认证,也就是现在的\(CSP-J/S\).作为一名 ...

  3. Gym101667 H. Rock Paper Scissors

    将第二个字符串改成能赢对方时对方的字符并倒序后,字符串匹配就是卷积的过程. 那么就枚举字符做三次卷积即可. #include <bits/stdc++.h> struct Complex ...

  4. [POJ1952]BUY LOW, BUY LOWER

    题目描述 Description The advice to "buy low" is half the formula to success in the bovine stoc ...

  5. hadoop 输入路径用正则表达式被默认处理为多个参数的问题

    运行命令 hadoop jar   wordcount.jar   com.WordCount  /inpath/*{beijing,shanghai,guangzhou}*   /outpath/ ...

  6. 动态规划 | DAG最长路

    1.矩形嵌套 查了很久的错,最后发现是ans在每次测试样例输入的时候没有初始化为0 . AC代码: #include <stdio.h> #include <memory.h> ...

  7. oracle--ORA-27125

    一,问题描述 ORA-27125 unable to create shared memory segment 二,问题解决 查看系统的oracleid号 [root@dgwxpdb ~]# id o ...

  8. PLSQL安装过程和SCOTT用户被锁的解决方法

    一.PLSQL安装: PLSQL基本就是一键式安装,没有什么需要修改的东西,一路Next就行了. 二.SCOTT用户被锁问题解决 1.问题如下: SCOTT用户默认是被锁的,需要通过system管理员 ...

  9. Qt Quick 事件处理之鼠标、键盘、定时

    一.鼠标事件 MouseArea 对象可以附加到一个 item 上供 item 处理鼠标事件,它本身是一个不可见的 item .在其内部,可以直接引用它所附着的对象的属性和方法.你可以将 MouseA ...

  10. NPOI中的PhysicalNumberOfCells 与 LastCellNum

    这两个理论上一个是算空列,一个不算空列,但是实际上有时候相同数据的excel,不同的excel编辑工具保存后的,PhysicalNumberOfCells可能不一样,会导致莫名其妙错误,最好使用Las ...