I am having trouble with my USB Camera capturing without losing frames.
GST_DEBUG=3 gst-launch-1.0 -e v4l2src ! 'video/x-raw,width=1920,height=1080,framerate=30/1' ! videoconvert ! x264enc tune=zerolatency ! mp4mux ! filesink location=test.mp4
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
0:00:01.803134525 1500166 0xaaab0937d2a0 FIXME basesink gstbasesink.c:3246:gst_base_sink_default_event:<filesink0> stream-start event without group-id. Consider implementing group-id handling in the upstream elements
0:00:01.803412094 1500166 0xaaab0937d2a0 WARN qtmux gstqtmux.c:2981:gst_qt_mux_start_file:<mp4mux0> Robust muxing requires reserved-moov-update-period to be set
0:00:01.917525558 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:01.315679075
0:00:02.593731466 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 4 - ts: 0:00:02.173136435
0:00:03.244768631 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:02.824055147
0:00:03.525756389 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 2 - ts: 0:00:02.988337139
0:00:03.609405490 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 2 - ts: 0:00:03.086927651
0:00:03.712037085 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 2 - ts: 0:00:03.185500523
0:00:03.810068554 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:03.251249363
0:00:03.906482540 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 3 - ts: 0:00:03.382660363
0:00:03.992116646 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 2 - ts: 0:00:03.481276555
0:00:04.097968710 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:03.547006683
0:00:04.257226443 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 2 - ts: 0:00:03.645570715
0:00:04.384957789 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 3 - ts: 0:00:03.777002747
0:00:04.525985768 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 3 - ts: 0:00:03.908435331
0:00:04.630990147 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 4 - ts: 0:00:04.072735651
0:00:04.740711518 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 2 - ts: 0:00:04.171311947
0:00:04.832555201 1500166 0xaaab0937d2a0 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 3 - ts: 0:00:04.302706139
The resulting video ends up being extremely choppy. I have already tried decreasing the resolution to 720p at 50FPS, but no luck there. I see the same output in debug mode.
Here are the device caps:
Device caps -> video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 30/1 }; video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 80/1, 50/1 }; video/x-raw, format=(string)UYVY, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)120/1; image/jpeg, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)100/1; image/jpeg, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)100/1; image/jpeg, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)120/1
Using a Jetson Xavier with Ubuntu 20.
Gstreamer version: 1.16.3
I tried out a CSI camera to see if that made a difference and surely enough, there was no frame loss.
Still, I need to get the USB camera working for this project.