How to improve video quality

I’m getting static white noise on the video when running the onboard camera by

gst-launch-1.0 nvcamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=1920, height=1080, framerate=30/1, format=NV12' ! nvvidconv flip-method=2 ! nvegltransform ! nveglglessink -e

For example, this is a door about 10’ away.
https://www.dropbox.com/s/gl0ek8seni81f74/door_ov5693.jpg?dl=0

Is there any additional step to filter the noise or doing something with nvcamerasrc?

(By the way, how to insert an image to the post? The image tag seems not working.)

Hi tmx3,
Do you also observe it with

gst-launch-1.0 nvcamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=1920, height=1080, framerate=30/1, format=NV12' ! nvoverlaysink

Hi DaneLLL, thanks a lot for the instruction. The result seems much better. Can you tell me how to exit from the full screen mode when running your command?

Unlike using the other command with “nveglglessink -e”, the video window frame is now gone. I can’t drag out the window in order to access the GUI and terminals in order to stop/restart the camera.

Further, I’d like to learn the different between two methods in term of the pipeline flow. I can sense a difference in gain control, and perhaps other noise deduction processes. Appreciate if anyone could elaborate and share the insight.

P.S.
I tried to replace “nvoverlaysink” with “nveglglessink -e”. The command failed with a prompt “erroneous pipeline: could not link nvcamerasrc0 to eglglessink0”
I also looked at the document “ACCELERATED GSTREAMER FOR TEGRA TX1 USER GUIDE” regarding the video sink, still couldn’t figure out what to do.

For using nveglglessink, you may add nvegltransform before it in the pipeline :

gst-launch-1.0 nvcamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=1920, height=1080, framerate=30/1, format=NV12' ! nvegltransform ! nveglglessink

Using the overlay may sometimes be difficult. I would advise to set the terminal in full screen mode before launching the gstreamer pipeline, and don’t use alt/tab keys or click mouse that may change the focused window receiving events, so that Ctrl-C can be catched by the terminal and stop gst-launch.
Usually, this is used without GUI, and launched from a console catching the INT signal.

You can check the various parameters available from nvcamerasrc with:

gst-inspect-1.0 nvcamerasrc

You may play with some of these.

If you illuminate more your scene, you should get a better image (I think the darker the scene, the higher gain and higher noise).

@Honey_Patouceul, thanks for the tip. Don’t click on the display does the trick! Otherwise I had to press the “reset” button each time after running the “nvoverlaysink” command. Now I can stop the video right away by Ctrl+C.

I looked up the paramerters list and tried to set the property for nvcamerasrc, but the change of setting seems making no difference. For example, I tried to add “auto-exposure=1” to both methods of display sink. No obvious change to the outcome.

Back to the video quality. By using “nvoverlaysink”, the image looks brighter, and has a smoother display (less snowy static) particularly in the shady area.

I wonder if I could get an example of setting the property for nvcamerasrc, such as exposure, saturation, etc. I might not have used the CSI-camera commands correctly, I’m afraid.

You may have a look to /var/log/syslog, where nvcamera-deamon logs some errors if parameters are out of range.

@Honey_Patouceul, I re-ran the camera, and got the syslog as follows. Didn’t see any obvious error though.

Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: nvcamera-daemon started new client thread = 547528012256
Jan  5 14:06:31 tegra-ubuntu rsyslogd-2007: action 'action 9' suspended, next retry is Fri Jan  5 14:07:01 2018 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: (547528012256) USB Sensors :  0 CSI Sensors :  1
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: (547528012256) getSource successful
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: Available Sensor modes :
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: W= 2592 H= 1944 FR= 30.000000
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: W= 2592 H= 1458 FR= 30.000000
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: W= 1280 H= 720 FR= 120.000000
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: (547528012256) CreateSession Successful
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: (547528012256) Shared Memory: mmap address= 0x7f782f5000
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: (547528012256) getSource successful
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: (547528012256) Sensor Metadata: Available :  0 Sensor Metadata: W :  5184 Sensor Metadata: H :  0
Jan  5 14:06:31 tegra-ubuntu kernel: [  710.348239] misc tegra_camera_ctrl: ISO BW req 2147483647 > 4687500 (max) capping to max
Jan  5 14:06:31 tegra-ubuntu kernel: [  710.356358] misc tegra_camera_ctrl: vi_v4l2_update_isobw: requested iso bw is larger than max
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: (547528012256) New Resolution W = 2592 H = 1458
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_BAYER fd = 93
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_META fd = 94
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_BAYER fd = 96
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_META fd = 97
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_BAYER fd = 99
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_META fd = 100
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_BAYER fd = 102
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_META fd = 103
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_BAYER fd = 105
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_META fd = 106
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_BAYER fd = 108
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_META fd = 109
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_BAYER fd = 111
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_META fd = 112
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_BAYER fd = 123
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_META fd = 124
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_BAYER fd = 126
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_META fd = 127
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_BAYER fd = 129
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: RECEIVED REGISTER_BUFFER_META fd = 130
Jan  5 14:06:31 tegra-ubuntu nvcamera-daemon[1302]: (547528012256) REQ_NVCAM_ENABLE_METADATA Enabled=0
Jan  5 14:07:00 tegra-ubuntu AptDaemon: INFO: Quitting due to inactivity
Jan  5 14:07:00 tegra-ubuntu AptDaemon: INFO: Quitting was requested
Jan  5 14:07:00 tegra-ubuntu org.debian.apt[550]: 14:07:00 AptDaemon [INFO]: Quitting due to inactivity
Jan  5 14:07:00 tegra-ubuntu org.debian.apt[550]: 14:07:00 AptDaemon [INFO]: Quitting was requested
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER fd = 128
Jan  5 14:07:02 tegra-ubuntu rsyslogd-2007: action 'action 9' suspended, next retry is Fri Jan  5 14:08:02 2018 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER_META fd = 130
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER fd = 125
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER_META fd = 127
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER fd = 113
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER_META fd = 124
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER fd = 110
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER_META fd = 112
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER fd = 107
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER_META fd = 109
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER fd = 104
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER_META fd = 106
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER fd = 101
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER_META fd = 103
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER fd = 98
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER_META fd = 100
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER fd = 95
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER_META fd = 97
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER fd = 92
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: CLOSING REGISTER_BUFFER_META fd = 94
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: (547528012256) Closing Client Connection Thread: nbytes 820
Jan  5 14:07:02 tegra-ubuntu nvcamera-daemon[1302]: (547528012256) Capture Done: Thread Exiting....

This may not be unrelated:

[b]Jan  5 14:06:31 tegra-ubuntu kernel: [  710.348239] misc tegra_camera_ctrl: ISO BW req 2147483647 > 4687500 (max) capping to max
Jan  5 14:06:31 tegra-ubuntu kernel: [  710.356358] misc tegra_camera_ctrl: vi_v4l2_update_isobw: requested iso bw is larger than max[/b]

Someone more experienced or NVIDIA folks may comment further.

You may also send the command you’ve launched for triggering this, it would help to reproduce for investigating.

@Honey_Patouceul, the command I was using is:

gst-launch-1.0 nvcamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, framerate=30/1, format=NV12' ! nvvidconv flip-method=0 ! nvegltransform ! nveglglessink -e

The camera is the on-board ov5693.

Though I was also testing another customized carrier board with IMX219, getting a similar
static noise. I posted the on-board camera result, which is easier for people to duplicate and discuss the issue.

May be unrelated…I get these messages with nvcamerasrc even after a fresh boot.

BTW, the command is working on my side. Is it failing on yours ?

Well, not a failure in a sense. It’s more an issue regarding the ISP functionality. The video from the onboard camera is covered by snowy statics, which needs to be processed in order to satisfy a commonly perceived “quality”. See a snapshot for the problem https://www.dropbox.com/s/gl0ek8seni81f74/door_ov5693.jpg?dl=0

Comparing to the image shown in JK’s blog https://jkjung-avt.github.io/assets/2017-10-19-tx2-camera-with-python/tegra-cam.png , you may see the difference.

Notice that JK’s image was taken by Logitech C920 webcam, which pixel count is far less than ov5693, but Logitech claims to enhance it to an equivalent of 15MP. Apparently software plays a major role in the image quality. I just wonder what’s available on TX2.

Looks like the output of NV12 and RGBA is a bit different in brightness on TX2. We will check and update.

Can we use jetsontx2 to enhance video quality. I have 2k video data, can i make it or enhance it to 4k??

Can we use jetsontx2 to enhance video quality. I have 2k video data, can i make it or enhance it to 4k??

Looks different from this post. PLease post a new one.

Hey @DameLLL, is there any update on this?

Hi,
We have clarified the slight difference is specific to nvoverlaysink. Since it is slightly different, it is currently not in priority. AS a solution, we suggest use nveglglessink.