[Bug 696019] New: videoscale does not preserve DAR with add-borders=TRUE

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Sun Mar 17 16:50:12 PDT 2013


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

           Summary: videoscale does not preserve DAR with add-borders=TRUE
    Classification: Platform
           Product: GStreamer
           Version: 1.0.5
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: jan581984 at web.de
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Created an attachment (id=239085)
 --> (https://bugzilla.gnome.org/attachment.cgi?id=239085)
Corrected calculation of DAR and border size in gst_video_scale_set_info

When rescaling a video-stream from 1280x720 with PAR=1/1 to 720x576 with
PAR=64/45 (both have a DAR=16/9) videoscale adds black borders, although they
should be superflous, and the resulting picture is shrinked in height. This can
be reproduced with

gst-launch-1.0 videotestsrc ! video/x-raw, width=1280, height=720,
pixel-aspect-ratio=1/1 ! videoscale add-borders=TRUE ! video/x-raw, width=720,
height=576, pixel-aspect-ratio=64/45 ! autovideosink

I've found the reason in gst_video_scale_set_info: The DAR on the sink side is
calculated using the PAR on the src side.

While checking the function, I found a second flaw: When calculating the size
of the borders that should be added, the ratio of the destination width and
height is calculated as the product of the DAR on the sink side and the PAR on
the src side. However, one has to use the inverse of the PAR on the src side.
This error results in wrong DARs, too. It can be reproduced with

gst-launch-1.0 videotestsrc ! video/x-raw, width=1020, height=576,
pixel-aspect-ratio=64/45 ! videoscale add-borders=TRUE ! video/x-raw,
width=720, height=576, pixel-aspect-ratio=64/45 ! autovideosink

The black borders are far to big.

A minor correction: In the debug message at the end of the same function the
PAR of the src side is used instead of the PAR of the sink side.

I've put the corrections into the attached file. With these corrections the two
examples work as expected.

-- 
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