Signed-off-by: Brad Hards <[email protected]>
---
libavcodec/libx265.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index a1bd205201..3dceb3d165 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -484,6 +484,8 @@ static int libx265_encode_frame(AVCodecContext *avctx,
AVPacket *pkt,
int nnal;
int ret;
int i;
+ AVFrameSideData *sd;
+ int num_unregistered_sei;
ctx->api->picture_init(ctx->params, &x265pic);
@@ -515,6 +517,17 @@ static int libx265_encode_frame(AVCodecContext *avctx,
AVPacket *pkt,
memcpy(x265pic.userData, &pic->reordered_opaque,
sizeof(pic->reordered_opaque));
}
+ num_unregistered_sei = av_frame_num_side_data(pic,
AV_FRAME_DATA_SEI_UNREGISTERED);
+ x265pic.userSEI.payloads = av_realloc_array(x265pic.userSEI.payloads,
x265pic.userSEI.numPayloads + num_unregistered_sei, sizeof(x265_sei_payload));
+ for (i = 0; i < num_unregistered_sei; i++) {
+ sd = av_frame_get_side_data_n(pic, AV_FRAME_DATA_SEI_UNREGISTERED,
i);
+ if (sd) {
+ x265pic.userSEI.payloads[x265pic.userSEI.numPayloads +
i].payload = sd->data;
+ x265pic.userSEI.payloads[x265pic.userSEI.numPayloads +
i].payloadSize = sd->size;
+ x265pic.userSEI.payloads[x265pic.userSEI.numPayloads +
i].payloadType = USER_DATA_UNREGISTERED;
+ }
+ }
+ x265pic.userSEI.numPayloads += num_unregistered_sei;
}
ret = ctx->api->encoder_encode(ctx->encoder, &nal, &nnal,
--
2.27.0
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".