来源: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. luoguP3455 [POI2007]ZAP-Queries

    题意 设\(f(n)=\sum\limits_{i=1}^{a}\sum\limits_{j=1}^{b}[gcd(i,j)==n],F(n)=\sum\limits_{n|d}f(d)\) 发现\( ...

  2. electron 创建托盘应用

    在Electron中我们创建一个托盘需要如下几个文件: 1. main.js 用来存放应用代码.2. 一张PNG格式的图片用作应用图标.3. 一个package.json文件用来描述应用配置. 下面是 ...

  3. 【oracle】oracle11g安装失败 提示找不到文件,模板General_Purpose.dbc不存在

    先确定一下自己的安装包是不是一起解压的! 不是就重新解压,重新装. 是,剩下的我也不会

  4. win10经常无法复制粘贴

    两种方法尝试一下: 1. 在c:\windows\system32 目录下新建文件夹,命名为clip 2. 因为有道词典会监控并占用你的剪贴板,请尝试关闭有道词典的[取词]和[划词]功能,如果还不行就 ...

  5. [LeetCode] 277. Find the Celebrity 寻找名人

    Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist o ...

  6. [LeetCode] 222. Count Complete Tree Nodes 求完全二叉树的节点个数

    Given a complete binary tree, count the number of nodes. Note: Definition of a complete binary tree ...

  7. 解决VMware虚拟机中centos 7无法上网的问题

    在WMware中安装centos 7后发现无法安装软件,开始以为是镜像服务器的问题,后来通过ping之后发现根本没办法连接到网络.由于很多设置都是默认的,并且虚拟机也是NAT模式,和电脑主机共享网络, ...

  8. Codeforces Round #607 (Div. 1) Solution

    从这里开始 比赛目录 我又不太会 div 1 A? 我菜爆了... Problem A Cut and Paste 暴力模拟一下. Code #include <bits/stdc++.h> ...

  9. 数据库多行数据合并一行(sqlserver、Oracle、Mysql)

    我们日常查询数据时,经常会有将查询到的数据按照某一列分组显示(合并多行数据),比如: 表结构: ),coursename )); 需要将以上数据按照用户名分组,所选课程列不同项之间用逗号隔开,在一行中 ...

  10. 解决WebBrowser控件会导致应用程序占用内存居高不下问题

    WebBrowser 是一个 .NET 控件类,在 .NET Framework 2.0 版中新增.WebBrowser 类使用户可以在窗体中导航网页,下面我们来看在开发中碰到WebBrowser控件 ...