Changing resolution on secondary GST pipeline reflects on main pipeline

Hello! In the example code attached, one can see that I’m setting the appsink caps to the resolution 640x480
However this is on a secondary pipeline. In the main pipeline I’m capturing video from the camera at 1280x720 and I’m streaming it over UDP using RDP. The pipeline are split using a tee.

This is working fine, the only problem is that the resolution that I’m capturing from the UDP stream is the 640x480

Somehow, when setting the resolution on the secondary pipeline (the one that contains the app sink) is making the resolution in the primary pipeline change as well

Am I doing something wrong? I cannot figure out why this is happening

Thanks!

Pipeline should look like this:

sample_tee.py (3.6 KB)

Hi,
You would need to clearly set resolution at source pad of nvvidconv plugin:

... ! nvvidconv ! video/x-raw,width=1280,height=720 ! tee ! ...

And do downscale in videoconvert plugin:

... ! videoconvert ! video/x-raw,width=640,height=480 !

It should work by setting clear capability.

The source pad of nvvidconv would be the filter element? Am I not doing that already in the code? On line 19 I’m setting the caps of the camera filter

And about the videoconvert plugin, you mean I should change the properties of the videoconvert itself, instead of setting the caps on the appsink? I’ve tried doing that, but the videoconvert element doesn’t have a caps property. How would I do that in the Python code?

Thanks!

Hi,
You may change

if not Gst.Element.link(nv_vid_conv, tee):
    print("3 Elements could not be linked.")
    exit(-1)

to

if not Gst.Element.link(nv_vid_conv, conv_filter):
    print("3 Elements could not be linked.")
    exit(-1)

if not Gst.Element.link(conv_filter, tee):
    print("3 Elements could not be linked.")
    exit(-1)

And set conv_filter to video/x-raw,width=1280,height=720.

1 Like

Thanks for all the help!
I see what you mean, and that “conv_filter” would be a videoconvert element? If yes, that’s what I’ve tried already. The only way that I know of to set those kind of properties in Python is using caps elements, but a videoconvert element doesn’t have caps elements

Thanks DaneLLL, it worked! I had to add a scale between the video_convert and appsink, since now the resolutions are actually different

If anyone wants the updated version, I’m attaching it

sample_tee.py (4.3 KB)