[solved]Downscale resolution from 1080 to 720 with gstreamer

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

goldyfruit

  • Posts: 9
  • Joined: Mon Apr 26, 2021 6:47 pm
  • Real Name: Gaëtan Trellu

[solved]Downscale resolution from 1080 to 720 with gstreamer

PostThu Jun 10, 2021 3:52 pm

Hi,

I have an Intensity Pro 4K running on my Linux desktop, connected to the input I have a camera with a 1920x1080 resolution.

I'm trying to resize the resolution from 1920x1080 to 1280x720 but I keep having the following error:
Code: Select all
ERROR: from element /GstPipeline:pipeline0/GstDecklinkVideoSrc:decklinkvideosrc0: Internal data stream error.

Here is the working command and the output without the resize.
Code: Select all
$ gst-launch-1.0 decklinkvideosrc mode=13 connection=2 ! videoconvert ! v4l2sink device="/dev/video0" -v

Output:
Code: Select all
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstDecklinkVideoSrc:decklinkvideosrc0: hw-serial-number =
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstDecklinkVideoSrc:decklinkvideosrc0: signal = true
/GstPipeline:pipeline0/GstDecklinkVideoSrc:decklinkvideosrc0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)interleaved, framerate=(fraction)30/1, field-order=(string)top-field-first, format=(string)UYVY, colorimetry=(string)bt709, chroma-site=(string)mpeg2
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)interleaved, framerate=(fraction)30/1, field-order=(string)top-field-first, format=(string)YUY2, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0.GstPad:sink: caps = video/x-raw, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)interleaved, framerate=(fraction)30/1, field-order=(string)top-field-first, format=(string)YUY2, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)interleaved, framerate=(fraction)30/1, field-order=(string)top-field-first, format=(string)UYVY, colorimetry=(string)bt709, chroma-site=(string)mpeg2
Redistribute latency...

And here is the resize command that returns the error:
Code: Select all
$ gst-launch-1.0 decklinkvideosrc mode=13 connection=auto ! videoscale ! video/x-raw,width=1280,height=720 ! videoconvert ! v4l2sink device="/dev/video0" -v

Output:
Code: Select all
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstDecklinkVideoSrc:decklinkvideosrc0: hw-serial-number =
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstDecklinkVideoSrc:decklinkvideosrc0: signal = true
/GstPipeline:pipeline0/GstDecklinkVideoSrc:decklinkvideosrc0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)interleaved, framerate=(fraction)30/1, field-order=(string)top-field-first, format=(string)UYVY, colorimetry=(string)bt709, chroma-site=(string)mpeg2
Redistribute latency...
ERROR: from element /GstPipeline:pipeline0/GstDecklinkVideoSrc:decklinkvideosrc0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstDecklinkVideoSrc:decklinkvideosrc0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.068741187
Setting pipeline to NULL ...
Freeing pipeline ...

Thanks for your help. ;)
Last edited by goldyfruit on Thu Jun 10, 2021 5:07 pm, edited 1 time in total.
Offline

goldyfruit

  • Posts: 9
  • Joined: Mon Apr 26, 2021 6:47 pm
  • Real Name: Gaëtan Trellu

Re: Downscale resolution from 1080 to 720 with gstreamer

PostThu Jun 10, 2021 4:42 pm

Here is the output with GST_DEBUG=2:
Code: Select all
/GstPipeline:pipeline0/GstDecklinkVideoSrc:decklinkvideosrc0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)interleaved, framerate=(fraction)30/1, field-order=(string)top-field-first, format=(string)UYVY, colorimetry=(string)bt709, chroma-site=(string)mpeg2
0:00:00.146993429 266777 0x55ae071a3120 WARN           basetransform gstbasetransform.c:1370:gst_base_transform_setcaps:<videoconvert0> transform could not transform video/x-raw, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)interleaved, framerate=(fraction)30/1, field-order=(string)top-field-first, format=(string)UYVY, colorimetry=(string)bt709, chroma-site=(string)mpeg2 in anything we support
Redistribute latency...
0:00:00.147193288 266777 0x55ae071a3120 WARN           basetransform gstbasetransform.c:1370:gst_base_transform_setcaps:<videoconvert0> transform could not transform video/x-raw, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)interleaved, framerate=(fraction)30/1, field-order=(string)top-field-first, format=(string)UYVY, colorimetry=(string)bt709, chroma-site=(string)mpeg2 in anything we support
0:00:00.147329727 266777 0x55ae071a3120 WARN           basetransform gstbasetransform.c:1370:gst_base_transform_setcaps:<videoconvert0> transform could not transform video/x-raw, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)interleaved, framerate=(fraction)30/1, field-order=(string)top-field-first, format=(string)UYVY, colorimetry=(string)bt709, chroma-site=(string)mpeg2 in anything we support
0:00:00.147349107 266777 0x55ae071a3120 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<decklinkvideosrc0> error: Internal data stream error.
0:00:00.147353337 266777 0x55ae071a3120 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<decklinkvideosrc0> error: streaming stopped, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstDecklinkVideoSrc:decklinkvideosrc0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstDecklinkVideoSrc:decklinkvideosrc0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.082370193
Setting pipeline to NULL ...
0:00:00.147507926 266777 0x55ae071a3120 WARN           basetransform gstbasetransform.c:1370:gst_base_transform_setcaps:<videoconvert0> transform could not transform video/x-raw, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)interleaved, framerate=(fraction)30/1, field-order=(string)top-field-first, format=(string)UYVY, colorimetry=(string)bt709, chroma-site=(string)mpeg2 in anything we support

It seems that the transformation I'm trying to do is not supported.
Offline

goldyfruit

  • Posts: 9
  • Joined: Mon Apr 26, 2021 6:47 pm
  • Real Name: Gaëtan Trellu

Re: Downscale resolution from 1080 to 720 with gstreamer

PostThu Jun 10, 2021 5:07 pm

I found the issue, for some reason I had to specify the "video-format" option. So the final working command is:
Code: Select all
$ gst-launch-1.0 decklinkvideosrc mode=13 connection=2 video-format=2 ! videoconvert ! videoscale ! video/x-raw,width=1280,height=720 ! v4l2sink device="/dev/video0"

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 3 guests