I will explain how to stream h264 using gstreamer.
First, you need Linux kernel 3.2 or later to have "H264 pixel format" supported in the v4l2 drivers.
Use v4l2-ctl to check that you have proper H.264 support for the camera:
# v4l2-ctl --list-formats
# v4l2-ctl --list-formats-ext
Next, you will need video4linux libraries and utilities. These include:
libv4l and libv4l-dev
v4l-utils
qv4l2 (may be part of v4l-utils)
v4l2ucp
Setting up the frame rate:
# v4l2-ctl --set-fmt-video=width=800,height=448,pixelformat=1
# v4l2-ctl --set-parm=30
Gstreamer has a v4l2src input element, it does not yet support the video/x-264 format.
But, we can capture H.264 stream and send to a file or even standard out, by simply piping it to the standard input of a gstreamer pipeline using a file source:
# ./capture -c 100000 -o | gst-launch -v -e filesrc location=/dev/fd/0 ! h264parse ! decodebin2 ! xvimagesink sync=false
The encoded video stream can be sent over the network using Gstreamer:
# gst-launch -v udpsrc port=4000 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! \
rtph264depay ! ffdec_h264 ! xvimagesink sync=false
# ./capture -c 10000 -o | gst-launch -v -e filesrc location=/dev/fd/0 ! h264parse ! rtph264pay ! udpsink host=host_IP port=4000
I hope you will find this useful.