[Ffmpeg-devel] uncompressed AVI output problem

DKorchev at aol.com DKorchev
Fri Jan 27 01:44:27 CET 2006


Hi,
 
I was trying to use ffmpeg to convert video into uncompressed AVI  ("-vcodec 
rawvideo" option) format and I found that output uncompressed AVI  file cannot 
be used by Microsoft utility UncompAVIToWMV. 
 
I was able to fix this problem in ffmpeg\libavformat\avienc.c file by  
changing depth to 12 instead of 24 and frame buffer size to 1.5 * (width*height)  
instead of 3, see the changes in red below.
 
 
I also think that these parameters are more logical for the video  format 
I420 (yuv420).
 
Any suggestions?
 
Thanks,
 
Dmitriy Korchev

 
 
 
/* BITMAPINFOHEADER header */
void put_bmp_header(ByteIOContext *pb,  AVCodecContext *enc, const CodecTag 
*tags, int  for_asf)
{
put_le32(pb, 40 + enc->extradata_size);  /* size */
put_le32(pb,  enc->width);
put_le32(pb,  enc->height);
put_le16(pb, 1); /* planes  */

put_le16(pb,  enc->bits_per_sample ? enc->bits_per_sample : 12); /* depth */
/* compression type  */
put_le32(pb, for_asf ? codec_get_asf_tag(tags,  enc->codec_id) : 
enc->codec_tag);
put_le32(pb,  enc->width * enc->height * 3/2);
put_le32(pb,  0);
put_le32(pb, 0);
put_le32(pb,  0);
put_le32(pb, 0);

put_buffer(pb, enc->extradata,  enc->extradata_size);
 
    if (enc->extradata_size &  1)
put_byte(pb,  0);
}   
 
 
 
 




More information about the ffmpeg-devel mailing list