1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

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.
This commit is contained in:
Gyan Doshi
2020-07-08 17:32:25 +05:30
parent a54b367c78
commit 1ec2b3de5a
7 changed files with 27 additions and 8 deletions

View File

@@ -241,7 +241,7 @@ static void put_videoinfoheader2(AVIOContext *pb, AVStream *st)
avio_wl32(pb, 0);
avio_wl32(pb, 0);
ff_put_bmp_header(pb, st->codecpar, 0, 1);
ff_put_bmp_header(pb, st->codecpar, 0, 1, 0);
if (st->codecpar->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
int padding = (st->codecpar->extradata_size & 3) ? 4 - (st->codecpar->extradata_size & 3) : 0;