HI William,

I played around with a JPEG-webcam using GSCAM.  I needed to make two 
tweaks.
1. Install the gstreamer appsink package i.e. "smart install
gst-plugins-base-app".  It looks like [1] gscam is tacking this plugin
onto the end of the gstreamer pipeline.
2. Specify the (undocumented) 'image_encoding' parameter as 'jpeg'.
For this, I grabbed the example launch [2] file and added a "<param
name="image_encoding" value="jpeg"/>" line.  Perhaps unnecessarily, I
also tweaked the gstreamer pipeline and disabled sync_sink so my
launch file looked like this:
<launch>
  <!-- This launchfile should bring up a node that broadcasts a ros image
       transport on /webcam/image_raw -->

  <arg name="DEVICE" default="/dev/video0"/>
  <!-- The GStreamer framerate needs to be an integral fraction -->
  <arg name="FPS" default="5/1"/>
  <arg name="PUBLISH_FRAME" default="false"/>

  <node ns="v4l" name="gscam_driver_v4l" pkg="gscam" type="gscam"
output="screen">
    <param name="camera_name" value="default"/>
    <param name="gscam_config" value="v4l2src device=$(arg DEVICE) !
image/jpeg,framerate=$(arg FPS) "/>
    <param name="frame_id" value="/v4l_frame"/>
    <param name="sync_sink" value="false"/>
    <param name="image_encoding" value="jpeg"/>
  </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>


[1] https://github.com/ros-drivers/gscam/blob/master/src/gscam.cpp
[2] 
https://raw.githubusercontent.com/ros-drivers/gscam/master/examples/v4l.launch

HTH,

Ash

On Friday, May 29, 2015 at 3:10:24 PM UTC-7, William Phan wrote:
>
> Hi,
>
> Has anyone been able to get the gscam package working with the meta-ros 
> layer?  I'm trying to send a live video feed from a webcam attached to a 
> Gumstix Overo COM on a Tobi expansion board to a host machine(where roscore 
> is running) with Ubuntu 14.04+ROS Indigo.  My gumstix-console-image.bb 
> includes the following:
>
>
>  89 GSCAM_INSTALL = " \
>  90   gscam \
>  91   nodelet \
>  92   cv-bridge \
>  93   roscpp \
>  94   theora-image-transport \
>  95   sensor-msgs \
>  96   camera-calibration-parsers \
>  97   camera-info-manager \
>  98 "
>  99 
> 100 IMAGE_INSTALL += " \
> 101   ${FIRMWARE_INSTALL} \
> 102   ${SYSTEM_TOOLS_INSTALL} \
> 103   ${DEV_TOOLS_INSTALL} \
> 104   ${NETWORK_TOOLS_INSTALL} \
> 105   ${MEDIA_TOOLS_INSTALL} \
> 106   ${GRAPHICS_LIBS} \
> 107   ${UTILITIES_INSTALL} \
> 108   ${GSCAM_INSTALL} \
> 109 "
>
>
> The COM recognizes the webcam (Microsoft LifeCam VX3000) and assigns it to 
> /dev/video0.
>
> I then install some missing plugins:
>
> $ smart update
> $ smart install gst-plugins-good-video4linux2
>
> and source the environmental variable:
>
> $ export GSCAM_CONFIG="v4l2src device=/dev/video0 ! video/x-raw-rgb ! 
> ffmpegcolorspace"
>
> but upon launching the gscam node, I am stuck at the following error 
> message: 
>
> root@overo:~# rosrun gscam gscam
> [ INFO] [1432936018.001607854]: Using gstreamer config from env: "v4l2src 
> device=/dev/video0 ! video/x-raw-rgb ! ffmpegcolorspace"
> [ INFO] [1432936018.140851232]: using default calibration URL
> [ INFO] [1432936018.144604670]: camera calibration URL: file:
> ///home/root/.ros/camera_info/camera.yaml
> [ INFO] [1432936018.147747792]: Unable to open camera calibration file [
> /home/root/.ros/camera_info/camera.yaml]
> [ WARN] [1432936018.151226588]: Camera calibration file /home/root/.ros/
> camera_info/camera.yaml not found.
> [ INFO] [1432936018.153820427]: Loaded camera calibration from 
>
> ** (gscam:1952): CRITICAL **: gst_app_sink_set_caps: assertion 
> 'GST_IS_APP_SINK 
> (appsink)' failed
>
> ** (gscam:1952): CRITICAL **: gst_base_sink_set_sync: assertion 
> 'GST_IS_BASE_SINK 
> (sink)' failed
>
> (gscam:1952): GStreamer-CRITICAL **: gst_element_link_pads_full: 
> assertion 'GST_IS_ELEMENT (dest)' failed
> [FATAL] [1432936020.927885414]: GStreamer: cannot link launchpipe -> sink
> [FATAL] [1432936020.931242147]: Failed to initialize gscam stream!
>
> Based on the error I suspected that GStreamer was the problem, so I ran 
> and installed:
> root@overo:~# gst-launch v4l2src device=/dev/video0 ! video/x-raw-rgb ! 
> ffmpegco
> WARNING: erroneous pipeline: no element "ffmpegcolorspace"
> root@overo:~# smart install gst-plugins-base-ffmpegcolorspace
>
> Now launching gscam again gives the following:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *root@overo:~# rosrun gscam gscam[ INFO] [1432936847.626166516]: Using 
> gstreamer config from env: "v4l2src device=/dev/video0 ! video/x-raw-rgb ! 
> ffmpegcolorspace"[ INFO] [1432936847.802852723]: using default calibration 
> URL[ INFO] [1432936847.806423066]: camera calibration URL: 
> file:///home/root/.ros/camera_info/camera.yaml[ INFO] 
> [1432936847.811702291]: Unable to open camera calibration file 
> [/home/root/.ros/camera_info/camera.yaml][ WARN] [1432936847.815394697]: 
> Camera calibration file /home/root/.ros/camera_info/camera.yaml not found.[ 
> INFO] [1432936847.819422776]: Loaded camera calibration from** 
> (gscam:2019): CRITICAL **: gst_app_sink_set_caps: assertion 
> 'GST_IS_APP_SINK (appsink)' failed** (gscam:2019): CRITICAL **: 
> gst_base_sink_set_sync: assertion 'GST_IS_BASE_SINK (sink)' 
> failed(gscam:2019): GStreamer-CRITICAL **: gst_bin_add: assertion 
> 'GST_IS_ELEMENT (element)' failed[FATAL] [1432936851.527239271]: 
> gst_bin_add() failed[FATAL] [1432936851.531999729]: Failed to initialize 
> gscam stream!*
>
> It looks like it is probably a GStreamer problem, any pointers or 
> suggestions will be much appreciated!
> William
>

Reply via email to