[FFmpeg-user] how to get h264 stream from webcam with hardware H264 encoding support?

Carl Eugen Hoyos cehoyos at ag.or.at
Wed Dec 19 00:44:50 CET 2012


Val Malykh <valem <at> pochta.ru> writes:

> I have a webcam with hardware H264 encoding support and I'd 
> like to stream it with ffmpeg & ffserver. How can I get 
> hardware encoded h264 stream from camera with ffmpeg?

Does this patch help?

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

For future questions, please do not post information 
on external resources, always post the failing command 
line and complete, uncut console output in your mail.

And please remember not to top-post, Carl Eugen



More information about the ffmpeg-user mailing list