Distorted video when using videoflip, videoscale and a video with image-orientation tag
Nicolas Dufresne
nicolas at ndufresne.ca
Fri Dec 11 16:18:57 UTC 2020
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 lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
More information about the gstreamer-devel
mailing list