USB Camera video record

Hello,

I’m looking for a nice way to record video from USB camera.
Currently using OpenCV library but not so fast as expected.

Please share some tips if any.

thanks in advance,

Charles

you may try something from the below

apt-get install gstreamer1.0-plugins-bad
 gst-launch-1.0 nvcamerasrc num-buffers=300 ! omxh264enc ! queue ! mux. alsasrc num-buffers=1000 device="hw:2,0" ! voaacenc ! queue ! qtmux name=mux ! filesink location=b.mp4
[ Use case II-b-1: noaudio]  
 gst-launch-1.0 nvcamerasrc fpsRange="30.0 30.0" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! omxh264enc ! qtmux ! filesink location=test1.mp4 -e
[ Use case II-b-2: noaudio]   
 gst-launch-1.0 nvcamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! omxh264enc ! 'video/x-h264,stream-format=(string)byte-stream' ! filesink location="test.h264" -e