Nvvidconv really bad quality during scaling

I’m facing with an issue related to nvvidconv.
In fact each time that I rescale a video I get a really bad result about quality.

Original Frame: 1920x1080

Frame Resized: 1280x720


As you can see the result is very bad, I tested all interpolation methods available in nvvidconv but result is always the same.

Gstreamer Pipeline:

gst-launch-1.0 rtspsrc location=rtsp://admin:Password@ latency=500 ! rtph264depay ! h264parse ! omxh264dec ! nvvidconv ! videorate ! ‘video/x-raw(memory:NVMM),framerate=25/1,width=(int)1280,height=(int)720,interpolation-method=5’ ! nvoverlaysink display-id=0

Do you have any suggestion?

You may try to set interpolation-method of nvvidconv as nicest and see it improves.

1 Like

If you have tested all interpolation-method and still don’t meet the requirement, it may be an limitation of hardware converter. Maybe you can consider to use software converter if it brings enough performance. In using software converter, the CPU loading is high and please execute sudo jetson_clocks to fix CPUs at max clocks.

I’ve already tried and it doesn’t seem to change anything.
The big issue seems that anti-alising is missing. I cannot use OpenCV in order to apply anti-aliasing cause Jetson nano CPU is too low powerful to manage a 1080p 25FPS scaled to 720p 25FPS.

I’ve also compiled OpenCV 4.4.0 and tried to use OpenCV Cuda resize but performance are not comparable with hardware acceleration.

Reference: https://www.learnopencv.com/getting-started-opencv-cuda-modul/

Please consider to add anti-aliasing in hardware scaling feature otherwise is quite useless…

I have no Nano for checking, but I’ve noticed that it works better in some cases to resize from NVMM memory than from CPU memory:

# This is weird on NX R32.4.4
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, framerate=30/1' ! nvvidconv ! timeoverlay ! nvvidconv ! 'video/x-raw(memory:NVMM), width=1280, height=720' ! nvvidconv ! xvimagesink

# This is fine
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, framerate=30/1' ! nvvidconv ! timeoverlay ! nvvidconv ! nvvidconv ! video/x-raw, width=1280, height=720 ! xvimagesink

so you may try to use a first nvvidconv for copying into NVMM memory, then a second one for rescaling.