Hi,
I’m running into performance issue (fps) with a video pipeline using gstreamer plugins.
I think i have several problems.
Let’s work on them 1 by 1 if it is OK.
For the context in my application I have a camera connected to USB and detection run locally and detection from “outside”.
When i use a MJPEG 1280x720 capable camera i have created an equivalent pipeline to facilitate profiling and debug
case 1
gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg,width=1280,height=720 ! jpegdec ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA' ! nvdsosd display-bbox=false display-clock=false ! nv3dsink sync=false
In case 1 the pipeline run and the latency is low (CPU decode is around 5ms) and FPS is 60 fps
see case1.zip for nsight trace
case1.zip (932.3 KB)
To improve performance i want to use the HW JPEG decoder to free some ressources
** case 2**
gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg,width=1280,height=720 ! nvjpegdec ! 'video/x-raw(memory:NVMM),format=RGBA' ! nvdsosd display-bbox=false display-clock=false ! nv3dsink sync=false
replacing the jpegdec with nvjpegdec and also removing nvvidconv because the src pad of nvjpegdec is compatible with NVMM memory
gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg,width=1280,height=720 ! nvjpegdec ! 'video/x-raw(memory:NVMM),format=RGBA' ! nvdsosd display-bbox=false display-clock=false ! nv3dsink sync=false
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
NvMMLiteOpen : Block : BlockType = 277
NvMMLiteBlockCreate : Block : BlockType = 277
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.805718343
Setting pipeline to NULL ...
ERROR: from element /GstPipeline:pipeline0/GstNvJpegDec:nvjpegdec0: No valid frames decoded before end of stream
Additional debug info:
../gst-libs/gst/video/gstvideodecoder.c(1416): gst_video_decoder_sink_event_default (): /GstPipeline:pipeline0/GstNvJpegDec:nvjpegdec0:
no valid frames found
Freeing pipeline ...
NVMMLITE_NVVIDEODEC, <NvVideoBufferProcessing:6121> Consume the extra signalling for EOS
with GST_DEBUG=3
GST_DEBUG=3 gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg,width=1280,height=720 ! nvjpegdec ! 'video/x-raw(memory:NVMM),format=RGBA' ! nvdsosd display-bbox=false display-clock=false ! nv3dsink sync=false
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
0:00:00.289047831 357441 0xaaaacc508a40 FIXME videodecoder gstvideodecoder.c:1193:gst_video_decoder_drain_out:<nvjpegdec0> Sub-class should implement drain()
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.681804743 357441 0xaaaacc508a40 WARN v4l2bufferpool gstv4l2bufferpool.c:842:gst_v4l2_buffer_pool_start:<v4l2src0:pool0:src> Uncertain or not enough buffers, enabling copy threshold
NvMMLiteOpen : Block : BlockType = 277
NvMMLiteBlockCreate : Block : BlockType = 277
0:00:01.161616812 357441 0xaaaacc508a40 ERROR jpegdec gstjpegdec.c:1163:gst_jpeg_dec_negotiate:<nvjpegdec0> Empty caps
0:00:01.161818962 357441 0xaaaacc508a40 WARN videodecoder gstvideodecoder.c:4797:_gst_video_decoder_error:<nvjpegdec0> error: Failed to negotiate caps
0:00:01.161834675 357441 0xaaaacc508a40 WARN videodecoder gstvideodecoder.c:4799:_gst_video_decoder_error:<nvjpegdec0> error: Picture is too small or too big (1280x720)
0:00:01.161919158 357441 0xaaaacc508a40 WARN basesrc gstbasesrc.c:3127:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
0:00:01.161931766 357441 0xaaaacc508a40 WARN basesrc gstbasesrc.c:3127:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.872891552
0:00:01.162075387 357441 0xaaaacc508a40 WARN videodecoder gstvideodecoder.c:1416:gst_video_decoder_sink_event_default:<nvjpegdec0> error: No valid frames decoded before end of stream
Setting pipeline to NULL ...
0:00:01.162087899 357441 0xaaaacc508a40 WARN videodecoder gstvideodecoder.c:1416:gst_video_decoder_sink_event_default:<nvjpegdec0> error: no valid frames found
ERROR: from element /GstPipeline:pipeline0/GstNvJpegDec:nvjpegdec0: No valid frames decoded before end of stream
Additional debug info:
../gst-libs/gst/video/gstvideodecoder.c(1416): gst_video_decoder_sink_event_default (): /GstPipeline:pipeline0/GstNvJpegDec:nvjpegdec0:
no valid frames found
Freeing pipeline ...
NVMMLITE_NVVIDEODEC, <NvVideoBufferProcessing:6121> Consume the extra signalling for EOS
thks in advance