Actually I've succeed with streaming of h264 video with ffmpeg.
I was able to do this with help from ffmpeg-user list, especially from Carl Eugen Hoyos, author of this patch:
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index cd6aeb2..c3f813d 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -150,6 +150,7 @@ static struct fmt_map fmt_conversion_table[] = {
{ AV_PIX_FMT_NV12, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12 },
{ AV_PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_MJPEG },
{ AV_PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_JPEG },
+ { AV_PIX_FMT_NONE, AV_CODEC_ID_H264, V4L2_PIX_FMT_H264 },
#ifdef V4L2_PIX_FMT_CPIA1
{ AV_PIX_FMT_NONE, AV_CODEC_ID_CPIA, V4L2_PIX_FMT_CPIA1 },
#endif
Actual command I've used:
./ffmpeg -f video4linux2 -s 640x480 -r 15 -vcodec h264 -i /dev/video0 -an http://localhost:8099/feed1.ffm
But I wasn't able to get rid of transcoding, so I switched to vlc (and succeed).
Best Answer
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:
Next, you will need video4linux libraries and utilities. These include:
Setting up the frame rate:
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:
The encoded video stream can be sent over the network using Gstreamer:
I hope you will find this useful.