From 8014b28095f1b3d2559387b7b8aca93b034561cf Mon Sep 17 00:00:00 2001 From: CTCaer Date: Sun, 2 Jul 2023 03:23:34 +0000 Subject: [PATCH 30/39] nvv4l2: add yuv420p10 support NVENC supports yuv420p10 as p010. --- libavcodec/nvv4l2_enc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/nvv4l2_enc.c b/libavcodec/nvv4l2_enc.c index 39a179b255..b979c93051 100644 --- a/libavcodec/nvv4l2_enc.c +++ b/libavcodec/nvv4l2_enc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, CTCaer + * Copyright (c) 2021-2023, CTCaer * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -1130,6 +1130,8 @@ static int nvv4l2enc_init(AVCodecContext *avctx) case AV_PIX_FMT_NV12: pix_fmt = V4L2_PIX_FMT_NV12M; break; + case AV_PIX_FMT_YUV420P10: + avctx->pix_fmt = AV_PIX_FMT_P010; case AV_PIX_FMT_P010: pix_fmt = V4L2_PIX_FMT_P010M; break; @@ -1473,6 +1475,7 @@ static const AVOption options_hevc[] = { AV_PIX_FMT_YUV444P, \ AV_PIX_FMT_NV12, \ AV_PIX_FMT_P010, \ + AV_PIX_FMT_YUV420P10, \ AV_PIX_FMT_NONE }, \ }; -- 2.25.1