Hi guys,
Thanks for your feedback. I agree that the bottleneck should be in the CPU so, I followed @sumit.garg steps but I couldn’t get the the 2nd pipeline working (for reading and encoding the ‘raw’ file generated). Basically, the error says 'Filter caps do not completely specify the output format'
:
Additional debug info:
../../../gst-plugins-good-1.14.4/sys/v4l2/v4l2_calls.c(587): gst_v4l2_get_selection_capabilities (): /GstPipeline:pipeline0/v4l2h264enc:v4l2h264enc0:
system error: Invalid argument
ERROR: from element /GstPipeline:pipeline0/GstCapsFilter:capsfilter0: Filter caps do not completely specify the output format
Additional debug info:
../../../gstreamer-1.14.4/plugins/elements/gstcapsfilter.c(455): gst_capsfilter_prepare_buf (): /GstPipeline:pipeline0/GstCapsFilter:capsfilter0:
Output caps are unfixed: video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)60/1, format=(string)NV12, interlace-mode=(string){ progressive, interleaved }, colorimetry=(string){ bt601, smpte240m, bt709, 2:4:5:2, 2:4:5:3, 1:4:7:1, 2:4:7:1, 2:4:12:8, bt2020, 2:0:0:0 }
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
Seems like it is an error with the 'blocksize'
but I guess the value is correct for NV12 fullHD:'3110400=1920x1080x1.5'
.
The weird thing is that I’ve tried the previous pipeline instead with videotestsrc
with a video device I have connected (/dev/videoX
→ v4l2src
). In this case, the error is the same, I can’t get 60fps in the venus encoder even if my camera streams in 60fps NV12 fullHD and most important, all CPU cores are below 50%.
Here an output log of gstreamer for fullHD, 30fps, NV12 (in this case, venus enc is working at 24fps):
Pipeline:
GST_DEBUG="*:3,GST_TRACER:7" GST_TRACERS="framerate;cpuusage" \
gst-launch-1.0 v4l2src device=/dev/qcam_video0 num-buffers=600 ! \
video/x-raw, width=1920, height=1080, framerate=30/1, format=NV12 ! \
tee name=tee0 \
tee0. ! queue name=qv4l2src ! fakesink \
tee0. ! queue name=qv4l2h264 max-size-buffers=10 leaky=2 ! v4l2h264enc extra-controls="controls,h264_profile=4,video_bitrate_mode=1,video_peak_bitrate=25000000,video_bitrate=25000000;" ! fakesink
Log:
0:00:09.673702554 4047 0xaaaae24ebcc0 TRACE GST_TRACER :0:: cpuusage, number=(uint)0, load=(double)11.340206;
0:00:09.673889274 4047 0xaaaae24ebcc0 TRACE GST_TRACER :0:: cpuusage, number=(uint)1, load=(double)15.463917;
0:00:09.674041775 4047 0xaaaae24ebcc0 TRACE GST_TRACER :0:: cpuusage, number=(uint)2, load=(double)0.000000;
0:00:09.674187140 4047 0xaaaae24ebcc0 TRACE GST_TRACER :0:: cpuusage, number=(uint)3, load=(double)0.000000;
0:00:09.674347401 4047 0xaaaae24ebcc0 TRACE GST_TRACER :0:: framerate, pad=(string)v4l2src0_src, fps=(uint)30;
0:00:09.674494798 4047 0xaaaae24ebcc0 TRACE GST_TRACER :0:: framerate, pad=(string)capsfilter0_src, fps=(uint)30;
0:00:09.674638132 4047 0xaaaae24ebcc0 TRACE GST_TRACER :0:: framerate, pad=(string)qv4l2src_src, fps=(uint)30;
0:00:09.674783132 4047 0xaaaae24ebcc0 TRACE GST_TRACER :0:: framerate, pad=(string)qv4l2h264_src, fps=(uint)23;
0:00:09.674926987 4047 0xaaaae24ebcc0 TRACE GST_TRACER :0:: framerate, pad=(string)tee0_src_1, fps=(uint)30;
0:00:09.675068759 4047 0xaaaae24ebcc0 TRACE GST_TRACER :0:: framerate, pad=(string)tee0_src_0, fps=(uint)30;
0:00:09.675211520 4047 0xaaaae24ebcc0 TRACE GST_TRACER :0:: framerate, pad=(string)v4l2h264enc0_src, fps=(uint)23;
The logs for 60fps are the same but in this case, encoding works up to 45fps.