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

Revision history [back]

I would suggest an alternative way of bringing video data to the browser - http://wiki.ros.org/web_video_server

There is a few benefits:

  1. You don't need to convert ROS image data to something your browser can understand (your current issue)
  2. You can very easily reference result video stream in for example <img> tag (in your case <img src="http://localhost:8080/stream?topic=/cam1/image_raw&type=ros_compressed"/>)
  3. Bandwidth between ROS backend and browser will likely be more optimized so your video latency will likely be better

I would suggest an alternative way of bringing video data to the browser - http://wiki.ros.org/web_video_serverhttp://wiki.ros.org/web_video_server. That is, you will not have subscription to /cam1/image_raw/compressed topic but rather start web_video_server on ROS side and reference video stream in your HTML page like so:

`<img src="http://localhost:8080/stream?topic=/cam1/image_raw&type=ros_compressed"/>`

There is a few couple benefits:

  1. You don't need to convert ROS image data to something your browser can understand (your current issue)
  2. You can very easily reference result video stream in for example <img> tag (in your case <img src="http://localhost:8080/stream?topic=/cam1/image_raw&type=ros_compressed"/>)
  3. Bandwidth Depending on how web_video_server is configured less data might be passed between ROS backend and browser will likely thus improveing video latency
  4. On related note, If the video is designed to be more optimized so your consumed by a human operator and resolution does not make a big difference for you you might consider downsizing resolution of video latency will likely be betterstream thus further reducing bandwidth requirement

I would suggest an alternative way of bringing video data to the browser - http://wiki.ros.org/web_video_server. That is, you will not have subscription to /cam1/image_raw/compressed topic but rather start web_video_server on ROS side and reference video stream in your HTML page like so:

`<img src="http://localhost:8080/stream?topic=/cam1/image_raw&type=ros_compressed"/>`
<img src="http://localhost:8080/stream?topic=/cam1/image_raw&type=ros_compressed"/>

There is a couple benefits:

  1. You don't need to convert ROS image data to something your browser can understand (your current issue)
  2. Depending on how web_video_server is configured less data might be passed between ROS backend and browser thus improveing video latency
  3. On related note, If the video is designed to be consumed by a human operator and resolution does not make a big difference for you you might consider downsizing resolution of video stream thus further reducing bandwidth requirement