ros-drivers / gscam Goto Github PK
View Code? Open in Web Editor NEWROS Camera driver for GStreamer-based video streams.
ROS Camera driver for GStreamer-based video streams.
I'm trying to use gscam to run a DMM 22BUC03-ML Imaging Source camera, and I am seeing some weird interactions.
When I run the node normally, I get the following output:
rosrun gscam gscam _gscam_config:="v4l2src device:=/dev/video0 ! video/x-raw-gray ! ffmpegcolorspace"
[ INFO] [1467152862.797360889]: Using gstreamer config from rosparam: "v4l2src device:=/dev/video0 ! video/x-raw-gray ! ffmpegcolorspace"
[ INFO] [1467152862.803022560]: using default calibration URL
[ INFO] [1467152862.803093946]: camera calibration URL: file:///home/casey/.ros/camera_info/camera.yaml
[ INFO] [1467152862.803181343]: Unable to open camera calibration file [/home/casey/.ros/camera_info/camera.yaml]
[ WARN] [1467152862.803220507]: Camera calibration file /home/casey/.ros/camera_info/camera.yaml not found.
[ INFO] [1467152862.803248666]: Loaded camera calibration from
[ INFO] [1467152862.835670663]: Time offset: 1464805568.523
[ INFO] [1467152865.598964739]: Publishing stream...
[ INFO] [1467152865.599199723]: Started stream.
** (gscam:7006): WARNING **: ffmpegcsp0: size 29277 is not a multiple of unit size 357120
At this point, I get no messages from the node and Ctrl-C does not close the node.
However, if I run the camera using gst-launch first:
gst-launch-0.10 v4l2src ! video/x-raw-gray ! tisvideobufferfilter ! tis_auto_exposure ! ffmpegcolorspace ! ximagesink
and then run the gscam node, it works fine. We don't get the WARNING message, the camera runs normally, and Ctrl-C closes the node.
We need to be able to run the node with only ROS, without starting other programs first. What could be causing this interaction, and what could we do to fix it?
We have a problem with color tiscamera. We try to use gscam with tiscolorize plugin but it fail or show nothing:
v4l2src device=/dev/video1 ! tiscolorize ! tis_auto_exposure ! ffmpegcolorspace
Dont fail but no image is sent (nothing visible)
v4l2src device=/dev/video1 ! tiscolorize ! tis_auto_exposure ! bayer2rgb ! ffmpegcolorspace
Send the error:
`[creative_cam-2] process has died [pid 16444, exit code -11, cmd /home/nyx/dev/catkin_ws/devel/lib/gscam/gscam camera/image_raw:=creative_cam/image_raw __name:=creative_cam __log:=/home/nyx/.ros/log/fd851872-dbd9-11e5-8b89-e840f20aaf02/creative_cam-2.log].
log file: /home/nyx/.ros/log/fd851872-dbd9-11e5-8b89-e840f20aaf02/creative_cam-2*.log
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >'
what(): boost: mutex lock failed in pthread_mutex_lock: Invalid argument
[creative_view_rect-5] process has died [pid 16447, exit code -6, cmd /opt/ros/jade/lib/image_view/image_view image:=/creative_cam/image_rect_color __name:=creative_view_rect __log:=/home/nyx/.ros/log/fd851872-dbd9-11e5-8b89-e840f20aaf02/creative_view_rect-5.log].
log file: /home/nyx/.ros/log/fd851872-dbd9-11e5-8b89-e840f20aaf02/creative_view_rect-5*.log
When I use
gst-launch-0.10 v4l2src device=/dev/video1 ! tiscolorize ! tis_auto_exposure ! bayer2rgb ! ffmpegcolorspace ! ximagesink
All is working properly...
Well, the problem is in the title.
Problem was with the boost::scoped_ptr, it was undefined for some reason. I fixed it by adding
in file gscam_nodelet.h
Well, looks like it works correctly with Gstreamer 1.8.2 and ROS Kinetic under Ubuntu 16.04
P.s.: i'm not sure if i did something wrong by adding this comment as an issue, i'm newbie with github
I am trying to set up gscam on my Jetson TX2 with Jetpack 4.2.2 under Ubuntu 18.04. Streaming with gstreamer works perfectly well, but with gscam I receive no image feed. No errors are issued. I do have gscam installed in the following way:
sudo apt-get install -y libgstreamer1.0-dev gstreamer1.0-tools libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libyaml-cpp-dev
sudo apt-get install -y ros-melodic-camera-info-manager ros-melodic-camera-calibration-parsers ros-melodic-image-transport
sudo apt-get install -y ros-melodic-gscam
Running the following pipeline with gstreamer works well:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, width=3840, height=1080 ! videocrop top=0 left=0 right=1920 bottom=0 ! tee name=t ! queue ! videoconvert ! omxh264enc ! video/x-h264, stream-format=byte-stream ! h264parse ! rtph264pay config-interval=1 ! udpsink host=10.0.1.111 port=5600 t. ! queue ! videoconvert
However when I try the same with gscam no image is published and the process hangs (control C doesent work, I need to kill it)
export GSCAM_CONFIG="v4l2src device=/dev/video0 ! video/x-raw, width=3840, height=1080 ! videocrop top=0 left=0 right=1920 bottom=0 ! tee name=t ! queue ! videoconvert ! omxh264enc ! video/x-h264, stream-format=byte-stream ! h264parse ! rtph264pay config-interval=1 ! udpsink host=10.0.1.111 port=5600 t. ! queue ! videoconvert"
rosrun gscam gscam
I traced the messages with GST_DEBUG=4, no errors are occuring, here is the tail of the log:
0:00:00.319593122 13819 0x55814a4de0 INFO v4l2 gstv4l2object.c:4238:gst_v4l2_object_probe_caps:<v4l2src0:src> probed caps: video/x-raw, format=(string)YUY2, width=(int)4416, height=(int)1242, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)15/1; video/x-raw, format=(string)YUY2, width=(int)3840, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 15/1 }; video/x-raw, format=(string)YUY2, width=(int)2560, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 30/1, 15/1 }; video/x-raw, format=(string)YUY2, width=(int)1344, height=(int)376, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 100/1, 60/1, 30/1, 15/1 }
[ INFO] [1570688027.174497451]: Publishing stream...
0:00:00.326848745 13819 0x5580f03200 INFO GST_EVENT gstevent.c:1388:gst_event_new_latency: creating latency event 0:00:00.000000000
0:00:00.326949001 13819 0x5580f03200 INFO bin gstbin.c:2783:gst_bin_do_latency_func:<pipeline0> configured latency of 0:00:00.000000000
0:00:00.327048265 13819 0x5580f03200 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state:<appsink0> current READY pending PAUSED, desired next PLAYING
0:00:00.327085353 13819 0x5580f03200 INFO GST_STATES gstbin.c:2960:gst_bin_change_state_func:<pipeline0> child 'appsink0' is changing state asynchronously to PLAYING
0:00:00.327123241 13819 0x5580f03200 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state:<udpsink0> current READY pending PAUSED, desired next PLAYING
0:00:00.327155401 13819 0x5580f03200 INFO GST_STATES gstbin.c:2960:gst_bin_change_state_func:<pipeline0> child 'udpsink0' is changing state asynchronously to PLAYING
0:00:00.327191785 13819 0x5580f03200 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state:<videoconvert1> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.327227753 13819 0x5580f03200 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<videoconvert1> completed state change to PLAYING
0:00:00.327262409 13819 0x5580f03200 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<videoconvert1> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.327309481 13819 0x5580f03200 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func:<pipeline0> child 'videoconvert1' changed state to 4(PLAYING) successfully
0:00:00.327348745 13819 0x5580f03200 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state:<rtph264pay0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.327403433 13819 0x5580f03200 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<rtph264pay0> completed state change to PLAYING
0:00:00.327436681 13819 0x5580f03200 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<rtph264pay0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.327484233 13819 0x5580f03200 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func:<pipeline0> child 'rtph264pay0' changed state to 4(PLAYING) successfully
0:00:00.327523177 13819 0x5580f03200 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state:<queue1> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.327557321 13819 0x5580f03200 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<queue1> completed state change to PLAYING
0:00:00.327588617 13819 0x5580f03200 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<queue1> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.327613865 13819 0x55814a4de0 INFO v4l2 gstv4l2object.c:3659:gst_v4l2_object_set_format_full:<v4l2src0:src> Set capture framerate to 30/1
0:00:00.327629609 13819 0x5580f03200 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func:<pipeline0> child 'queue1' changed state to 4(PLAYING) successfully
0:00:00.327682569 13819 0x55814a4de0 INFO v4l2 gstv4l2object.c:2933:gst_v4l2_object_setup_pool:<v4l2src0:src> accessing buffers via mode 4
0:00:00.327721289 13819 0x5580f03200 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state:<h264parse0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.327790729 13819 0x5580f03200 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<h264parse0> completed state change to PLAYING
0:00:00.327823658 13819 0x5580f03200 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<h264parse0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.327865482 13819 0x5580f03200 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func:<pipeline0> child 'h264parse0' changed state to 4(PLAYING) successfully
0:00:00.327904458 13819 0x5580f03200 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state:<capsfilter1> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.327938506 13819 0x5580f03200 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<capsfilter1> completed state change to PLAYING
0:00:00.327968970 13819 0x5580f03200 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<capsfilter1> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.328009546 13819 0x5580f03200 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func:<pipeline0> child 'capsfilter1' changed state to 4(PLAYING) successfully
0:00:00.328047690 13819 0x5580f03200 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state:<omxh264enc-omxh264enc0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.328086858 13819 0x5580f03200 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<omxh264enc-omxh264enc0> completed state change to PLAYING
0:00:00.328180106 13819 0x5580f03200 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<omxh264enc-omxh264enc0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.328227722 13819 0x5580f03200 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func:<pipeline0> child 'omxh264enc-omxh264enc0' changed state to 4(PLAYING) successfully
0:00:00.328267530 13819 0x5580f03200 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state:<videoconvert0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.328302538 13819 0x5580f03200 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<videoconvert0> completed state change to PLAYING
0:00:00.328332682 13819 0x5580f03200 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<videoconvert0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.328372618 13819 0x5580f03200 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func:<pipeline0> child 'videoconvert0' changed state to 4(PLAYING) successfully
0:00:00.328410186 13819 0x55814a4de0 INFO v4l2bufferpool gstv4l2bufferpool.c:557:gst_v4l2_buffer_pool_set_config:<v4l2src0:pool:src> increasing minimum buffers to 2
0:00:00.328458442 13819 0x55814a4de0 INFO v4l2bufferpool gstv4l2bufferpool.c:570:gst_v4l2_buffer_pool_set_config:<v4l2src0:pool:src> reducing maximum buffers to 32
0:00:00.328411242 13819 0x5580f03200 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state:<queue0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.328538730 13819 0x5580f03200 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<queue0> completed state change to PLAYING
0:00:00.328561290 13819 0x55814a4de0 INFO GST_EVENT gstevent.c:814:gst_event_new_caps: creating caps event video/x-raw, width=(int)3840, height=(int)1080, framerate=(fraction)30/1, format=(string)YUY2, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, interlace-mode=(string)progressive
0:00:00.328571082 13819 0x5580f03200 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<queue0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.328657610 13819 0x5580f03200 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func:<pipeline0> child 'queue0' changed state to 4(PLAYING) successfully
0:00:00.328696906 13819 0x5580f03200 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state:<t> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.328731658 13819 0x5580f03200 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<t> completed state change to PLAYING
0:00:00.328759210 13819 0x55814a4de0 INFO basetransform gstbasetransform.c:1308:gst_base_transform_setcaps:<capsfilter0> reuse caps
0:00:00.328762314 13819 0x5580f03200 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<t> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.328853418 13819 0x5580f03200 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func:<pipeline0> child 't' changed state to 4(PLAYING) successfully
0:00:00.328862986 13819 0x55814a4de0 INFO GST_EVENT gstevent.c:814:gst_event_new_caps: creating caps event video/x-raw, width=(int)3840, height=(int)1080, framerate=(fraction)30/1, format=(string)YUY2, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, interlace-mode=(string)progressive
0:00:00.328908074 13819 0x5580f03200 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state:<videocrop0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.328988107 13819 0x5580f03200 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<videocrop0> completed state change to PLAYING
0:00:00.329028843 13819 0x5580f03200 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<videocrop0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.329070827 13819 0x5580f03200 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func:<pipeline0> child 'videocrop0' changed state to 4(PLAYING) successfully
0:00:00.329109803 13819 0x5580f03200 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state:<capsfilter0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.329143819 13819 0x5580f03200 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<capsfilter0> completed state change to PLAYING
0:00:00.329174763 13819 0x5580f03200 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<capsfilter0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.329218155 13819 0x5580f03200 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func:<pipeline0> child 'capsfilter0' changed state to 4(PLAYING) successfully
0:00:00.329263275 13819 0x5580f03200 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<v4l2src0> completed state change to PLAYING
0:00:00.329294347 13819 0x5580f03200 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<v4l2src0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.329334315 13819 0x5580f03200 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func:<pipeline0> child 'v4l2src0' changed state to 4(PLAYING) successfully
[ INFO] [1570688027.177374606]: Started stream.
0:00:00.329514731 13819 0x55814a4de0 INFO GST_EVENT gstevent.c:814:gst_event_new_caps: creating caps event video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)YUY2, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, interlace-mode=(string)progressive
0:00:00.330982476 13819 0x55814a4e80 INFO GST_EVENT gstevent.c:814:gst_event_new_caps: creating caps event video/x-raw, width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
0:00:00.331006348 13819 0x5581423ed0 INFO GST_EVENT gstevent.c:814:gst_event_new_caps: creating caps event video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)RGB
0:00:00.331129581 13819 0x5581423ed0 INFO GST_EVENT gstevent.c:814:gst_event_new_caps: creating caps event video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)RGB
0:00:00.331253325 13819 0x55814a4e80 FIXME videoencoder gstvideoencoder.c:661:gst_video_encoder_setcaps:<omxh264enc-omxh264enc0> GstVideoEncoder::reset() is deprecated
0:00:00.331362957 13819 0x55814a4e80 INFO task gsttask.c:457:gst_task_set_lock: setting stream lock 0x558141f630 on task 0x558147fb90
0:00:00.331393229 13819 0x55814a4e80 INFO GST_PADS gstpad.c:6154:gst_pad_start_task:<omxh264enc-omxh264enc0:src> created task 0x558147fb90
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
0:00:00.332875406 13819 0x55814a4e80 WARN omxvideoenc gstomxvideoenc.c:1860:gst_omx_video_enc_set_format:<omxh264enc-omxh264enc0> Error setting temporal_tradeoff 0 : Vendor specific error (0x00000001)
0:00:00.332927278 13819 0x55814a4e80 INFO omx gstomx.c:1936:gst_omx_port_set_enabled_unlocked:<omxh264enc-omxh264enc0> Setting encoder port 1 to disabled
0:00:00.332999918 13819 0x55814a4e80 INFO omx gstomx.c:1984:gst_omx_port_set_enabled_unlocked:<omxh264enc-omxh264enc0> Set encoder port 1 to disabled: None (0x00000000)
0:00:00.333044398 13819 0x55814a4e80 INFO omx gstomx.c:2223:gst_omx_port_wait_enabled_unlocked:<omxh264enc-omxh264enc0> Waiting for encoder port 1 to be disabled
0:00:00.333178830 13819 0x55814a4e80 INFO omx gstomx.c:2298:gst_omx_port_wait_enabled_unlocked:<omxh264enc-omxh264enc0> encoder port 1 is disabled: None (0x00000000)
0:00:00.333213582 13819 0x55814a4e80 INFO omx gstomx.c:798:gst_omx_component_set_state:<omxh264enc-omxh264enc0> Setting encoder state from Loaded to Idle
0:00:00.333263854 13819 0x55814a4e80 INFO omx gstomx.c:1695:gst_omx_port_allocate_buffers_unlocked:<omxh264enc-omxh264enc0> Allocating 6 buffers of size 3110400 for encoder port 0
0:00:00.333396175 13819 0x55814a4e80 INFO omx gstomx.c:1760:gst_omx_port_allocate_buffers_unlocked:<omxh264enc-omxh264enc0> Allocated buffers for encoder port 0: None (0x00000000)
0:00:00.333536399 13819 0x7f540044f0 INFO task gsttask.c:316:gst_task_func:<omxh264enc-omxh264enc0:src> Task going to paused
0:00:00.381188026 13819 0x55814a4e80 INFO omx gstomx.c:235:gst_omx_component_handle_messages:<omxh264enc-omxh264enc0> encoder state change to Idle finished
0:00:00.381236698 13819 0x55814a4e80 INFO omx gstomx.c:798:gst_omx_component_set_state:<omxh264enc-omxh264enc0> Setting encoder state from Idle to Executing
0:00:00.381320346 13819 0x55814a4e80 INFO omx gstomx.c:235:gst_omx_component_handle_messages:<omxh264enc-omxh264enc0> encoder state change to Executing finished
H264: Profile = 66, Level = 40
0:00:00.381351258 13819 0x55814a4e80 INFO omx gstomx.c:1936:gst_omx_port_set_enabled_unlocked:<omxh264enc-omxh264enc0> Setting encoder port 1 to enabled
0:00:00.381409274 13819 0x55814a4e80 INFO omx gstomx.c:1984:gst_omx_port_set_enabled_unlocked:<omxh264enc-omxh264enc0> Set encoder port 1 to enabled: None (0x00000000)
0:00:00.381431674 13819 0x55814a4e80 INFO omx gstomx.c:1695:gst_omx_port_allocate_buffers_unlocked:<omxh264enc-omxh264enc0> Allocating 6 buffers of size 3110676 for encoder port 1
0:00:00.381540794 13819 0x55814a4e80 INFO omx gstomx.c:1760:gst_omx_port_allocate_buffers_unlocked:<omxh264enc-omxh264enc0> Allocated buffers for encoder port 1: None (0x00000000)
0:00:00.381564794 13819 0x55814a4e80 INFO omx gstomx.c:2223:gst_omx_port_wait_enabled_unlocked:<omxh264enc-omxh264enc0> Waiting for encoder port 1 to be enabled
0:00:00.388090720 13819 0x55814a4e80 INFO omx gstomx.c:2298:gst_omx_port_wait_enabled_unlocked:<omxh264enc-omxh264enc0> encoder port 1 is enabled: None (0x00000000)
0:00:00.388181408 13819 0x55814a4e80 INFO omx gstomx.c:2347:gst_omx_port_mark_reconfigured:<omxh264enc-omxh264enc0> Marking encoder port 1 is reconfigured
0:00:00.388204704 13819 0x55814a4e80 INFO omx gstomx.c:2374:gst_omx_port_mark_reconfigured:<omxh264enc-omxh264enc0> Marked encoder port 1 as reconfigured: None (0x00000000)
0:00:00.388246176 13819 0x7f540044f0 INFO task gsttask.c:318:gst_task_func:<omxh264enc-omxh264enc0:src> Task resume from paused
0:00:00.389051425 13819 0x55814a4de0 INFO videocrop gstvideocrop.c:483:gst_video_crop_decide_allocation:<videocrop0> we are not using passthrough
0:00:00.389532578 13819 0x55814a4de0 INFO v4l2bufferpool gstv4l2bufferpool.c:570:gst_v4l2_buffer_pool_set_config:<v4l2src0:pool:src> reducing maximum buffers to 32
0:00:00.611028971 13819 0x55814a4de0 INFO v4l2src gstv4l2src.c:957:gst_v4l2src_create:<v4l2src0> sync to 0:00:00.033333333 out ts 0:00:00.252010332
0:00:00.611134763 13819 0x55814a4de0 INFO GST_EVENT gstevent.c:895:gst_event_new_segment: creating segment event time segment start=0:00:00.000000000, offset=0:00:00.000000000, stop=99:99:99.999999999, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 0:00:00.000000000, duration 99:99:99.999999999
0:00:00.611350507 13819 0x55814a4de0 INFO basesrc gstbasesrc.c:2945:gst_base_src_loop:<v4l2src0> marking pending DISCONT
0:00:00.644512745 13819 0x55814a4de0 INFO v4l2src gstv4l2src.c:957:gst_v4l2src_create:<v4l2src0> sync to 0:00:00.066666666 out ts 0:00:00.285488044
0:00:00.645930635 13819 0x7f540044f0 INFO GST_EVENT gstevent.c:814:gst_event_new_caps: creating caps event video/x-h264, alignment=(string)au, profile=(string)baseline, level=(string)4, stream-format=(string)byte-stream, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt709, chroma-site=(string)mpeg2
0:00:00.646047499 13819 0x7f540044f0 INFO basetransform gstbasetransform.c:1308:gst_base_transform_setcaps:<capsfilter1> reuse caps
0:00:00.646099019 13819 0x7f540044f0 INFO GST_EVENT gstevent.c:814:gst_event_new_caps: creating caps event video/x-h264, alignment=(string)au, profile=(string)baseline, level=(string)4, stream-format=(string)byte-stream, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt709, chroma-site=(string)mpeg2
0:00:00.646324107 13819 0x7f540044f0 INFO GST_EVENT gstevent.c:895:gst_event_new_segment: creating segment event time segment start=0:00:00.000000000, offset=0:00:00.000000000, stop=99:99:99.999999999, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 0:00:00.000000000, duration 99:99:99.999999999
0:00:00.646580555 13819 0x7f540044f0 WARN h264parse gsth264parse.c:1237:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 5 Slice IDR, Size: 41566 will be dropped
0:00:00.664489275 13819 0x7f540044f0 WARN h264parse gsth264parse.c:1237:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 1 Slice, Size: 20950 will be dropped
0:00:00.677984296 13819 0x55814a4de0 INFO v4l2src gstv4l2src.c:957:gst_v4l2src_create:<v4l2src0> sync to 0:00:00.099999999 out ts 0:00:00.318869492
0:00:00.702836190 13819 0x7f540044f0 WARN h264parse gsth264parse.c:1237:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 1 Slice, Size: 14974 will be dropped
0:00:00.711480806 13819 0x55814a4de0 INFO v4l2src gstv4l2src.c:957:gst_v4l2src_create:<v4l2src0> sync to 0:00:00.133333332 out ts 0:00:00.352362524
0:00:00.736652829 13819 0x7f540044f0 WARN h264parse gsth264parse.c:1237:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 1 Slice, Size: 10373 will be dropped
0:00:00.744761252 13819 0x55814a4de0 INFO v4l2src gstv4l2src.c:957:gst_v4l2src_create:<v4l2src0> sync to 0:00:00.166666665 out ts 0:00:00.385736300
0:00:00.776690305 13819 0x7f540044f0 WARN h264parse gsth264parse.c:1237:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 1 Slice, Size: 9807 will be dropped
Killed
apsync@apsync:~$
Is there any way of rectifying the image with given intrinics in the camera_info param?
Hi, I use gscam to play a video file. My config line in the launch file looks like this
<param name="gscam_config" value="filesrc location=$(arg FILENAME) ! decodebin ! ffmpegcolorspace"/>
I have videos that needs to be flipped vertically. I am trying to add the flip to this line, but it doesn't work. I have found this in the gstreamer doc :
http://www.freedesktop.org/software/g...
I have tried :
<param name="gscam_config" value="filesrc location=$(arg FILENAME) ! decodebin ! ffmpegcolorspace ! videoflip method=vertical-flip"/>
but no luck.
I use a CSI camera on Nvidia Xavier NX, and I wonder how could I adjust the camera exposure?
Hi.
I'm running ros fuerte. The revision 2863.
I'm trying to get a rectified image to use then for the node viso2. But I have a problem, after I made the calibration. I have a warning:
[image_transport] Topics '/Dava/image_mono' and '/Dava/gscam/camera_info' do not appear to be synchronized. In the last 10s: Image messages received: 80 CameraInfo messages received: 80 Synchronized pairs: 0
The problem is I can't see the rectified image when I Subscribed the topic in image_view.
I put all the details in this link:
http://answers.ros.org/question/84611/synchronized-problem-related-to-calibration/
I will appreciate any respond . Thank you
I am trying to get gscam
working on ROS2 Humble. I am using a Jetson Nano Developer Kit.
I got it working on ROS1 Noetic on the same device with the same gstreamer pipeline, however in ROS2 Humble and gscam2 i get the following error: [ERROR] [1707708248.525200179] [gscam_publisher]: Could not get gstreamer sample.
My procedure is:
source /opt/ros/humble/setup.bash
export GSCAM_CONFIG="nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM),width=3264, height=2464,format=(string)NV12,framerate=21/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR"
ros2 run gscam gscam_node
Full Log:
[INFO] [1707707982.817263335] [gscam_publisher]: Using gstreamer config from env: "nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM),width=3264, height=2464,format=(string)NV12,framerate=21/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR"
[INFO] [1707707982.817826362] [gscam_publisher]: using default calibration URL
[INFO] [1707707982.817882352] [gscam_publisher]: camera calibration URL: file:///home/aresuser/.ros/camera_info/camera.yaml
[ERROR] [1707707982.818019854] [camera_calibration_parsers]: Unable to open camera calibration file [/home/aresuser/.ros/camera_info/camera.yaml]
[WARN] [1707707982.818056886] [gscam_publisher]: Camera calibration file /home/aresuser/.ros/camera_info/camera.yaml not found
[INFO] [1707707982.818112563] [gscam_publisher]: Loaded camera calibration from
[WARN] [1707707982.818196939] [gscam_publisher]: No camera frame_id set, using frame "camera_frame".
[INFO] [1707707983.201164994] [gscam_publisher]: Time offset: 1707707567.276752
[INFO] [1707707983.223313561] [gscam_publisher]: Publishing stream...
[INFO] [1707707983.223688460] [gscam_publisher]: Started stream.
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3264 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 3264 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 0
Output Stream W = 3264 H = 2464
seconds to Run = 0
Frame Rate = 21.000000
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
CONSUMER: Done Success
[ERROR] [1707708065.645519328] [gscam_publisher]: Could not get gstreamer sample.
[INFO] [1707708065.699136877] [gscam_publisher]: Stopping gstreamer pipeline...
GST_ARGUS: Cleaning up
(Argus) Error Timeout: (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 137)
(Argus) Error Timeout: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
(Argus) Error Timeout: (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 137)
(Argus) Error Timeout: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
GST_ARGUS: Done Success
[INFO] [1707708136.177702361] [gscam_publisher]: GStreamer stream stopped!
[INFO] [1707708136.177866380] [gscam_publisher]: Cleaning up stream and exiting...
Like i mentioned, the same procedure works on the same device with ROS1 Noetic.
The reason why i want to use ROS2 is because i originally wanted to use isaac_ros_argus_camera
for hardware acceleration but this does not work either, but because of another reason.
I'm trying to use DFKJ003 cam via gstreamer.
But , I always get following error.
Please tell me how to run this .launch file.
[gscam2.launch]
[error message]
$ roslaunch gscam2.launch
ERROR:/home/leus/catkin_ws/src/ros-drivers/gscam/src/gscam.cpp:167:bool gscam::GSCam::init_stream(): assertion failed: (outpad)
[narrow_stereo-1] process has died [pid 5098, exit code -6, cmd /home/leus/catkin_ws/devel/lib/gscam/gscam __name:=narrow_stereo __log:=/home/leus/.ros/log/06b854ea-5c99-11e7-ab90-f44d306d75dc/narrow_stereo-1.log].
log file: /home/leus/.ros/log/06b854ea-5c99-11e7-ab90-f44d306d75dc/narrow_stereo-1*.log
^X^C[creative_view_rect-4] killing on exit
[creative_view-3] killing on exit
[narrow_stereo/creative_image_proc-2] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
It would be desirable to get support for diagnostics support for the driver, so a indication of the state is immediately visible also in complex robot systems. I won't get to implement this in the near future, but wanted to have this tracked here.
I am attempting to stream IP camera using RTSP into ROS and I am having trouble configuring the gstreamer parameters correctly. Here is the configuration I am currently using. Running gscam with the below configuration appears to run correctly, but does not output on any topic. I've checked the feed using Wireshark and packets are being received so I believe the issue lies with the sink into a ros-topic. Any fixes or tips for debugging would be great.
GSCAM_CONFIG:
"rtspsrc location=rtsp://admin:[email protected]:5541 ! videoconvert"
Node Output:
export GSCAM_CONFIG="rtspsrc location=rtsp://admin:[email protected]:5541 ! videoconvert"
rosrun gscam gscam
[ INFO] [1600205736.671750111]: Using gstreamer config from env: "rtspsrc location=rtsp://admin:[email protected]:5541 ! videoconvert"
[ INFO] [1600205736.673814169]: using default calibration URL
[ INFO] [1600205736.673845666]: camera calibration URL: file:///home/user/.ros/camera_info/camera.yaml
[ INFO] [1600205736.673883613]: Unable to open camera calibration file [/home/user/.ros/camera_info/camera.yaml]
[ WARN] [1600205736.673901605]: Camera calibration file /home/user/.ros/camera_info/camera.yaml not found.
[ INFO] [1600205736.673917322]: Loaded camera calibration from
[ INFO] [1600205736.685475897]: Time offset: 1600110291.432
[ INFO] [1600205736.744781022]: Publishing stream...
[ INFO] [1600205736.744874413]: Started stream.
Hi there,
So I've been trying to launch a Jetson TX2 on-board camera using gscam_nodelet.launch. It runs without errors, but there was no image being published. I wonder if there's anything I missed here. Thanks.
I'm trying to get running gscam on ros noetic.
I cloned this repo, installed all gstreamer dependencies and built the package with required CMake flag -DGSTREAMER_VERSION_1_x=On
.
The camera provides an udp-stream. I'm able to recieve the data using gstreamer directly: gst-launch-1.0 -v udpsrc port=5012 caps="application/x-rtp,encoding-name=H264,payload=96" ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! decodebin ! videoconvert ! autovideosink
.
When I try the same with the gscam node, I export GSCAM_CONFIG="udpsrc port=5012 caps="application/x-rtp,encoding-name=H264,payload=96" ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! decodebin ! videoconvert"
and run rosrun gscam gscam
and my terminal become flooded with error messages:
(gscam:122311): GStreamer-CRITICAL **: 09:29:45.330: gst_buffer_get_sizes_range: assertion 'GST_IS_BUFFER (buffer)' failed
** (gscam:122311): CRITICAL **: 09:29:45.330: gst_queue_array_peek_nth: assertion 'idx < array->length' failed
What I'm doing wrong?
I worked with DMM 42BUC03-ML and tried to launch the camera in ROS.
Every time when I launch it, it's fine, when I put some image or objects in front of the camera, the exception will be thrown. It gives me:
** (gscam:11048): WARNING **: ffmpegcsp0: size 1212416 is not a multiple of unit size 1228800.
Here is my launch file:
<launch>
<arg name="cam_name" value="creative_cam" />
<env name="GSCAM_CONFIG" value="v4l2src device=/dev/video3 ! video/x-raw-gray,framerate=30/1,width=1280,height=960 ! ffmpegcolorspace " />
<node pkg="gscam" type="gscam" name="$(arg cam_name)">
<param name="camera_name" value="$(arg cam_name)" />
<!-- <param name="camera_info_url" value="package://localcam/calibrations/${NAME}.yaml" /> -->
<remap from="camera/image_raw" to="/sensors/scanner/camera/image_raw" />
</node>
</launch>```
Possibly related to: #16 - it seems that would fix the issue, but it hasn't been closed yet. This is not only an issue re REP-0135, but it also makes using stereo cameras a pain.
The relevant code is here:
// Create ROS camera interface
if (image_encoding_ == "jpeg") {
jpeg_pub_ = nh_.advertise<sensor_msgs::CompressedImage>("camera/image_raw/compressed",1);
cinfo_pub_ = nh_.advertise<sensor_msgs::CameraInfo>("camera/camera_info",1);
} else {
camera_pub_ = image_transport_.advertiseCamera("camera/image_raw", 1);
}
So if you use a stereo
namespace for the camera, you end up with e.g.
/stereo/camera/
and if you have multiple cameras, they all get published in the same topic,. One option is to namespace each camera individually, but that seems like an excessive amount of boilerplate and you're still forced to use /camera
wtihin the namespace.
I've done this:
camera_pub_ = image_transport_.advertiseCamera(camera_name_ + "/image_raw", 1);
which works perfectly fine for my use case. Or we have another input parameter to change the topic name (defaulting to camera
for back compatibility).
So now I can launch and end up with
/stereo/left
/stereo/right
Or is this something I should be fixing with remapping?
EDIT - Having played around with this, it seems like namespacing does fix the issue in the cleanest way, but given that the PR is now almost 4 years old, I guess this isn't a priority?
In the ros2
branch:
When use_gst_timestamps
is set to true, timestamps converted from the gstreamer buffer timestamps are incorrect.
The seconds field of the resulting image message header timestamps is 0 or 1, and the nanoseconds field is also incorrect.
This was noted when using GScam with Galactic.
(gscam:17521): GStreamer-CRITICAL **: 01:39:03.281: gst_buffer_resize_range: assertion 'gst_buffer_is_writable (buffer)' failed
(gscam:17521): GStreamer-WARNING **: 01:39:03.282: free_priv_data: object finalizing but still has parent (object:0xaaab2459a7e0, parent:0xaaab2456b6b0)
(gscam:17521): GStreamer-WARNING **: 01:39:03.282: free_priv_data: object finalizing but still has 1 parents (object:0xaaab2459a7e0)
Anyone who solve this problem??
Hi
Im having issues starting my camera with GStreamer with this package, the camera works fine when i type this in the terminal without using ros :
gst-launch-1.0 udpsrc port=5004 ! application/x-rtp, payload=96 ! rtph264depay ! avdec_h264 ! autovideosink
i reconfigured the v4l.launch file and looks like this :
<launch>
<!-- This launchfile should bring up a node that broadcasts a ros image
transport on /webcam/image_raw -->
<arg name="DEVICE" default="arkcam"/>
<!-- The GStreamer framerate needs to be an integral fraction -->
<arg name="FPS" default="30/1"/>
<arg name="PUBLISH_FRAME" default="false"/>
<arg name="GST10" default="True"/>
<node ns="v4l" name="gscam_driver_v4l" pkg="gscam" type="gscam" output="screen">
<param name="camera_name" value="arkcam"/>
<param name="camera_info_url" value="package://gscam/examples/uncalibrated_parameters.ini"/>
<param unless="$(arg GST10)" name="gscam_config" value="udpsrc port=5008 ! application/x-rtp, payload=96 ! rtph264depay ! avdec_h264 ! autovideosink"/>
<param if="$(arg GST10)" name="gscam_config" value="udpsrc port=5008 ! application/x-rtp, payload=96 ! rtph264depay ! avdec_h264 ! autovideosink"/>
<param name="frame_id" value="/v4l_frame"/>
<param name="sync_sink" value="true"/>
</node>
</launch>
however when i launch this file i get the following error :
ERROR:/home/dg/simulation_ws/src/gscam/src/gscam.cpp:167:bool gscam::GSCam::init_stream(): assertion failed: (outpad)
any help would be appreciated. thank you
I am getting the live camera feeds in /camera/image_raw topic in ROS melodic. How to pass this feeds to gstreamer? i have a process with Deepstrem sdk. I want to pass this strems to deepstrem using gstream.
I discovered a memory leak while using GSCam for a project. The problem is that, under certain circumstances, the GSCam node threat would run slower than the gstreamer pipeline and the frames will get stuck in the appsink given that nobody is pulling them at enough rate.
As I said, this is a strange combination that only occur under certain rare circumstances. In my case, this happened while running more than 2 instances of GSCam retrieving an uncompressed 4K image from capture devices (I guess the memory copy and conversion to ROS msg would take longer in this case, making the frames to get stuck in the appsink).
More specifically, the problem is seen in the following lines:
Lines 265 to 272 in 1b0b8e5
gst_app_sink_pull_sample()
(and the following code) takes longer to execute than what GStreamer is taking to generate frames in the pipeline.
From GStreamer AppSink element documentation:
Appsink will internally use a queue to collect buffers from the streaming thread. If the application is not pulling samples fast enough, this queue will consume a lot of memory over time.
I am trying to get gscam working on ROS2 Humble.
Pipeline
gst-launch-1.0 -v rtspsrc location=rtsp://main:[email protected]:554/11 do-retransmission=false latency=0 ! queue ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! videoscale ! video/x-raw,width=640,height=480 ! autovideosink
[component_container-1] [WARN] [1714984426.616609522] [gscam_node]: [camera] does not match default in file /home/user/../../install/gscam/share/gscam/examples/uncalibrated_parameters.ini
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/gscam_node' in container '/gscam_container'
[component_container-1] [INFO] [1714984426.616621495] [gscam_node]: Loaded camera calibration from package://gscam/examples/uncalibrated_parameters.ini
[component_container-1] [WARN] [1714984426.616650740] [gscam_node]: No camera frame_id set, using frame "camera_frame".
Environment
ROS_DISTRO=humble RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
Can you please help me? @gitjuanr @jeremroy @KnechtNoobrecht
What is the license of gscam package? There is no LICENSE file and I could not find the license for the original Brown Robotics Lab package that is mentioned in the readme.
The Gstreamer and the plugin-bad
(version 1.0) has been installed via apt-get install
.
The output of gst-inspect-1.0 decklinkvideosrc
is correct where a set of valid modes are printed.
The Gscam is compiled with GSTREAMER_VERSION_1_x=TRUE
(i.e. gstreamer 1.0) without any error.
The decklink.launch file has been modified accordingly:
<launch>
<!-- This launchfile should bring up a node that broadcasts a ros image
transport on /decklink/image_raw from the input channel of a BlackMagic
DeckLink SDI capture card-->
<!-- DeckLink config, run $ gst-inspect decklinksrc to see all the options for your card -->
<arg name="MODE" default="pal"/>
<arg name="CONNECTION" default="sdi"/>
<arg name="SUBDEVICE" default="0"/>
<arg name="PUBLISH_FRAME" default="false"/>
<node ns="decklink" name="gscam_driver_decklink" pkg="gscam" type="gscam" output="screen">
<param name="camera_name" value="default"/>
<param name="camera_info_url" value="package://gscam/examples/uncalibrated_parameters.ini"/>
<param name="gscam_config" value="**decklinkvideosrc** mode=$(arg MODE) connection=$(arg CONNECTION) subdevice=$(arg SUBDEVICE) ! ffmpegcolorspace "/>
<param name="frame_id" value="/decklink_frame"/>
<!-- This needs to be set to false to avoid dropping tons of frames -->
<param name="sync_sink" value="false"/>
</node>
<node name="decklink_transform" pkg="tf" type="static_transform_publisher" args="1 2 3 0 -3.141 0 /world /decklink_frame 10"/>
</launch>
When doing roslaunch gscam decklink.launch
, following error shown up:
process[decklink/gscam_driver_decklink-1]: started with pid [31450]
[ INFO] [1516390751.641571150]: Using gstreamer config from rosparam: "decklinkvideosrc mode=pal connection=sdi subdevice=0 ! ffmpegcolorspace"
[ INFO] [1516390751.645708444]: camera calibration URL: package://gscam/examples/uncalibrated_parameters.ini
[ INFO] [1516390751.645928707]: Loaded camera calibration from package://gscam/examples/uncalibrated_parameters.ini
[FATAL] [1516390751.658352781]: GStreamer: cannot link launchpipe -> sink
[FATAL] [1516390751.658481388]: Failed to initialize gscam stream!
WARNING: Catkin package name "suturePlanner_msgs" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, and underscores.
process[decklink_transform-2]: started with pid [31472]
[decklink/gscam_driver_decklink-1] process has finished cleanly
Would you please suggest what might be the problem?
Hi
im getting following error when running gscam to connect to a gstreamer sender with this config:
ERROR:/home/mamaddl/catkin_ws/src/gscam/src/gscam.cpp:150:bool gscam::GSCam::init_stream(): assertion failed: (outpad)
[gscam-3] process has died [pid 10794, exit code -6, cmd /home/mamaddl/catkin_ws/devel/lib/gscam/gscam /gscam/camera_info:=/camera/camera_info /gscam/image_raw:=/camera/image_raw /gscam/set_camera_info:=/camera/set_camera_info __name:=gscam __log:=/home/mamaddl/.ros/log/08193ad4-51aa-11e6-b8ae-74d02bbe85f6/gscam-3.log].
log file: /home/mamaddl/.ros/log/08193ad4-51aa-11e6-b8ae-74d02bbe85f6/gscam-3*.log
thanks in advance!
Hello
In order to save bandwidth, I am thinking to use h265codec instead of mjpeg. (Preferably hardware encoding-decoding, such as vaapih265enc
or nvv4l2h265enc
)
I am new to gscam and gstreamer.
I figure out following command to encode-decode at only one computer.
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=1280,height=720,framerate=(fraction)30/1' ! timeoverlay ! vaapih265enc ! vaapidecode ! vaapisink
My concern is to perform vaapih265enc
at one PC and vaapidecode
at another PC.
Is gscam is an appropriate tool for this problem?
I work with the DFM 27UR0135-ML camera:
v4l2-ctl --all
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : DFM 27UR0135-ML
Bus info : usb-0000:00:14.0-2
Driver version: 5.0.21
Capabilities : 0x84A00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 1280/960
Pixel Format : 'GRBG'
Field : None
Bytes per Line : 1280
Size Image : 1228800
Colorspace : Default
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 1280, Height 960
Default : Left 0, Top 0, Width 1280, Height 960
Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 1280, Height 960
Selection: crop_bounds, Left 0, Top 0, Width 1280, Height 960
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 60.000 (60/1)
Read buffers : 0
brightness 0x00980900 (int) : min=0 max=4095 step=1 default=16 value=16
gain 0x00980913 (int) : min=48 max=2047 step=1 default=48 value=2047
exposure_absolute 0x009a0902 (int) : min=1 max=10000 step=1 default=333 value=10
exposure_time_us 0x0199e201 (int) : min=100 max=1000000 step=1 default=33333 value=1000
gain_db_100 0x0199e204 (int) : min=0 max=1629 step=1 default=0 value=0
trigger_mode 0x0199e208 (bool) : default=0 value=0
trigger_delay 0x0199e210 (int) : min=0 max=10000000 step=10 default=0 value=150
strobe_enable 0x0199e211 (bool) : default=0 value=0
strobe_polarity 0x0199e212 (bool) : default=0 value=0
strobe_exposure 0x0199e213 (bool) : default=0 value=0
gpout 0x0199e216 (bool) : default=0 value=0
gpin 0x0199e217 (bool) : default=0 value=0
roi_offset_x 0x0199e218 (int) : min=0 max=1184 step=2 default=0 value=0
roi_offset_y 0x0199e219 (int) : min=0 max=864 step=2 default=0 value=0
roi_auto_center 0x0199e220 (bool) : default=1 value=1
trigger_polarity 0x0199e234 (bool) : default=0 value=0
override_scanning_mode 0x0199e257 (int) : min=0 max=2 step=1 default=0 value=0
trigger_global_reset_release 0x0199e261 (bool) : default=0 value=0
List of formats:
video/x-bayer grbg - 1280x960 - 60/1 50/1 40/1 30/1 20/1 10/1 video/x-bayer grbg - 1280x720 - 80/1 60/1 50/1 40/1 30/1 20/1 10/1 video/x-bayer grbg - 1024x768 - 80/1 70/1 60/1 40/1 30/1 20/1 10/1 video/x-bayer grbg - 640x480 - 120/1 90/1 60/1 30/1 15/1 10/1 video/x-raw GRAY8 - 1280x960 - 60/1 50/1 40/1 30/1 20/1 10/1 video/x-raw GRAY8 - 1280x720 - 80/1 60/1 50/1 40/1 30/1 20/1 10/1 video/x-raw GRAY8 - 1024x768 - 80/1 70/1 60/1 40/1 30/1 20/1 10/1 video/x-raw GRAY8 - 640x480 - 120/1 90/1 60/1 30/1 15/1 10/1 video/x-raw GRAY16_LE - 1280x960 - 70/1 60/1 50/1 40/1 30/1 20/1 10/1 video/x-raw GRAY16_LE - 640x480 - 120/1 90/1 60/1 30/1 15/1 10/1 video/x-raw { RGBx xRGB BGRx xBGR RGBA ARGB BGRA ABGR } - 1280x960 - 60/1 50/1 40/1 30/1 20/1 10/1 video/x-raw { RGBx xRGB BGRx xBGR RGBA ARGB BGRA ABGR } - 1280x720 - 80/1 60/1 50/1 40/1 30/1 20/1 10/1 video/x-raw { RGBx xRGB BGRx xBGR RGBA ARGB BGRA ABGR } - 1024x768 - 80/1 70/1 60/1 40/1 30/1 20/1 10/1 video/x-raw { RGBx xRGB BGRx xBGR RGBA ARGB BGRA ABGR } - 640x480 - 120/1 90/1 60/1 30/1 15/1 10/1
However when I use the gscam configuration:
sudo chmod 777 /dev/video0
export GSCAM_CONFIG="v4l2src ! device=/dev/video0 ! video/x-raw, format=BGRx,width=1280,height=960,framerate=60/1 ! videoconverter $
rosrun gscam gscam
I have the following response and error:
[ INFO] [1568046942.639736230]: Using gstreamer config from env: "v4l2src ! device=/dev/video0 ! video/x-raw, format=BGRx,width=1280,height=960,framerate=60/1 ! videoconverter ! video/x-raw,format=RGB ,width=1280,height=960,framerate=60/1 ! shmsink socket-path=/tmp/ros_mem" [ INFO] [1568046942.643547063]: using default calibration URL [ INFO] [1568046942.643609848]: camera calibration URL: file:///home/si2c/.ros/camera_info/camera.yaml [ INFO] [1568046942.643677431]: Unable to open camera calibration file [/home/si2c/.ros/camera_info/camera.yaml] [ WARN] [1568046942.643712920]: Camera calibration file /home/si2c/.ros/camera_info/camera.yaml not found. [ INFO] [1568046942.643743469]: Loaded camera calibration from [FATAL] [1568046942.658753473]: GStreamer: cannot link launchpipe -> sink [FATAL] [1568046942.658835823]: Failed to initialize gscam stream!
**
Is there any support planned for noetic? Compiling from source under ubuntu 20.04 is easy enough and works out of the box. But when running it the node segfaults right away after sending a first image.
Any plans to support ROS2? (Or any forks that support ROS2?)
As a result of resolving issue #13 (problems compiling on OSX), I came across this second problem. When launching gscam image_raw
and camera_info
topics are not published. The only published topic is the gscam node itself, which in this case is still called "/v4l/gscam_driver_v4l".
Note that the hardware seems to be active, so it might be that I haven't launched all necessary processes. I'm currently running only roscore and gscam.
Hi im all new to this and i need some guidance/help with something. im using a camera and i can started without ros by typing this in the command line : gst-launch-1.0 udpsrc port=5008 ! application/x-rtp, payload=96 ! rtph264depay ! avdec_h264 ! autovideosink
.
how to put all of this information a launch file ? and which launch file do i use since there are many.
Thanks
The gscam_config I'm using is reading from a udpsink. Is there a way to handle the case when no data is being received by the udpsink (maybe using timeout) so that I can trigger a restart?
We are trying to work on the camera node of Redtail (https://github.com/NVIDIA-Jetson/redtail/wiki/Launch-Sequence-and-Flying). We have the ZED SDK already set up including the zed-ros-wrapper ROS package.
Although we are able to open the ZED camera by using,
roslaunch zed_wrapper display.launch
and also separately by using GStreamer -
gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-raw,framerate=30/1,width=3840,height=1080 ! xvimagesink
but we are unable to publish camera feed in ROS, by running the gscam node -
rosrun gscam gscam _gscam_config:="v4l2src device=/dev/video1 ! video/x-raw,framerate=30/1,width=3840,height=1080 ! xvimagesink"
We get the following error.
nvidia@tegra-ubuntu:~/ws$ rosrun gscam gscam _gscam_config:="v4l2src device=/dev/video1 ! video/x-raw,framerate=30/1,width=3840,height=1080 ! xvimagesink"
[ INFO] [1530639947.492156689]: Using gstreamer config from rosparam: "v4l2src device=/dev/video1 ! video/x-raw,framerate=30/1,width=3840,height=1080 ! xvimagesink"
[ INFO] [1530639947.499267966]: using default calibration URL
[ INFO] [1530639947.499362430]: camera calibration URL: file:///home/nvidia/.ros/camera_info/camera.yaml
[ INFO] [1530639947.501065754]: Loaded camera calibration from
**
ERROR:/home/nvidia/ws/src/gscam/src/gscam.cpp:167:bool gscam::GSCam::init_stream(): assertion failed: (outpad)
Aborted (core dumped)
I need to capture a stereo video using a Decklink card. The two channels are combined for a side-by-stereo for the viewer but I also need the unmodified videos for data collection. My gst-launch
line looks like:
gst-launch-1.0 \
decklinkvideosrc device-number=1 connection=sdi mode=1080i5994 ! deinterlace method=greedyh ! tee name=t1 \
decklinkvideosrc device-number=0 connection=sdi mode=1080i5994 ! deinterlace method=greedyh ! tee name=t0 \
t1. ! queue ! c. \
t0. ! queue ! c. \
compositor name=c \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=960 sink_0::height=1080\
sink_1::xpos=960 sink_1::ypos=0 sink_1::width=960 sink_1::height=1080 ! \
video/x-raw,width=1920,height=1080 ! \
autovideosink \
t1. ! queue ! autovideosink \
t0. ! queue ! fpsdisplaysink video-sink=autovideosink text-overlay=true
I have two tee
s and one compositor
so 3 outputs. Is there any way to code this in a launch file? If not, I assume I will have to code this in C++.
Please consider releasing indigo debs. I can confirm that it compiles and runs just fine on 14.04 x64.
Hello everyone, I'm working with a Jetson Nano Dev Kit B01 (Ubuntu 18.04 & ROS melodic) and a pair of IMX219 cameras, trying to publish their raw image into the ROS network.
I've written the following launch file, so that I can run a gscam
node for each camera at once. The problem is that it won't let me have 2 gscam
nodes running at the same time, and I can't seem to find the error.
I've successfully launched a very similar launch file for a single camera (commenting out the "right" group). I've also tried creating a launch file for each camera, but when I launch the second one in a new terminal, one of them fails. The node that fails seems to be randomly selected, in a way that it doesn't appear to have anything to do with the order in which I launched them.
Launch file:
<launch>
<arg name="left_camera" default="0"/>
<arg name="right_camera" default="1"/>
<arg name="width" default="3280"/>
<arg name="height" default="2464"/>
<arg name="fps" default="20/1"/>
<arg name="format" default="NV12"/>
<group ns="left">
<node pkg="gscam" type="gscam" name="gscam">
<param name="camera_name" value="default"/>
<param name="gscam_config" value="nvarguscamerasrc sensor-id=(int)$(arg left_camera) ! video/x-raw(memory:NVMM), width=(int)$(arg width), height=(int)$(arg height), format=(string)$(arg format), framerate=(fraction)$(arg fps) ! nvvidconv flip-method=6 ! video/x-raw, format=(string)BGRx ! videoconvert"/>
<param name="camera_info_url" value="file://$(find my_stereo_camera)/config/calibration/uncalibrated_parameters.ini"/>
<param name="frame_id" value="/left_frame"/>
<param name="sync_sink" value="false"/>
<remap from="camera/image_raw" to="image_raw"/>
<remap from="camera/camera_info" to="camera_info"/>
</node>
</group>
<group ns="right">
<node pkg="gscam" type="gscam" name="gscam">
<param name="camera_name" value="default"/>
<param name="gscam_config" value="nvarguscamerasrc sensor-id=(int)$(arg right_camera) ! video/x-raw(memory:NVMM), width=(int)$(arg width), height=(int)$(arg height), format=(string)$(arg format), framerate=(fraction)$(arg fps) ! nvvidconv flip-method=6 ! video/x-raw, format=(string)BGRx ! videoconvert"/>
<param name="camera_info_url" value="file://$(find my_stereo_camera)/config/calibration/uncalibrated_parameters.ini"/>
<param name="frame_id" value="/right_frame"/>
<param name="sync_sink" value="false"/>
<remap from="camera/image_raw" to="image_raw"/>
<remap from="camera/camera_info" to="camera_info"/>
</node>
</group>
</launch>
Error message:
$ roslaunch my_stereo_camera my_stereo_camera.launch
... logging to /home/jetsonnano/.ros/log/a8531376-7d9e-11ee-a51e-401c83806a8d/roslaunch-jetsonnano-desktop-16019.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://localhost:38005/
SUMMARY
========
PARAMETERS
* /left/gscam/camera_info_url: file:///home/jets...
* /left/gscam/camera_name: default
* /left/gscam/frame_id: /left_frame
* /left/gscam/gscam_config: nvarguscamerasrc ...
* /left/gscam/sync_sink: True
* /right/gscam/camera_info_url: file:///home/jets...
* /right/gscam/camera_name: default
* /right/gscam/frame_id: /right_frame
* /right/gscam/gscam_config: nvarguscamerasrc ...
* /right/gscam/sync_sink: True
* /rosdistro: melodic
* /rosversion: 1.14.13
NODES
/left/
gscam (gscam/gscam)
/right/
gscam (gscam/gscam)
ROS_MASTER_URI=http://localhost:11311
process[left/gscam-1]: started with pid [16040]
process[right/gscam-2]: started with pid [16041]
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:751 Failed to create CaptureSession
[ERROR] [1699383114.684800098]: Could not get gstreamer sample.
[right/gscam-2] process has finished cleanly
log file: /home/jetsonnano/.ros/log/a8531376-7d9e-11ee-a51e-401c83806a8d/right-gscam-2*.log
Any help will be much appreciated :)
ROS gscam doesn't seem to support Tee, I never have an image stream, nor do I get any error output. Here is the tee that I use, but from research, this seems to be a common thread. A workaround is to launch the tee with a udpsink end in python, and using a udpsrc as my gscam config.
Here is my example gscamconfig with a Tee:
nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM),width=1280,height=720,framerate=15/1 ! nvvidconv flip-method=2 ! tee name=t1 t1. ! queue silent=true ! nvv4l2h264enc bitrate=8000000 ! h264parse config-interval=1 ! queue silent=true leaky=downstream ! rndbuffersize max=65000 ! udpsink host=127.0.0.1 port=5001 sync=false t1. ! video/x-raw, format=BGRx ! videoconvert'
Is this a known issue? If so, is there any plan on resolving it?
See here: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-dparams-parameters.html
Run gst-inspect v4l2src
to see the parameters for v4l2.
Using latest checkout (e0d255f ) catkin_make
fails with
[ 96%] Built target stereoimageproc_exe
Linking CXX shared library /Users/kenz/Documents/catkin_ws/devel/lib/libgscam.dylib
Undefined symbols for architecture x86_64:
"image_transport::ImageTransport::advertiseCamera(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, bool)", referenced from:
gscam::GSCam::init_stream() in gscam.cpp.o
"image_transport::ImageTransport::ImageTransport(ros::NodeHandle const&)", referenced from:
gscam::GSCam::GSCam(ros::NodeHandle, ros::NodeHandle) in gscam.cpp.o
"image_transport::ImageTransport::~ImageTransport()", referenced from:
gscam::GSCam::GSCam(ros::NodeHandle, ros::NodeHandle) in gscam.cpp.o
gscam::GSCam::~GSCam() in gscam.cpp.o
"camera_info_manager::CameraInfoManager::validateURL(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
gscam::GSCam::configure() in gscam.cpp.o
"camera_info_manager::CameraInfoManager::getCameraInfo()", referenced from:
gscam::GSCam::publish_stream() in gscam.cpp.o
"camera_info_manager::CameraInfoManager::setCameraName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
gscam::GSCam::configure() in gscam.cpp.o
"camera_info_manager::CameraInfoManager::loadCameraInfo(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
gscam::GSCam::configure() in gscam.cpp.o
.
.
.
"_gst_version_string", referenced from:
gscam::GSCam::init_stream() in gscam.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/kenz/Documents/catkin_ws/devel/lib/libgscam.dylib] Error 1
make[1]: *** [gscam/CMakeFiles/gscam.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed
I'm not sure what library it's looking for. FWIW, I've added image_transport
to the workspace src directory.
I am using gscam on Jetson nano,
gscam consume up to 50% of the cpu,
and gscam image view in rqt like waterwave, do I miss sth, or the Jetson nano card's resource is too low?
img
http://ros.org/wiki/camera_drivers
specifically, the polling mode is needed
Hey,
It seems like the information provided regarding the service name in your ros2 branch is inaccurate. Here in the camera_info_manager class used, the service name remains set_camera_info
.
Can you please confirm and make the necessary change to the README?
I am trying to stream a video from gimble camera but I getting:
[FATAL] [1626774208.110004686]: Invalid 'video_stream_provider': rtsp://192.168.0.201:554/live
in the launch file I changed to param name="gscam_config" value="gst-launch-1.0 -v rtspsrc location=rtsp://192.168.0.201:554/live0 drop-on-latency=true use-pipeline-clock=true do-retransmission=false latency=0 protocols=GST_RTSP_LOWER_TRANS_UDP ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink sync=true
Do I miss anything else?
roslaunch gscam v4l.laucnh gives following output with fatal errors in kinetic/ubuntu 16.04:
PARAMETERS
NODES
/v4l/
gscam_driver_v4l (gscam/gscam)
ROS_MASTER_URI=http://localhost:11311
core service [/rosout] found
process[v4l/gscam_driver_v4l-1]: started with pid [10328]
[ INFO] [1513049835.971253216]: Using gstreamer config from rosparam: "v4l2src device=/dev/video0 ! video/x-raw-rgb,framerate=30/1 ! ffmpegcolorspace"
[ INFO] [1513049835.974249603]: camera calibration URL: package://gscam/examples/uncalibrated_parameters.ini
[ INFO] [1513049835.974403749]: Loaded camera calibration from package://gscam/examples/uncalibrated_parameters.ini
[FATAL] [1513049835.975789661]: no element "v4l2src"
[FATAL] [1513049835.975809444]: Failed to initialize gscam stream!
[v4l/gscam_driver_v4l-1] process has finished cleanly
log file: /home/ubuntu/.ros/log/d5ded8ea-dee2-11e7-b44c-d46a6ad5baeb/v4l-gscam_driver_v4l-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.