I want to stream webcam live with ffmpeg. My Logitech c920 webcam has an output stream of raw and compressed data. The command ffmpeg -f v4l2 -list_formats all -i /dev/video1
produces the following console output:
[video4linux2,v4l2 @ 0x26709e0] Raw : yuyv422 : YUV 4:2:2 (YUYV) : 640x480 160x90 160x120 176x144 320x180 320x240 352x288 432x240 640x360 800x448 800x600 864x480 960x720 1024x576 1280x720 1600x896 1920x1080 2304x1296 2304x1536
[video4linux2,v4l2 @ 0x26709e0] Compressed: h264 : H.264 : 640x480 160x90 160x120 176x144 320x180 320x240 352x288 432x240 640x360 800x448 800x600 864x480 960x720 1024x576 1280x720 1600x896 1920x1080
[video4linux2,v4l2 @ 0x26709e0] Compressed: mjpeg : MJPEG : 640x480 160x90 160x120 176x144 320x180 320x240 352x288 432x240 640x360 800x448 800x600 864x480 960x720 1024x576 1280x720 1600x896 1920x1080
I would like to copy compressed h264 image and send it to ffserver.
When I use this command ffmpeg -r 25 -f v4l2 -i /dev/video0 -c:v libx264 -b:v 2500k http://localhost:8090/feed1.ffm
program gets the raw data and transcode it with h264 codec.
When I change the -c:v libx264
to -c:v copy
I get an error because ffmpeg tries to copy raw camera image.
How can I access h264 compressed image and send it to server?