NVIDIA-AI-IOT / redtail

Perception and AI components for autonomous mobile robotics.
BSD 3-Clause "New" or "Revised" License
1.01k stars 346 forks source link

gscam problem with no video shown, even not shown in rqt-image window, not even gst-launch on host machine #143

Open vxgu86 opened 4 years ago

vxgu86 commented 4 years ago

gscam without stream works fine, but with stream get no video shown, even not shown in rqt-image window, not to say gst-launch on host machine. below is the good command and bad one, good and bad means that video shown up in rqt--image view. the difference is that bad one with one warning :No camera frame_id set, using frame "/camera_frame

what is the problem?

rosrun gscam gscam _gscam_config:="v4l2src device=/dev/video1 ! video/x-raw, width=1920, height=1080 ! videoconvert" [ INFO] [1570104225.635290176]: Using gstreamer config from rosparam: "v4l2src device=/dev/video1 ! video/x-raw, width=1920, height=1080 ! videoconvert" [ INFO] [1570104225.642275138]: using default calibration URL [ INFO] [1570104225.642379551]: camera calibration URL: file:///root/.ros/camera_info/camera.yaml [ INFO] [1570104225.642499450]: Unable to open camera calibration file [/root/.ros/camera_info/camera.yaml] [ WARN] [1570104225.642570273]: Camera calibration file /root/.ros/camera_info/camera.yaml not found. [ INFO] [1570104225.642625437]: Loaded camera calibration from [ INFO] [1570104225.664363851]: Time offset: 1570089213.989 [ INFO] [1570104225.788578399]: Publishing stream... [ INFO] [1570104225.788962099]: Started stream.

====================================================================

export GSCAM_CONFIG="v4l2src device=/dev/video1 ! tee name=t ! queue ! videoconvert ! omxh265enc ! video/x-h265, stream-format=byte-stream ! h265parse ! rtph265pay config-interl=1 ! udpsink host=172.17.0.1 port=6000 t. ! queue ! video/x-raw, width=1920, height=1080 ! Videoconvert"

rosrun gscam gscam

[ INFO] [1570102542.426655232]: Using gstreamer config from env: "v4l2src device=/dev/video1 ! tee name=t ! queue ! videoconvert ! omxh265enc ! video/x-h265, stream-format=byte-stream ! h265parse ! rtph265pay config-interl=1 ! udpsink host=172.17.0.1 port=6000 t. ! queue ! video/x-raw, width=1920, height=1080 ! Videoconvert" [ INFO] [1570102542.432330679]: using default calibration URL [ INFO] [1570102542.432401414]: camera calibration URL: file:///root/.ros/camera_info/camera.yaml [ INFO] [1570102542.432510606]: Unable to open camera calibration file [/root/.ros/camera_info/camera.yaml] [ WARN] [1570102542.432557445]: Camera calibration file /root/.ros/camera_info/camera.yaml not found. [ INFO] [1570102542.432625078]: Loaded camera calibration from [ WARN] [1570102542.433518370]: No camera frame_id set, using frame "/camera_frame". [ INFO] [1570102542.548376846]: Time offset: 1570089213.989 [ INFO] [1570102542.673508268]: Publishing stream... [ INFO] [1570102542.673848853]: Started stream.

mtbsteve commented 4 years ago

It seems that gscam udp streaming has an issue under Ubuntu 18.04/ROS melodic. I resolved it in the following way by installing a ros rtsp streamer like https://github.com/CircusMonkey/ros_rtsp In the ros_rtsp/config/stream_setup.yaml file you can either configure a zed camera node like:

stream-zed_camera:
    type: topic
    source: /zed/zed_node/left/image_rect_color
    mountpoint: /zedimage
    caps: video/x-raw,framerate=10/1,width=640,height=480
    bitrate: 150

or a gestreamer generic camera device like:

stream-camera:
    type: cam
    source: "v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=2560,height=720 ! omxh264enc ! rtph264pay"
    mountpoint: /camera
    bitrate: 150

In QGC, Mission Planner etc you can then directly stream the feed by enabling the RTSP option.