[FFmpeg-devel] [PATCH] ffplay: support rotated video.

Michael Niedermayer michaelni at gmx.at
Fri May 23 05:15:12 CEST 2014


On Thu, May 22, 2014 at 09:30:05PM +0200, Clément Bœsch wrote:
> On Wed, May 21, 2014 at 05:18:30AM +0200, Michael Niedermayer wrote:
> > On Tue, May 20, 2014 at 07:54:05PM +0200, Clément Bœsch wrote:
> > > On Fri, Apr 18, 2014 at 05:43:35PM -0400, Don Moir wrote:
> > > [...]
> > > > >+    if (autorotate) {
> > > > >+        AVDictionaryEntry *rotate_tag = av_dict_get(is->video_st->metadata, "rotate", NULL, 0);
> > > > >+        if (rotate_tag) {
> > > > >+            if (!strcmp(rotate_tag->value, "90")) {
> > > > >+                INSERT_FILT("transpose", "1");
> > > > >+            } else if (!strcmp(rotate_tag->value, "180")) {
> > > > >+                INSERT_FILT("hflip", NULL);
> > > > >+                INSERT_FILT("vflip", NULL);
> > > > >+            } else if (!strcmp(rotate_tag->value, "270")) {
> > > > >+                INSERT_FILT("transpose", "2");
> > > > >+            } else {
> > > > >+                INSERT_FILT("rotate", rotate_tag->value);
> > > > >+            }
> > > > >+        }
> > > > >+    }
> > > > 
> > > > you might want to do this instead of stcmp. Catches values greater than 360 as well.
> > > > 
> > > > int rotate = atoi(rotate_tag->value) % 360;
> > > > 
> > > 
> > > No I can't, it can be a floating value.
> > 
> > fmod() could be used
> > 
> 
> Right, but I'm not sure it would be more reliable/simple that what i'm
> currently proposing.

no objections, fmod() was just an idea ...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140523/0e6e29a4/attachment.asc>


More information about the ffmpeg-devel mailing list