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

Revision history [back]

Maybe the mode you selected is not supported by the camera or the node. I have some problem with that too. I could not get to use libuvc_camera to give me an mjpeg stream with 30 fps in my desired resolution. I always struggled even with other tools. Just vlc worked for me so far.

Here is my thread: http://answers.ros.org/question/210831/how-to-get-an-mjpeg-stream-with-30-fps/

You can list supported formats by:

v4l2-ctl --list-formats-ext -d /dev/video0

Maybe the mode you selected is not supported by the camera or the node. I have some problem with that too. I could not get to use libuvc_camera to give me an mjpeg stream with 30 fps in my desired resolution. I always struggled even with other tools. Just vlc worked for me so far.

Here is my thread: http://answers.ros.org/question/210831/how-to-get-an-mjpeg-stream-with-30-fps/

You can list supported formats by:

v4l2-ctl --list-formats-ext -d /dev/video0

UPDATE: I tried usb_cam with mine now. It seems to work perfectly for me:

<launch>
  <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" >
    <param name="video_device" value="/dev/video1" />
    <param name="image_width" value="1280" />
    <param name="image_height" value="720" />
    <param name="pixel_format" value="mjpeg" />
    <param name="camera_frame_id" value="usb_cam" />
    <param name="io_method" value="mmap"/> 
  </node>   
</launch>

So I guess I will probably use usb_cam instead of libuvc_camera.

(btw not mjpg -> mjpeg)

Maybe the mode you selected is not supported by the camera or the node. I have some problem with that too. I could not get to use libuvc_camera to give me an mjpeg stream with 30 fps in my desired resolution. I always struggled even with other tools. Just vlc worked for me so far.

You can list supported formats by:

v4l2-ctl --list-formats-ext -d /dev/video0

UPDATE: I tried usb_cam with mine now. It seems to work perfectly for me:

<launch>
  <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" >
    <param name="video_device" value="/dev/video1" />
    <param name="image_width" value="1280" />
    <param name="image_height" value="720" />
    <param name="pixel_format" value="mjpeg" />
    <param name="camera_frame_id" value="usb_cam" />
    <param name="io_method" value="mmap"/> 
  </node>   
</launch>

Found it here

So I guess I will probably use usb_cam instead of libuvc_camera.

(btw not mjpg -> mjpeg)

Maybe the mode you selected is not supported by the camera or the node. I have some problem with that too. I could not get to use libuvc_camera to give me an mjpeg stream with 30 fps in my desired resolution. I always struggled even with other tools. Just vlc worked for me so far.

You can list supported formats by:

v4l2-ctl --list-formats-ext -d /dev/video0

UPDATE: UPDATE:

I tried usb_cam with mine now. It seems to work perfectly for me:

 <launch>
   <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" >
     <param name="video_device" value="/dev/video1" />
     <param name="image_width" value="1280" />
     <param name="image_height" value="720" />
     <param name="pixel_format" value="mjpeg" />
     <param name="camera_frame_id" value="usb_cam" />
     <param name="io_method" value="mmap"/> 
   </node>   
 </launch>

Found it here

So I guess I will probably use usb_cam instead of libuvc_camera.

(btw not mjpg -> mjpeg)

UPDATE2:

I checked the code for the io_method and the formats supported by the node:

io_methods: mmap, read, userptr

formats: yuyv, uyvy, mjpeg, yuvmono10, rgb24

UsbCam::pixel_format UsbCam::pixel_format_from_string(const std::string& str)
{
    if (str == "yuyv")
      return PIXEL_FORMAT_YUYV;
    else if (str == "uyvy")
      return PIXEL_FORMAT_UYVY;
    else if (str == "mjpeg")
      return PIXEL_FORMAT_MJPEG;
    else if (str == "yuvmono10")
      return PIXEL_FORMAT_YUVMONO10;
    else if (str == "rgb24")
      return PIXEL_FORMAT_RGB24;
    else
      return PIXEL_FORMAT_UNKNOWN;
}