Hi,
I have an app which receives GRAY8 frames from an industrial camera. To be able to feed the frames to nvstreammux and eventually inference on them with nvinfer, one have to convert the frames into NV12/RGBA buffers.
Experiments with gst-launch-1.0 showed that conversion from GRAY8 to any color option impacts overall FPS of an analytics pipeline most dramatically. Couple examples:
gst-launch-1.0 -e -v multifilesrc location=/home/data/cars/materials/Russia/Moscow_M1__1/photo/2022-03-09_14-14-38_rec/frame_%05d.jpg start-index=0 stop-index=-1 caps=image/jpeg,framerate=(fraction)50/1 ! jpegdec ! videoconvert ! video/x-raw,format=GRAY8 ! fpsdisplaysink text-overlay=false video-sink=fakesink sync=false
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 551, dropped: 0, current: 21,00, average: 21,04
gst-launch-1.0 -e -v multifilesrc location=/home/data/cars/materials/Russia/Moscow_M1__1/photo/2022-03-09_14-14-38_rec/frame_%05d.jpg start-index=0 stop-index=-1 caps=image/jpeg,framerate=(fraction)50/1 ! jpegdec ! videoconvert ! video/x-raw,format=GRAY8 ! videoconvert ! video/x-raw,format=BGRx ! fpsdisplaysink text-overlay=false video-sink=fakesink sync=false
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 709, dropped: 0, current: 5,89, average: 5,88
gst-launch-1.0 -e -v multifilesrc location=/home/data/cars/materials/Russia/Moscow_M1__1/photo/2022-03-09_14-14-38_rec/frame_%05d.jpg start-index=0 stop-index=-1 caps=image/jpeg,framerate=(fraction)50/1 ! jpegdec ! videoconvert ! video/x-raw,format=GRAY8 ! videoconvert ! video/x-raw,format=BGRx ! nvvideoconvert ! ‘video/x-raw(memory:NVMM),format=RGBA’ ! m.sink_0 nvstreammux name=m batch-size=1 width=2448 height=2048 ! nvinfer name=nvinfer_cd config-file-path=/home/data/valsav/vision/data/config/deepstream/jetson-tx2/cd/pgie-1.txt ! nvtracker tracker-width=640 tracker-height=384 gpu-id=0 enable-batch-process=1 ll-lib-file=/opt/nvidia/deepstream/deepstream/lib/libnvds_nvdcf.so ll-config-file=/home/data/valsav/vision/data/config/deepstream/jetson-tx2/cd/tracker_config.yml ! nvinfer name=nvinfer_lpd config-file-path=/home/data/valsav/vision/data/config/deepstream/jetson-tx2/lpd/sgie-2_lpd.txt ! nvinfer name=nvinfer_lpcc config-file-path=/home/data/valsav/vision/data/config/deepstream/jetson-tx2/lpcc/sgie-4_lpcc.txt ! nvinfer name=nvinfer_lpr config-file-path=/home/data/valsav/vision/data/config/deepstream/jetson-tx2/lpr/sgie-3_lpr.txt ! fpsdisplaysink text-overlay=false video-sink=fakesink sync=false
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 1312, dropped: 0, current: 5,35, average: 5,32
Furthermore, it appears that among all color options NV12 allows to achieve the best FPS:
gst-launch-1.0 -e -v multifilesrc location=/home/data/cars/materials/Russia/Moscow_M1__1/photo/2022-03-09_14-14-38_rec/frame_%05d.jpg start-index=0 stop-index=-1 caps=image/jpeg,framerate=(fraction)50/1 ! jpegdec ! videoconvert ! video/x-raw,format=GRAY8 ! videoconvert ! video/x-raw,format=NV12 ! fpsdisplaysink text-overlay=false video-sink=fakesink sync=false
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 285, dropped: 0, current: 7,87, average: 7,83
gst-launch-1.0 -e -v multifilesrc location=/home/data/cars/materials/Russia/Moscow_M1__1/photo/2022-03-09_14-14-38_rec/frame_%05d.jpg start-index=0 stop-index=-1 caps=image/jpeg,framerate=(fraction)50/1 ! jpegdec ! videoconvert ! video/x-raw,format=GRAY8 ! videoconvert ! video/x-raw,format=NV12 ! nvvideoconvert ! ‘video/x-raw(memory:NVMM),format=NV12’ ! m.sink_0 nvstreammux name=m batch-size=1 width=2448 height=2048 ! nvinfer name=nvinfer_cd config-file-path=/home/data/valsav/vision/data/config/deepstream/jetson-tx2/cd/pgie-1.txt ! nvtracker tracker-width=640 tracker-height=384 gpu-id=0 enable-batch-process=1 ll-lib-file=/opt/nvidia/deepstream/deepstream/lib/libnvds_nvdcf.so ll-config-file=/home/data/valsav/vision/data/config/deepstream/jetson-tx2/cd/tracker_config.yml ! nvinfer name=nvinfer_lpd config-file-path=/home/data/valsav/vision/data/config/deepstream/jetson-tx2/lpd/sgie-2_lpd.txt ! nvinfer name=nvinfer_lpcc config-file-path=/home/data/valsav/vision/data/config/deepstream/jetson-tx2/lpcc/sgie-4_lpcc.txt ! nvinfer name=nvinfer_lpr config-file-path=/home/data/valsav/vision/data/config/deepstream/jetson-tx2/lpr/sgie-3_lpr.txt ! fpsdisplaysink text-overlay=false video-sink=fakesink sync=false
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 237, dropped: 0, current: 7,50, average: 7,51
Hence the question, is there any options to further speed up a pipeline that starts with GRAY8 frames at input?
My setup:
- Jetson TX2, 8GB
- L4T R32.5.0
- DeepStream 5.1
Valentin