ros-drivers / gscam

ROS Camera driver for GStreamer-based video streams.
136 stars 172 forks source link

Gscam support for bayer2rgb #26

Open lamogui opened 8 years ago

lamogui commented 8 years ago

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...

lamogui commented 8 years ago

I removed ffmpegcolorspace I added this code

else if (buf->size > expected_frame_size)
          {
              ROS_WARN_STREAM( "GStreamer image buffer overflow: Expected frame to be "
                      << expected_frame_size << " bytes but got "
                      << (buf->size) << " bytes. (make sure frames are correctly encoded)");
          }

In fact bayer2rgb sent rgb data into 32bpp but gscam need 24bpp to function normally, so a fix is needed in gscam