On Tue, Sep 23, 2014 at 10:19:17AM +0200, Benoit Fouet wrote: > Hi, > > ----- Mail original ----- > > Hi, > > > > ----- Mail original ----- > > > > [...] > > > > > > > > avienc.c | 7 +++++++ > > > > > > 1 file changed, 7 insertions(+) > > > > > > 8ae96276e07eb00474ab2115f9ff9c3d0f690723 avienc.diff > > > > > > diff --git a/libavformat/avienc.c b/libavformat/avienc.c > > > > > > index c9d8b7f..2855293 100644 > > > > > > --- a/libavformat/avienc.c > > > > > > +++ b/libavformat/avienc.c > > > > > > @@ -299,6 +299,13 @@ static int > > > > > > avi_write_header(AVFormatContext > > > > > > *s) > > > > > > avio_wl32(pb, au_ssize); /* sample size */ > > > > > > avio_wl32(pb, 0); > > > > > > avio_wl16(pb, enc->width); > > > > > > + if ( enc->extradata_size >= 9 > > > > > > + && !memcmp(enc->extradata + enc->extradata_size > > > > > > - > > > > > > 9, > > > > > > "BottomUp", 9)) { > > > > > > + enc->height = -enc->height; > > > > > > > > > > i think its safer not to change AVCodecContext.height and just > > > > > change > > > > > the in the bitstream stored value instead > > > > > > > > > > > > > The issue when doing this is that the BITMAPINFOHEADER is wrong. > > > > So the image is still flipped. > > > > > > Well then you need a local variable/array or value in the avi muxer > > > context. values in AVCodecContext shouldnt really be randomly > > > be overwritten by the muxer > > > > > > > The only thing that is needed is to extend ff_put_bmp_header, so that > > it can be asked to negate height in the BITMAPINFOHEADER header. > > Would that be OK? > > > > Here is a patch to illustrate this...
this looks better but: [...] > - ff_put_bmp_header(pb, enc, ff_codec_bmp_tags, 0, 0); > + if (keep_height) { > + enc->extradata_size -= 9; > + if (!enc->extradata_size) > + av_freep(&enc->extradata); > + } what if extradata is stored in 2 files, the 2nd muxer would no longer see it also the muxer shouldnt change the encoders/demuxer extradata and cant all this logic be put in ff_put_bmp_header() ? might even be simpler [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Let us carefully observe those good qualities wherein our enemies excel us and endeavor to excel them, by avoiding what is faulty, and imitating what is excellent in them. -- Plutarch
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel