[FFmpeg-devel] [PATCH] Extract rotation in MOV metadata
Stefano Sabatini
stefano.sabatini-lala at poste.it
Sat Apr 30 00:55:09 CEST 2011
On date Tuesday 2011-04-05 16:53:32 -0700, Baptiste Coudurier encoded:
> Hi Dave,
>
> On 04/05/2011 04:49 PM, Dave Badia wrote:
[...]
> > Interrogate MOV metadata for orientation of video so that software can
> > determine if the video needs to be rotated.
> > ---
> > libavformat/mov.c | 4 ++++
> > 1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/libavformat/mov.c b/libavformat/mov.c
> > index 23ba1d4..b12890f 100644
> > --- a/libavformat/mov.c
> > +++ b/libavformat/mov.c
> > @@ -1907,6 +1907,10 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb,
> > MOVAtom atom)
> > sc->width = width >> 16;
> > sc->height = height >> 16;
> >
> > + if (display_matrix[0][0] == -65536 && display_matrix[1][1] == -65536) {
> > + av_metadata_set2(&c->fc->metadata, "rotate", "180", 0);
> > + }
It was already said, but why such a specific check? IMO it would much
more useful to export the rotation information (e.g. 90, 180,
etc.). Which are the acceptable rotation values?
Also, how should we export this information to the application level
(e.g. for auto-inserting a corresponding rotation filter at the begin
of the filterchain)?
IIRC Baptiste proposed some time ago a patch for adding that
information to AVStream, what happened of that?
--
FFmpeg = Funny and Freak Majestic Puritan Elitarian Game
More information about the ffmpeg-devel
mailing list