[FFmpeg-devel] [PATCH] avcodec: add new Videotoolbox hwaccel.

Zhang Rui bbcallen at gmail.com
Tue Jul 28 15:01:50 CEST 2015


2015-07-28 16:04 GMT+08:00 Clément Bœsch <u at pkh.me>:
> On Mon, Jul 27, 2015 at 10:10:12PM +0800, Zhang Rui wrote:
>> 2015-07-27 20:14 GMT+08:00 Clément Bœsch <u at pkh.me>:
>> > On Mon, Jul 27, 2015 at 06:13:30PM +0800, Zhang Rui wrote:
>> >> 2015-07-15 21:51 GMT+08:00 Clément Bœsch <u at pkh.me>:
>> >> > On Sat, Jun 20, 2015 at 01:33:00PM +0200, Sebastien Zwickert wrote:
>> >> >> Old videtotoolbox patch rebased and updated to target the new HWAccel API.
>> >> >> As VDA is a wrapper of VideoToolbox framework, the changes base vda implementation
>> >> >> upon the videotoolbox implementation to factorize common part of code.
>> >> >>
>> >> >> ---
>> >> >>  Changelog                    |   1 +
>> >> >>  MAINTAINERS                  |   1 +
>> >> >>  Makefile                     |   5 +-
>> >> >>  configure                    |  19 +-
>> >> >>  ffmpeg.h                     |   2 +
>> >> >>  ffmpeg_opt.c                 |   5 +-
>> >> >>  ffmpeg_vda.c                 | 134 --------
>> >> >>  ffmpeg_videotoolbox.c        | 147 +++++++++
>> >> >>  libavcodec/Makefile          |  12 +-
>> >> >>  libavcodec/allcodecs.c       |   5 +
>> >> >>  libavcodec/h263dec.c         |   3 +
>> >> >>  libavcodec/h264_slice.c      |   4 +
>> >> >>  libavcodec/mpeg12dec.c       |   3 +
>> >> >>  libavcodec/vda.c             |   2 +-
>> >> >>  libavcodec/vda_h264.c        | 154 +---------
>> >> >>  libavcodec/vda_internal.h    |  33 --
>> >> >>  libavcodec/vda_vt_internal.h |  57 ++++
>> >> >>  libavcodec/version.h         |   2 +-
>> >> >>  libavcodec/videotoolbox.c    | 705 +++++++++++++++++++++++++++++++++++++++++++
>> >> >>  libavcodec/videotoolbox.h    | 126 ++++++++
>> >> >>  libavutil/pixdesc.c          |   4 +
>> >> >>  libavutil/pixfmt.h           |   2 +
>> >> >
>> >> > I tried on iOS (iPhone 6+ so last one unless I'm mistaken) with a 240fps
>> >> > footage, and it seems the decode calls take more than 5ms, which seems not
>> >> > enough. Do you have any idea what could cause this? (I'm running a timer
>> >> > after/before avcodec_decode_video*())
>> >>
>> >> 1. kVTDecodeFrame_EnableAsynchronousDecompression can make it faster,
>> >> but not suitable for sync-style API (avcodec_decode_video*())
>> >
>> > not suitable in the sense that it wouldn't work, or it would have
>> > undesirable side effects?
>>
>> It would work, but it would be better and easier if decoder's input
>> and output are decoupled.
>
>> Anyhow, as wm4 said, it's probably not worth the trouble.
>>
>
> Well, if it makes possible for ffmpeg to decode 240fps footage @ 240Hz
> that's kind of worth the trouble IMO. The HW decoder seems to be able to
> decode frames between 700 to 1100µs, which makes it possible to handle
> such material. A factor 5 to 6 with FFmpeg is kind of a problem IMO.

Would you mind to share your 240fps test sample?
I'd like to take a benchmark in my own player with async VideoToolbox.
https://github.com/Bilibili/ijkplayer


More information about the ffmpeg-devel mailing list