diff options
author | Damiano Galassi <[email protected]> | 2021-02-28 11:41:03 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2021-02-28 11:41:03 +0100 |
commit | 7e097b44def027e95ff4b2c2653fcf0cdc0fc0cf (patch) | |
tree | 25fd261f2db898ece66ce5f6f26ac360da4ab676 /contrib/ffmpeg | |
parent | ff55c0c1bfd1436305ea06c07e1f674c83bddb2e (diff) |
libhb: add videotoolbox 10bit hevc encoder.
Diffstat (limited to 'contrib/ffmpeg')
-rw-r--r-- | contrib/ffmpeg/A24-videotoolbox-hevc-profile.patch | 26 | ||||
-rw-r--r-- | contrib/ffmpeg/A25-videotoolbox-trc.patch | 31 |
2 files changed, 57 insertions, 0 deletions
diff --git a/contrib/ffmpeg/A24-videotoolbox-hevc-profile.patch b/contrib/ffmpeg/A24-videotoolbox-hevc-profile.patch new file mode 100644 index 000000000..4ac11bd55 --- /dev/null +++ b/contrib/ffmpeg/A24-videotoolbox-hevc-profile.patch @@ -0,0 +1,26 @@ +diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c +index cc08cf6..eeee196 100644 +--- a/libavcodec/videotoolboxenc.c ++++ b/libavcodec/videotoolboxenc.c +@@ -1113,15 +1113,12 @@ static int vtenc_create_encoder(AVCodecContext *avctx, + } + } + +- if (vtctx->codec_id == AV_CODEC_ID_H264) { +- // kVTCompressionPropertyKey_ProfileLevel is not available for HEVC +- if (profile_level) { +- status = VTSessionSetProperty(vtctx->session, +- kVTCompressionPropertyKey_ProfileLevel, +- profile_level); +- if (status) { +- av_log(avctx, AV_LOG_ERROR, "Error setting profile/level property: %d. Output will be encoded using a supported profile/level combination.\n", status); +- } ++ if (profile_level) { ++ status = VTSessionSetProperty(vtctx->session, ++ kVTCompressionPropertyKey_ProfileLevel, ++ profile_level); ++ if (status) { ++ av_log(avctx, AV_LOG_ERROR, "Error setting profile/level property: %d. Output will be encoded using a supported profile/level combination.\n", status); + } + } + diff --git a/contrib/ffmpeg/A25-videotoolbox-trc.patch b/contrib/ffmpeg/A25-videotoolbox-trc.patch new file mode 100644 index 000000000..dc0242def --- /dev/null +++ b/contrib/ffmpeg/A25-videotoolbox-trc.patch @@ -0,0 +1,31 @@ +diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c +index cc08cf6..1d83408 100644 +--- a/libavcodec/videotoolboxenc.c ++++ b/libavcodec/videotoolboxenc.c +@@ -940,21 +940,17 @@ static int get_cv_transfer_function(AVCodecContext *avctx, + *transfer_fnc = kCVImageBufferTransferFunction_SMPTE_240M_1995; + break; + +-#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_SMPTE_ST_2084_PQ + case AVCOL_TRC_SMPTE2084: +- *transfer_fnc = kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ; ++ *transfer_fnc = CFSTR("SMPTE_ST_2084_PQ"); + break; +-#endif +-#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_LINEAR ++ + case AVCOL_TRC_LINEAR: +- *transfer_fnc = kCVImageBufferTransferFunction_Linear; ++ *transfer_fnc = CFSTR("Linear"); + break; +-#endif +-#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2100_HLG ++ + case AVCOL_TRC_ARIB_STD_B67: +- *transfer_fnc = kCVImageBufferTransferFunction_ITU_R_2100_HLG; ++ *transfer_fnc = CFSTR("ITU_R_2100_HLG"); + break; +-#endif + + case AVCOL_TRC_GAMMA22: + gamma = 2.2; |