UDP camera gstreamer pipeline errors with nv plugins

I’m trying to get a UDP camera into a ROS2 camera topic using a package called gscam2 and I am running into some issues that I think might be due to the nv plugins for gstreamer so I need a bit of help with the pipeline string, I have a udp camera connected and I can visualize the video with this gst-launch-1.0 command:

gst-launch-1.0 udpsrc port=50008 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! queue ! h264parse ! nvv4l2decoder ! queue ! nvvidconv ! fpsdisplaysink

Im trying to use that as an input to gscam by setting the following env variable:

export GSCAM_CONFIG='udpsrc port=50008 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! queue ! h264parse ! nvv4l2decoder ! queue ! nvvidconv"

However I get the following error:

[FATAL] [1715812318.234746933] [gscam_publisher]: Cannot link outelement("nvvconv0") -> sink

I tried with a simple pipeline with 'videotestsrc ! video/x-raw, format=BGRx ! videoconvert' and that works, but not with the above settings. Any ideas on what is wrong? the following is the full output:

$ export GSCAM_CONFIG='udpsrc port=50008 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! queue ! h264parse ! nvv4l2decoder ! queue ! nvvidconv'

$ ros2 run gscam2 gscam_main --ros-args -p camera_info_url:=file://$PWD/my_camera.ini
[INFO] [1715812631.997915183] [gscam_publisher]: use_intra_process_comms=0
[INFO] [1715812631.998675774] [gscam_publisher]: gst_plugin_path = 
[INFO] [1715812631.998721311] [gscam_publisher]: gscam_config = 
[INFO] [1715812631.998743583] [gscam_publisher]: sync_sink = true
[INFO] [1715812631.998759232] [gscam_publisher]: preroll = false
[INFO] [1715812631.998773184] [gscam_publisher]: use_gst_timestamps = false
[INFO] [1715812631.998790176] [gscam_publisher]: image_encoding = rgb8
[INFO] [1715812631.998806081] [gscam_publisher]: camera_info_url = file:///home/jaime/kaya_ws/src/gscam2/cfg/my_camera.ini
[INFO] [1715812631.998822785] [gscam_publisher]: camera_name = 
[INFO] [1715812631.998838017] [gscam_publisher]: frame_id = camera_frame
[INFO] [1715812631.998857410] [gscam_publisher]: Using GSCAM_CONFIG env var: udpsrc port=50008 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! queue ! h264parse ! nvv4l2decoder ! queue ! nvvidconv
[INFO] [1715812631.998914723] [gscam_publisher]: camera calibration URL: file:///home/jaime/kaya_ws/src/gscam2/cfg/my_camera.ini
[INFO] [1715812631.999182792] [gscam_publisher]: Loaded camera calibration from file:///home/jaime/kaya_ws/src/gscam2/cfg/my_camera.ini
[INFO] [1715812632.011161754] [gscam_publisher]: Gstreamer initialized
[INFO] [1715812632.011244668] [gscam_publisher]: Gstreamer version: GStreamer 1.16.3
[FATAL] [1715812632.069449652] [gscam_publisher]: Cannot link outelement("nvvconv0") -> sink

[INFO] [1715812632.069807291] [gscam_publisher]: Pipeline deleted

hello Jaime_Element,

what’s the sink element you’re used?
it looks like incomplete has used, could you please examine your env variable.
for instance, $ echo $GSCAM_CONFIG

The gscam package adds an appsink and a caps element programmatically to the displayed config.
You can see on line 161 on this file what it appends gscam2/src/gscam_node.cpp at main · clydemcqueen/gscam2 · GitHub

The problem seems to be that the nvvidconv or videoconvert packages don’t support the caps element added by gscam. I think I just need to convert the video to the correct format before passing it to the app sink but I don’t know how to do that.

please see-also Topic 183388 for reference.