After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 752913 - Compositor doesn't show input video at correct scale
Compositor doesn't show input video at correct scale
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.5.2
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-27 07:41 UTC by Mathieu Hinderyckx
Modified: 2018-11-03 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mathieu Hinderyckx 2015-07-27 07:41:54 UTC
When using the compositor to display videos with the width parameter, compositor doesn't lead to correct displaying (videomixer does)

VIDEOMIXER (correct):

gst-launch-1.0 videomixer name=mix sink_1::xpos=1920 sink_2::ypos=1080 sink_3::xpos=1920 sink_3::ypos=1080 ! videoconvert ! xvimagesink \
  videotestsrc pattern=1 ! \
  video/x-raw,format=I420,framerate=\(fraction\)10/1,width=1920,height=1080 ! \
    timeoverlay text="Lossless:" shaded-background=true ! queue ! \
    mix.sink_0 \
  videotestsrc pattern=5 ! \
  video/x-raw,format=I420,framerate=\(fraction\)10/1,width=1920,height=1080 ! \
    timeoverlay text="1080p "  shaded-background=true ! queue ! \
    mix.sink_1 \
  videotestsrc pattern=9 ! \
  video/x-raw,format=I420,framerate=\(fraction\)10/1,width=1280,height=720 ! \
    videoscale ! video/x-raw,width=1920 ! \
    timeoverlay text="720p" shaded-background=true ! queue ! \
    mix.sink_2 \
  videotestsrc pattern=1 ! \
  video/x-raw,format=I420,framerate=\(fraction\)10/1,width=960,height=540 ! \
    videoscale ! video/x-raw,width=1920 ! \
    timeoverlay text="540p"  shaded-background=true ! queue ! \
    mix.sink_3

COMPOSITOR (wrong):

gst-launch-1.0 compositor name=mix sink_1::xpos=1920 sink_2::ypos=1080 sink_3::xpos=1920 sink_3::ypos=1080 ! videoconvert ! xvimagesink \
  videotestsrc pattern=1 ! \
  video/x-raw,format=I420,framerate=\(fraction\)10/1,width=1920,height=1080 ! \
    timeoverlay text="Lossless:" shaded-background=true ! queue ! \
    mix.sink_0 \
  videotestsrc pattern=5 ! \
  video/x-raw,format=I420,framerate=\(fraction\)10/1,width=1920,height=1080 ! \
    timeoverlay text="1080p "  shaded-background=true ! queue ! \
    mix.sink_1 \
  videotestsrc pattern=9 ! \
  video/x-raw,format=I420,framerate=\(fraction\)10/1,width=1280,height=720 ! \
    videoscale ! video/x-raw,width=1920 ! \
    timeoverlay text="720p" shaded-background=true ! queue ! \
    mix.sink_2 \
  videotestsrc pattern=1 ! \
  video/x-raw,format=I420,framerate=\(fraction\)10/1,width=960,height=540 ! \
    videoscale ! video/x-raw,width=1920 ! \
    timeoverlay text="540p"  shaded-background=true ! queue ! \
    mix.sink_3

The compositor adds a gray area to the right and does not show the correct height for the lowest 2 videos. When adding the height=1080 as parameter to the last 2 videoscale elements, displaying is correct.
Comment 1 Matthew Waters (ystreet00) 2015-07-27 08:12:20 UTC
Actually, videoscale/compositor's behaviour is valid.  In the videomixer case, the pixel-aspect-ratio is 1/1 everywhere however in the compositor case, the pixel-aspect-ratio happens to be != 1/1 so videoscale doesn't actually perform any actual scaling.  It just sets the par to make the width=1920 filter happy.  compositor then actually converts this non 1/1 par into the output par (which is 1/1) and it results in the original stream size.

Specifying either the pixel-aspect-ratio=1/1 or height=1080 in the caps filter after videoscale will fix this.

Although in order to avoid possibly scaling twice (once in videoscale and once in compositor) you should remove the videoscale and just set the width/height properties on the compositor sink pads.

The gray area to the right is a problem and is due to not having enough information at the time of setting the source caps.  A work around is to explicitly set the output size.
Comment 2 Mathieu Hinderyckx 2015-07-27 08:36:06 UTC
Setting the height parameter in the videoscale indeed fixes this. Removing the videoscale alltogether and setting width/height on the compositor sinks fixes this as well, but then you lose the option of specifying the scaling method.
Comment 3 GStreamer system administrator 2018-11-03 13:39:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/290.