Distorted video when using videoflip, videoscale and a video with image-orientation tag

Nicolas Dufresne nicolas at ndufresne.ca
Thu Dec 17 19:18:44 UTC 2020


Le mercredi 16 décembre 2020 à 04:43 -0600, domsch a écrit :
> Thanks for your answer, unfortunately adding pixel-aspect-ratio=1/1 to the
> caps does not solve the problem.
> I used the following command:
> 
> gst-launch-1.0 -v playbin uri=file:///home/dmsch/portrait-fhd.mp4
> video-sink="videoflip method=automatic ! videoscale !
> video/x-raw,width=540,height=960,pixel-aspect-ratio=1/1 ! ximagesink"

At this point, you'll have to share the specific stream to allow us to check if
we can reproduce.

> 
> 
> Nicolas Dufresne-5 wrote
> > Le vendredi 11 décembre 2020 à 03:24 -0600, domsch a écrit :
> > > I'm having problems displaying portrait orientation videos that have an
> > > image-orientation tag (rotate-90).
> > > To automatically rotate the video I'm using videoflip (method=automatic).
> > > My video has a resolution of 1080x1920 and I want to scale it down to
> > > 540x960.
> > > 
> > > But gst-launch shows a distorted image:
> > > gst-launch-1.0 -v playbin uri=file:///home/dmsch/portrait-fhd.mp4
> > > video-sink="videoflip method=automatic ! videoscale !
> > > video/x-raw,width=540,height=960 ! ximagesink"
> > 
> > You need to specify an aspect ratio:
> > 
> >   video/x-raw,width=540,height=960,pixel-aspect-ratio=1/1
> > 
> > I don't remember why ximagesink does not force squared pixel aspect ratio,
> > there
> > wa a reason, but by fixing the aspect ratio you prevent videoscale from
> > scaling
> > that field rather then actually doing the scaling job. You should notice
> > in the
> > CPU load the difference. It's a very common trap.
> > 
> > Nicolas
> > 
> > > 
> > > Screenshot: https://imgur.com/a/XRvh6ZN
> > > Video:
> > > https://drive.google.com/file/d/1mYWEpHsWQljhBGlBB4RPgDe8qAuKm3r_/view?usp=sharing
> > > 
> > > 
> > > 
> > > --
> > > Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> > > _______________________________________________
> > > gstreamer-devel mailing list
> > > 
> 
> > gstreamer-devel at .freedesktop
> 
> > > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > 
> > 
> > _______________________________________________
> > gstreamer-devel mailing list
> 
> > gstreamer-devel at .freedesktop
> 
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> 
> 
> 
> 
> 
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




More information about the gstreamer-devel mailing list