Autovideosink "assertion: outpad failed"
Hello,
I am extremely new to gstreamer pipelines, but have a good background in image processing. I am doing some initial testing on a USB video camera before incorporating gscam2 into platform. I'm having some issues getting the camera to run with the package.
For example, my pipeline to run gstreamer will pull up a nice window streaming the image from the camera with:
gst-launch-1.0 v4l2src device=/dev/video0 ! autovideosink
However, when using that pipeline string in the gscam2 package I get this output.
ros2 launch gscam2 composition_launch.py
[INFO] [launch]: All log files can be found below /home/mike/.ros/log/2021-11-18-14-13-06-220931-mrawding-razor-302343
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [component_container-1]: process started with pid [302355]
[component_container-1] [INFO] [1637262786.604877588] [my_container]: Load Library: /home/mike/Desktop/latest/ffmpeg/sitcore/mav_platform_r2/install/gscam2/lib/libgscam_node.so
[component_container-1] [INFO] [1637262786.610115733] [my_container]: Found class: rclcpp_components::NodeFactoryTemplate<gscam2::GSCamNode>
[component_container-1] [INFO] [1637262786.610131686] [my_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate<gscam2::GSCamNode>
[component_container-1] [INFO] [1637262786.613842975] [image_publisher]: use_intra_process_comms=1
[component_container-1] [INFO] [1637262786.614108234] [image_publisher]: gscam_config = v4l2src device=/dev/video0 ! queue ! autovideosink
[component_container-1] [INFO] [1637262786.614122460] [image_publisher]: sync_sink = false
[component_container-1] [INFO] [1637262786.614128142] [image_publisher]: preroll = false
[component_container-1] [INFO] [1637262786.614134373] [image_publisher]: use_gst_timestamps = true
[component_container-1] [INFO] [1637262786.614138891] [image_publisher]: image_encoding = rgb8
[component_container-1] [INFO] [1637262786.614143296] [image_publisher]: camera_info_url =
[component_container-1] [INFO] [1637262786.614147713] [image_publisher]: camera_name =
[component_container-1] [INFO] [1637262786.614153305] [image_publisher]: frame_id = camera_frame
[component_container-1] [INFO] [1637262786.614172899] [image_publisher]: using default calibration URL
[component_container-1] [INFO] [1637262786.614189877] [image_publisher]: camera calibration URL: file:///home/mike/.ros/camera_info/camera.yaml
[component_container-1] [ERROR] [1637262786.614219126] [camera_calibration_parsers]: Unable to open camera calibration file [/home/mike/.ros/camera_info/camera.yaml]
[component_container-1] [WARN] [1637262786.614224830] [image_publisher]: Camera calibration file /home/mike/.ros/camera_info/camera.yaml not found
[component_container-1] [INFO] [1637262786.614238170] [image_publisher]: Loaded camera calibration from
[component_container-1] [INFO] [1637262786.622444346] [image_publisher]: Gstreamer initialized
[component_container-1] [INFO] [1637262786.622468422] [image_publisher]: Gstreamer version: GStreamer 1.16.2
[component_container-1] **
[component_container-1] ERROR:/home/mike/Desktop/latest/ffmpeg/sitcore/mav_platform_r2/src/drivers/rb5/gscam2/src/gscam_node.cpp:168:bool gscam2::GSCamNode::impl::create_pipeline(): assertion failed: (outpad)
[component_container-1] Bail out! ERROR:/home/mike/Desktop/latest/ffmpeg/sitcore/mav_platform_r2/src/drivers/rb5/gscam2/src/gscam_node.cpp:168:bool gscam2::GSCamNode::impl::create_pipeline(): assertion failed: (outpad)
[ERROR] [component_container-1]: process has died [pid 302355, exit code -6, cmd '/opt/ros/galactic/lib/rclcpp_components/component_container --ros-args -r __node:=my_container -r __ns:=/'].
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[WARNING] [launch_ros.actions.load_composable_nodes]: Abandoning wait for the '/my_container/_container/load_node' service response, due to shutdown
If I take away the autosink option, I get an endless loop of Could not get sample, pause for 1s
I don't think this an issue with this code base at all and definitely a user issue. The camera is a Generic webcam, but it seems to work fine with the gstlaunch command. Is there something I can aff to the gscam2 config string to get this to run?
I would appreciate any and all help. Thanks!
Try setting gscam_config to v4l2src device=/dev/video0 ! queue ! videoconvert (replace autovideosink with videoconvert).
The error assertion failed: (outpad) basically means that the pipeline fragment doesn't have a output pad, so gscam can't get the data from the pipeline to copy into a ROS message.
GStreamer is a bit tricky to learn. A few tips:
- elements named foosrc get buffers from somewhere and push them into the pipeline -- that is, they have a source pad
- elements named foosink eat buffers -- that is, they have a sink pad
- other elements have both a sink and a source pad so they can get buffers, modify them, and pass them along
- gscam tries to add an appsink element to the end of the pipeline; appsink has an API to get buffer data
- there are also tee elements, mux elements and demux elements
I hope this helps.
Hi, I'm going to close this bug. Please reach out if you are still having problems.