When does VideoToolbox' VTCompressionSession benefit from hardware acceleration?
2015-11-19 00:46
1331 查看
来源:http://stackoverflow.com/questions/19256897/when-does-videotoolbox-vtcompressionsession-benefit-from-hardware-acceleration
active
oldest
votes
When does VideoToolbox' VTCompressionSession benefit from hardware acceleration?
up vote 1 down vote favorite 1 | 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 VTCompressionSessionon 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 VTCompressionSessionuse hardware accelerated encoding? osx gstreamer video-encoding hardware-acceleration core-video
| ||
add a comment |
2 Answers
activeoldest
votes
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.
| ||||
|
up vote 1 down vote | 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.
| ||
add a comment |
相关文章推荐
- Debian8.2 下的软件配置
- top
- c语言:有一个分数序列: 2/1+3/2+5/3+8/5+13/8+… 求出这个数列前 20 项的和
- C#基础之扩展方法
- loss function
- linq里的select和selectmany操作
- NC portal怎么重新开始入门,整个配置过程包括配置一个节点
- LeetCode21:Merge Two Sorted Lists
- 【HDOJ】2295 Radar
- java Process 流导致的错误
- Android测试教程2--简单小测试
- 移动端开发学习1:viewport
- NChome如何创建单据跟主子表还有扩展开发要怎么弄?
- 什么叫做Oracle RAC中的nodename
- opengl绘制一个机器人手臂的一些问题
- 排错-Loadrunner录制打不开浏览器解决办法
- Direct Access to Video Encoding and Decoding
- 排错-Loadrunner录制打不开浏览器解决办法
- 有序向量二分查找的三个 版本
- Linux用户配置sudo权限(visudo)