[FFmpeg-devel] output rawvideo 32bit

Michael Niedermayer michaelni at gmx.at
Sat Dec 17 03:28:17 CET 2011


On Fri, Dec 16, 2011 at 09:05:30AM +0100, Rik Maes wrote:
> Hi folks,
> 
> my (and obviously not only my) problem :
>  " ffmpeg.exe -i abcd.xxx -vcodec rawvideo -pix_fmt rgb32 -y out.avi  "
> doesn't work : the out.avi is not a valid avi file.
> 
> my solution :
> in file " riff.c " (in libavformat folder) :
> 
> "
> /* BITMAPINFOHEADER header */
> void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const
> AVCodecTag *tags, int for_asf)
> {
>     avio_wl32(pb, 40 + enc->extradata_size); /* size */
>     avio_wl32(pb, enc->width);
>     //We always store RGB TopDown
>     avio_wl32(pb, enc->codec_tag ? enc->height : -enc->height);
>     avio_wl16(pb, 1); /* planes */
>     avio_wl16(pb, enc->bits_per_coded_sample ? enc->bits_per_coded_sample :
> 24); /* depth */
>     /* compression type */
>     avio_wl32(pb, enc->codec_tag);
>     avio_wl32(pb, enc->width * enc->height * 3);
> <==================   (line 520 in this file)
>     ...
> "
> should be : " ... enc->width * enc->height * 4); " for all rawvideo 32bit
> flavors.
> 
> So replacing line 520 with :
>    "  avio_wl32(pb, enc->width * enc->height * (enc->bits_per_coded_sample
> >>3));  "
> does the job.
> 
> I hope this idea will help to improve your fantastic project.

yes, thank you alot, ive fixed it

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111217/1ffd8831/attachment.asc>


More information about the ffmpeg-devel mailing list