#7704 closed defect (fixed)

8-bit pixel format is used when decoding 10-bit video using VideoToolbox

Reported by: fumoboy007 Owned by: tmm1
Priority: normal Component: avcodec
Version: git-master Keywords: videotoolbox
Cc: ffmpeg@tmm1.net Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:
kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange is always used regardless of the bit depth of the video.

Attachments (2)

VideoToolbox_10bit.patch (4.5 KB) - added by fumoboy007 19 months ago.
0001-Support-10-bit-color-when-using-VideoToolbox-to-deco.patch (4.9 KB) - added by fumoboy007 17 months ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 19 months ago by fumoboy007

  • Keywords hwaccel added

comment:2 Changed 19 months ago by cehoyos

  • Keywords 10bit hdr hwaccel removed

comment:3 Changed 19 months ago by fumoboy007

Here is an unfinished patch. It is unfinished because we should probably check at runtime for macOS 10.13+ before using the 10-bit pixel format since that is when it was introduced. I don’t have time in the immediate future to figure out how to check the macOS version at runtime.

Changed 19 months ago by fumoboy007

comment:4 Changed 17 months ago by tmm1

  • Cc ffmpeg@tmm1.net added
  • Owner set to tmm1
  • Status changed from new to open

Could you please submit git-format-patch version of the patch including Author info so we can commit it? There are some patterns used to define missing symbols on older versions of macOS which I can add to make this patch complete.

comment:5 Changed 17 months ago by fumoboy007

Thanks for picking this up! I’ve attached the patch. Let me know if there is anything else you need.

comment:6 Changed 17 months ago by tmm1

Thanks. I forgot to specify that ffmpeg-devel is the preferred place for patches, so they can be more widely reviewed.

As far as macOS compatibility, you can refer to how I added compatibility checks for kCMVideoCodecType_HEVC here:


If you feel so inclined, take a stab at adding compatibility using the approach above and send the new patch to the ffmpeg-devel list. If not, I will plan to pick this up in a few weeks and do the same. Thanks for your contribution!

comment:7 Changed 16 months ago by cehoyos

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.