I need to record a video using my usb webcam in jetson nano. I found gstreamer with h264 encoding for lower the cpu percentage. But i am new to gstreamer so i had errors when running some gstreamer command. So, can any one tell me how to do that and give me proper command for gstreamer using gpu with encoding .
My strip camera working fine using the below command:
gst-launch-1.0 nvarguscamerasrc num-buffers=200 ! 'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12' ! omxh264enc ! qtmux ! filesink location=test.mp4 -e
When i using my usb camera with the below command, command exit with warning message :
gst-launch-1.0 -v v4l2src device=/dev/video2 ! 'video/x-raw,width=640, height=480, framerate=30/1, format=YUY2' ! omxh264enc ! qtmux ! filesink location=test.mp4 -e
WARNING: erroneous pipeline: could not link v4l2src0 to omxh264enc-omxh264enc0, omxh264enc-omxh264enc0 can’t handle caps video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(string)YUY2
Camera spec:
Camera details from v4l2:
v4l2-ctl --info -d /dev/video2 --list-formats
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : 3.0 USB Camera
Bus info : usb-70090000.xusb-1.2
Driver version: 4.9.140
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘MJPG’ (compressed)
Name : Motion-JPEG
Index : 1
Type : Video Capture
Pixel Format: ‘YUYV’
Name : YUYV 4:2:2