[FFmpeg-devel] [PATCH] add 'yuvs' to tags list
Andrew Wason
rectalogic
Mon Nov 29 18:48:38 CET 2010
Currently mencoder fails when encoding raw video with format=yuy2
(PIX_FMT_YUYV422) with fourcc 'yuvs' because 'yuvs' is not in the
libavformat/riff.c ff_codec_bmp_tags list and so mencoder uses
CODEC_ID_NONE(0) instead of CODEC_ID_RAWVIDEO(14) for the output
codec.
Attached patch adds 'yuvs' to the list in libavformat. An alternative
is to add it to mp_bmp_tags in mplayer libmpdemux/mp_taglists.c
instead.
$ mencoder test.avi -nosound -of lavf -lavfopts format=mov -ovc raw
-vf format=yuy2,scale -ffourcc yuvs -o out.mov
[...]
VIDEO CODEC ID: 0
Writing header...
[mov @ 0x825de0]Tag yuvs/0x73767579 incompatible with output codec id '0'
Floating point exception
With the patch, it maps 'yuvs' to CODEC_ID_RAWVIDEO(14) and does the encode.
$ mencoder test.avi -nosound -of lavf -lavfopts format=mov -ovc raw
-vf format=yuy2,scale -ffourcc yuvs -o out.mov
[...]
VIDEO CODEC ID: 14
Writing header...
[mov @ 0x825de0]Codec for stream 0 does not use global headers but
container format requires global headers
Pos: 30.0s 900f (99%) 223.60fps Trem: 0min 131mb A-V:0.000 [36864:0]
Flushing video frames.
Writing index...
Video stream: 36864.000 kbit/s (4608000 B/s) size: 138240000 bytes
30.000 secs 900 frames
-------------- next part --------------
Index: libavformat/riff.c
===================================================================
--- libavformat/riff.c (revision 25838)
+++ libavformat/riff.c (working copy)
@@ -162,6 +162,7 @@
{ CODEC_ID_RAWVIDEO, MKTAG('u', 'y', 'v', '1') },
{ CODEC_ID_RAWVIDEO, MKTAG('2', 'V', 'u', '1') },
{ CODEC_ID_RAWVIDEO, MKTAG('2', 'v', 'u', 'y') },
+ { CODEC_ID_RAWVIDEO, MKTAG('y', 'u', 'v', 's') },
{ CODEC_ID_RAWVIDEO, MKTAG('P', '4', '2', '2') },
{ CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', '1', '2') },
{ CODEC_ID_RAWVIDEO, MKTAG('U', 'Y', 'V', 'Y') },
More information about the ffmpeg-devel
mailing list