[FFmpeg-devel] [PATCH]Partly support MS cyuv

Carl Eugen Hoyos cehoyos at ag.or.at
Wed Jan 4 22:00:33 CET 2012


Hi!

Fourcc cyuv can be both Creative yuv and uyvy422 rawvideo (as defined by 
Microsoft).
Attached patch allows to decode samples/CYUV.AVI with -vcodec rawvideo.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index 42469fd..18041cb 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -63,6 +63,7 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
     { PIX_FMT_UYVY422, MKTAG('A', 'V', 'u', 'p') },
     { PIX_FMT_UYVY422, MKTAG('V', 'D', 'T', 'Z') }, /* SoftLab-NSK VideoTizer */
     { PIX_FMT_UYVY422, MKTAG('a', 'u', 'v', '2') },
+    { PIX_FMT_UYVY422, MKTAG('c', 'y', 'u', 'v') },
     { PIX_FMT_UYYVYY411, MKTAG('Y', '4', '1', '1') },
     { PIX_FMT_GRAY8,   MKTAG('G', 'R', 'E', 'Y') },
     { PIX_FMT_NV12,    MKTAG('N', 'V', '1', '2') },
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index acaa0ea..e48e385 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -119,6 +119,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
     avctx->coded_frame= &context->pic;
 
     if((avctx->extradata_size >= 9 && !memcmp(avctx->extradata + avctx->extradata_size - 9, "BottomUp", 9)) ||
+        avctx->codec_tag == MKTAG('c','y','u','v') ||
         avctx->codec_tag == MKTAG(3, 0, 0, 0) || avctx->codec_tag == MKTAG('W','R','A','W'))
         context->flip=1;
 


More information about the ffmpeg-devel mailing list