[Ffmpeg-devel] [PATCH] ffmpeg does not recognize his own grayscale rawvideo avi's
Philippe De Muyter
phdm
Fri Sep 15 10:18:07 CEST 2006
Currently, ffmpeg does not recognize the grayscale rawvideo avi's that he has
produced himself :(. Below is a patch to fix that. Please apply.
Philippe
If you're not convinced, try the following :
Take any pgm file you have. (exemple xxx.pgm)
Copy it to /tmp/x0.pgm
cp xxx.pgm /tmp/x0.pgm
Encode it as rawvideo avi :
ffmpeg -i /tmp/x%1d.pgm -an -vcodec rawvideo /tmp/x0.avi
...
Input #0, image2, from '/tmp/x%1d.pgm':
Duration: 00:00:00.0, start: 0.000000, bitrate: N/A
Stream #0.0: Video: pgm, gray, 320x240, 25.00 fps(r)
Output #0, avi, to '/tmp/x0.avi':
Stream #0.0: Video: rawvideo, gray, 320x240, q=2-31, 200 kb/s, 25.00 fps(c)
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 1 q=0.0 Lsize= 81kB time=0.0 bitrate=16500.8kbits/s
video:75kB audio:0kB global headers:0kB muxing overhead 7.427083%
Try to decode the avi to remake a pgm
./ffmpeg -i /tmp/x0.avi /tmp/y%1d.pgm
...
[avi @ 0x8406430]Could not find codec parameters (Video: Y800 / 0x30303859, 320x240)
/tmp/x0.avi: could not find codec parameters
Decoding with the patched version :
./ffmpeg -i /tmp/x0.avi /tmp/y%1d.pgm
...
Input #0, avi, from '/tmp/x0.avi':
Duration: 00:00:00.0, start: 0.000000, bitrate: 16500 kb/s
Stream #0.0: Video: rawvideo, gray, 320x240, 25.00 fps(r)
Output #0, image2, to '/tmp/y%1d.pgm':
Stream #0.0: Video: pgm, gray, 320x240, q=2-31, 200 kb/s, 25.00 fps(c)
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 1 q=0.0 Lsize= 0kB time=0.0 bitrate= 0.0kbits/s
video:75kB audio:0kB global headers:0kB muxing overhead -100.000000%
The patch :
Index: libavformat/riff.c
===================================================================
--- libavformat/riff.c (revision 6242)
+++ libavformat/riff.c (working copy)
@@ -110,6 +110,7 @@
{ CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', '1', '2') },
{ CODEC_ID_RAWVIDEO, MKTAG('U', 'Y', 'V', 'Y') },
{ CODEC_ID_RAWVIDEO, MKTAG('I', 'Y', 'U', 'V') },
+ { CODEC_ID_RAWVIDEO, MKTAG('Y', '8', '0', '0') },
{ CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '1') },
{ CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '2') },
{ CODEC_ID_VP3, MKTAG('V', 'P', '3', '1') },
--
More information about the ffmpeg-devel
mailing list