[Bug 725418] videoscale ignores add-borders property - Always maintains aspect ratio.

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Mar 3 09:50:06 PST 2014


https://bugzilla.gnome.org/show_bug.cgi?id=725418
  GStreamer | gst-plugins-base | git

Nicolas Dufresne <nicolas.dufresne> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nicolas.dufresne at collabora.
                   |                            |co.uk

--- Comment #3 from Nicolas Dufresne <nicolas.dufresne at collabora.co.uk> 2014-03-03 18:12:19 UTC ---
The default, and most common use case in GStreamer is to preserve aspect ratio.
So let's have a look at some caps:

gst-launch-1.0 -v videotestsrc ! video/x-raw,width=300,height=300 ! videoscale
! video/x-raw,width=600,height=300 ! xvimagesink

videotestsrc will produce, 300x300 with 1/1 aspect ratio.
videoscale Will scale width from 300 to 600 and set aspect ratio to 2/1
xvimagesink will respect ratio, and will display a 300x300 window by scaling
down

gst-launch-1.0 -v videotestsrc ! video/x-raw,width=300,height=300 ! videoscale
! video/x-raw,width=600,height=300,pixel-aspect-ratio=1/1 ! xvimagesink

Now we addup a constraint, we fixed the display aspect ratio. videotestsrc will
do the same, but videoscale will still want to keep aspect ratio and will add
black porders.

gst-launch-1.0 -v videotestsrc ! video/x-raw,width=300,height=300 ! videoscale
add-borders=0 ! video/x-raw,width=600,height=300,pixel-aspect-ratio=1/1 !
xvimagesink

This time, with add-borders to zero, video scale is forced to break the display
aspect ratio (what you want) in order to comply with the downstream
requirement. So videoscale will scale the width from 300 to 600, but
pixel-aspect-ratio will remain 1/1.

Basically breaking the aspect ratio will only be done at last resort, but is
still better then failing the pipeline. Forcing videoscale to break aspect
ratio isn't easy, and setting downstream caps is the way forward.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list