[FFmpeg-user] how to ­get h264 stream fr­om web­cam with hardware H­264

Val Malykh valem at pochta.ru
Thu Dec 20 10:01:13 CET 2012


Hello Lou,

I've done as you advised and I have such output:

[video4linux2,v4l2 @ 0xc0b5b0] C : Unsupported :                H.264

full output is here: http://pastebin.com/4wSRDcL5

As far as I understand receiving H264 video directly is unsupported, but I've managed to receive video stream by using capture app of Alexandru Csete (http://oz9aec.net/index.php/gstreamer/473-using-the-logitech-c920-webcam-with-gstreamer).

It seems to be ok in this case:

 ../bonecam/capture/capture -f 640x480 -c 5000 -o | ./ffmpeg -i - -vcodec copy -an test1.h264

I am able to view recorded video in VLC, but when I'm trying to stream it out I have an issue with playing a stream like this:

../bonecam/capture/capture -f 640x480 -c 100000 -o | ./ffmpeg -i - -vcodec copy -an http://localhost:8099/feed1.ffm

VLC shows only green screen and that's it. In the statistics there is info that it could decode only 2 frames, but it receiving a stream itself.

My ffserver config is here: http://pastebin.com/evNJWpcr

Any suggestions would be great. Thank you for your help.

Regards,

Valentin Malykh.

Втр 18 Дек 2012 23:05:34 +0400, Lou  написал:
On Tue, Dec 18, 2012, at 04:50 AM, Val Malykh wrote:
> > Втр 18 Дек 2012 16:14:57 +0400, Val Malykh  написал:
> >  
> > Hi all.
> > 
> > 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?
> > 
> > I'm successfully can stream with transcoding with -vcodec libx264, but
> > I'd like to get hardware encoded stream instead.
> >  
> > Regards,
> > 
> > Valentin Malykh
>
> I've managed to do this:http://pastebin.com/h4gB9xs3 
> As far as I understand I'm having the same problem as this
> person:https://ffmpeg.org/trac/ffmpeg/ticket/1387 
> Any suggestions how to fix it?
> Regards,Valentin Malykh.

The output of "-list_formats all" would be useful:
ffmpeg -f video4linux2 -list_formats all -i /dev/video0

Then try choosing one of the listed formats with "-input_format", as an
input option, instead of "-vcodec".

See the video4linux2 section in "ffmpeg -h full" and the ffmpeg
documentation for video4linux2:
http://ffmpeg.org/ffmpeg.html#video4linux2

Please remember that top-posting is not recommended for this mailing
list, and please reply to your previous message instead of making a new
"thread". See the archives for an example of what I am trying to
explain:

_______________________________________________
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user


More information about the ffmpeg-user mailing list