Nvjpegenc slow down

Hi,

On a Jetson Nano, when using the nvjpegenc element in GStreamer it appears that the first 150 or so frames are encoded very quickly but any frame after that takes perhaps 2 seconds each to encode.

My pipeline is
GST_DEBUG=3 gst-launch-1.0 filesrc location="Big_Buck_Bunny_1080_10s_30MB.mp4" ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! nvv4l2decoder ! nvjpegenc ! fakesink sync=false

Where the sample video is here
[1] https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_30MB.mp4

Is there any reason for the slow down? Should I be using the CPU based jpegenc?

Regards,

I did a bit more investigation and noticed that problem only seems to occur if the input to nvjpegenc is video/x-raw(memory:NVMM)

This pipeline demonstrates the slow down
GST_DEBUG=3 gst-launch-1.0 filesrc location="Big_Buck_Bunny_1080_10s_30MB.mp4" ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! nvv4l2decoder ! nvvidconv ! "video/x-raw(memory:NVMM),width=1920,height=1080" ! nvjpegenc ! fakesink sync=false

Where as this pipeline does not seem to slow down
GST_DEBUG=3 gst-launch-1.0 filesrc location="Big_Buck_Bunny_1080_10s_30MB.mp4" ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! nvv4l2decoder ! nvvidconv ! "video/x-raw,width=1920,height=1080" ! nvjpegenc ! fakesink sync=false

Regards

Hi,
Please configure the property to nvv4l2decoder and try again:

  enable-max-performance: Set to enable max performance
                        flags: readable, writable
                        Boolean. Default: false

Hi @DaneLLL,

I tried your suggestion but it didn’t seem to have any effect.

The pipeline I used was,

gst-launch-1.0 filesrc location="Big_Buck_Bunny_1080_10s_30MB.mp4" ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! nvv4l2decoder enable-max-performance=true ! nvvidconv ! "video/x-raw(memory:NVMM),width=1920,height=1080" ! nvjpegenc ! fakesink sync=false

Hi,
If you use r32.3.1, there is a known memleak in nvjpegenc. Please apply the patch and try:
https://elinux.org/L4T_Jetson/r32.3.x_patch
[GSTREAMER]streaming using jpegenc halts after a short delay

Fantastic @DaneLLL

The pipeline runs to completion in 1.90 seconds.