]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libutvideoenc.cpp
libutvideoenc: Add support for the new BT.709 FourCCs for YCbCr
[ffmpeg] / libavcodec / libutvideoenc.cpp
index ad70669a6b867667c28fa70cc0d77cfea08c88a8..f0d56194b4a5b69671b850288dda5f8b8595e4fc 100644 (file)
@@ -44,12 +44,18 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
     case AV_PIX_FMT_YUV420P:
         in_format = UTVF_YV12;
         avctx->bits_per_coded_sample = 12;
-        avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
+        if (avctx->colorspace == AVCOL_SPC_BT709)
+            avctx->codec_tag = MKTAG('U', 'L', 'H', '0');
+        else
+            avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
         break;
     case AV_PIX_FMT_YUYV422:
         in_format = UTVF_YUYV;
         avctx->bits_per_coded_sample = 16;
-        avctx->codec_tag = MKTAG('U', 'L', 'Y', '2');
+        if (avctx->colorspace == AVCOL_SPC_BT709)
+            avctx->codec_tag = MKTAG('U', 'L', 'H', '2');
+        else
+            avctx->codec_tag = MKTAG('U', 'L', 'Y', '2');
         break;
     case AV_PIX_FMT_BGR24:
         in_format = UTVF_NFCC_BGR_BU;