ffmpeg_cuvid: add 420 10-bit transcode support for hwaccel cuvid
authorsumit <sumita@nvidia.com>
Tue, 31 Jan 2017 15:30:50 +0000 (21:00 +0530)
committerTimo Rothenpieler <timo@rothenpieler.org>
Wed, 1 Feb 2017 13:55:39 +0000 (14:55 +0100)
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
ffmpeg_cuvid.c

index 766878f..baf6eee 100644 (file)
@@ -135,7 +135,7 @@ int cuvid_transcode_init(OutputStream *ost)
          */
         hwframe_ctx = (AVHWFramesContext*)ctx->hw_frames_ctx->data;
         hwframe_ctx->format = AV_PIX_FMT_CUDA;
          */
         hwframe_ctx = (AVHWFramesContext*)ctx->hw_frames_ctx->data;
         hwframe_ctx->format = AV_PIX_FMT_CUDA;
-        hwframe_ctx->sw_format = AV_PIX_FMT_NV12;
+        hwframe_ctx->sw_format = ist->st->codecpar->format == AV_PIX_FMT_YUV420P10 ? AV_PIX_FMT_P010 : AV_PIX_FMT_NV12;
     }
 
     return 0;
     }
 
     return 0;