ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

using gscam with janus-gateway

asked 2016-11-26 02:46:57 -0600

AlgoRhythm gravatar image

When running my pipeline with gst-launch-1.0 in terminal, I get exactly what I want to see. However, when transferring that pipeline to my gscam launchfile, no video stream is recognized on the port. Am I doing something wrong?

my launch file is just a copy of their sample with gscam_config changed:

 <launch>

    <arg name="DEVICE" default="/dev/video0"/>
    <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="default"/>
      <param name="camera_info_url" value="package://gscam/examples/uncalibrated_parameters.ini"/>
      <param name="gscam_config" value="v4l2src device=$(arg DEVICE) ! video/x-raw, width=640, height=480 ! ffmpegcolorspace ! x264enc speed-preset=ultrafast tune=zerolatency byte-stream=true bitrate=3000 threads=1 ! h264parse config-interval=1 ! rtph264pay ! udpsink host=127.0.0.1 port=8004"/>
      <param name="frame_id" value="/v4l_frame"/>
      <param name="sync_sink" value="true"/>
    </node>

    <node if="$(arg PUBLISH_FRAME)" name="v4l_transform" pkg="tf" type="static_transform_publisher" args="1 2 3 0 -3.141 0 /world /v4l_frame 10"/>
</launch>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-11-26 03:47:12 -0600

gvdhoorn gravatar image

When running my pipeline with gst-launch-1.0 in terminal, I get exactly what I want to see.

'see': where? When you open the rtp stream at 127.0.0.1:8004 in something like VLC?

However, when transferring that pipeline to my gscam launchfile, no video stream is recognized on the port.

Which 'port'? Would that be 127.0.0.1:8004 again?

According to the gscam docs:

gscam can attach itself to a specially formatted pipeline. Provided this pipeline is processing RGB video, gscam will rebroadcast the video over as both a standard ROS image transport and a ROS Camera.

Could it be that the udpsink you have in your gscam_config is depriving gscam from its input, which will make it not publish anything?

Based on the same sentence in the documentation, I assume the ! x264enc speed-preset=ultrafast tune=zerolatency byte-stream=true bitrate=3000 threads=1 ! h264parse config-interval=1 ! rtph264pay ! udpsink host=127.0.0.1 port=8004 part of your pipeline shouldn't be necessary (there is no infrastructure in ROS to deal with h264 encoded images or streams).

The purpose of gscam is to make it possible to publish RGB output of an arbitrary GStreamer pipeline to a ROS node graph. I'm not sure that is what you had in mind.

edit flag offensive delete link more

Comments

the rtp stream in port 8004 should be detected by Janus-gateway and broadcasted over webRTC. And yes 8004 again. Yeah I really didnt have a very strong understanding of gscam. Need to take advantage of both the RGB output for image processing, but also want to broadcast a low latency video stream.

AlgoRhythm gravatar image AlgoRhythm  ( 2016-11-26 17:59:27 -0600 )edit

Just figured it out! Thanks for your interpretation of the docs @gvdhoorn. Really helped me think though this. For those interested: used tee's in my pipeline. gscam needs image/jpeg or video/x-raw in RGB to function properly so you have to send over udp in a separate branch.

AlgoRhythm gravatar image AlgoRhythm  ( 2016-11-26 19:18:22 -0600 )edit

example:

v4l2src device=$(arg DEVICE) ! video/x-raw,width=1280,height=720 ! tee name=t t. ! queue ! x264enc ! h264parse config-interval=1 ! rtph264pay ! udpsink host=127.0.0.1 port=8004 t. ! queue ! videoconvert
AlgoRhythm gravatar image AlgoRhythm  ( 2016-11-26 19:19:46 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-11-26 02:46:57 -0600

Seen: 745 times

Last updated: Nov 26 '16