diff options
author | Gyan Doshi <ffmpeg@gyani.pro> | 2020-07-08 17:32:25 +0530 |
---|---|---|
committer | Gyan Doshi <ffmpeg@gyani.pro> | 2020-07-15 20:52:01 +0530 |
commit | 1ec2b3de5a074ccce555e33d7f282bbbb6d963d7 (patch) | |
tree | e309c38bf1b3757584ad58e228aa50efb6d8d320 /libavformat/riffenc.c | |
parent | a54b367c781f7735c321e6ac08a5deebeb9796a9 (diff) | |
download | ffmpeg-1ec2b3de5a074ccce555e33d7f282bbbb6d963d7.tar.gz |
avformat/riffenc: indicate storage of flipped RGB bitmaps
Some legacy applications such as AVI2MVE expect raw RGB bitmaps
to be stored bottom-up, whereas our RIFF BITMAPINFOHEADER assumes
they are always stored top-down and thus write a negative value
for height. This can prevent reading of these files.
Option flipped_raw_rgb added to AVI and Matroska muxers
which will write positive value for height when enabled.
Note that the user has to flip the bitmaps beforehand using other
means such as the vflip filter.
Diffstat (limited to 'libavformat/riffenc.c')
-rw-r--r-- | libavformat/riffenc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c index c04d55c423..d0ee98bfcc 100644 --- a/libavformat/riffenc.c +++ b/libavformat/riffenc.c @@ -207,10 +207,11 @@ int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, /* BITMAPINFOHEADER header */ void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par, - int for_asf, int ignore_extradata) + int for_asf, int ignore_extradata, int rgb_frame_is_flipped) { - int keep_height = par->extradata_size >= 9 && - !memcmp(par->extradata + par->extradata_size - 9, "BottomUp", 9); + int keep_height = (par->extradata_size >= 9 && + !memcmp(par->extradata + par->extradata_size - 9, "BottomUp", 9)) || + rgb_frame_is_flipped; int extradata_size = par->extradata_size - 9*keep_height; enum AVPixelFormat pix_fmt = par->format; int pal_avi; |