OpenCV build script

Sorry about that. I edited my above post to correct the code section. I’m about to rerun the build.

Edit: before I reran the build I wanted to make sure the information that I had was correct. So when I first checked the build information I noticed that python was preinstalled on my nano (I’m going to assume that it maybe comes with the Jetpack 4.3 image that I wrote to the SD card. note: I did not use the SDK manager) so I used the python command getBuildInformation of the opencv build. I did this in python2 and python3. In 2 it said the build version was 4.1.1 and that none of the cuda modules were installed. I then check in 3 and it spat out a bunch of errors about not having numpy installed. So I just assumed that it was 4.1.1 installed. Not trusting python at this point I created a c++ executable to read the build version and build information of opencv and it says 4.2.0 installed with all the CUDA modules there.

To put a long story short it seems I have wasted your time a bit. It seems your script ran perfectly and that it was just python giving me false information. Sorry for all the fuss and thank you very much for helping me.

1 Like

No worries. It possible it failed building the python module during make install, and that’s why the version reported by python wasn’t 4.2.0.

You may want to try the no-python branch anyway just to ensure the make install wasn’t interrupted. And you didn’t waste any time. It’s useful to have a no python version anyways.

Thanks for the help. I will definitely use the no-python branch. I am currently running my Nano off a temporary SD while I wait for a new one to be delivered. When I get the new one I will use the no-python build. Thanks again for all the help.

Yw. I will keep the branch up to date so when 4.3 is released you’ll be able to upgrade. All this being said, if you’re interested in performance, there are better options to OpenCV on Tegra. It wasn’t really designed for the architecture while Nvidia has solutions that are tuned for it.

When I use the build script, it fails because it can’t find sys/videoio.h.
I see that this is an ongoing issue for some people, but I can not locate a definitive fix. I’m trying to build 4.1.1 for a robot project and I’m stuck. Please advise.

Are you using my script to build? Please try re-running it like:

./ 4.1.1

(or whatever version you want).

If the problem persists, please attach copies of the following files here:



Here are the files. Thank you for taking that time to help.


CMakeOutput.log (59.7 KB)

CMakeError.log (54.1 KB)

Yw. Can you post the configure.log and build.log (the regular ones, not the CMake*.log)? The configure.log will give me a better idea about your system configuration so I can attempt to replicate.

My understanding based on googling the issue is that deleting the build folder and recreating it should fix it. (in your case, /tmp/opencv_build) That’s why I suggested re-running the script. When it asks you if you want to delete that folder, say yes, and it should try and re-download everything before building again. The header in question is actually part of opencv so it should be included.


I have tried/rebuilt 3 times using the Nivida script, 3 times with the Jetsonhacks scripts, twice with JEB script and manually tried to build through by the script here:

I get the same results on all of them. I’ve seen the postings where people say they’ve started from scratch and all of a sudden it works, but there are always other things they’ve done and no one seems to understand why this keeps happening,
and as far as I can tell, it has be a problem for people for years. I have attached the build and configure log. There is nothing in the build log, but the configure log shows what happened. I’m not even sure where videoio.h comes from, otherwise I’d
just install it. Thanks again.


build.log (61 Bytes)

configure.log (27.5 KB)

From the log, the configure step failed.
What was your cmake command ? This would help.

I ran the Nvidia OpenCV build script as follows:

Is there an update to address the following issue with your script?
Err:16 bionic Release
404 Not Found [IP: 80]

That looks like a connection issue. It will probably work now. Try again.

Hi, @mdegans…I have installed opencv 4.4.0 successfully, by referring in jetson nano. After a day, jetson is not booting up. And I am sure that no issues in Power supply. Green led remains on in jetson board. But there is no display in monitor

I met this problem once before. I formatted SD card and flashed image file again. Then jetson booted up. Please help me to solve this issue…


There shouldn’t be anything in my script that would cause a blank screen on boot. Have you made any other changes to your system recently (eg. custom drivers?).

The script does update the system prior to build for consistency’s sake, but I’m removing this in the next version for reasons. Other than that it just build opencv and installs it to /usr/local/ prefix.

You can try booting with the serial console active to see what is going on. If you can get a log that way I might be able to help further.

1 Like

I didn’t change anything. After first boot up i installed opencv.


I haven’t had any other reports like this. I’d suggest using another script and seeing if that helps. Don’t think it’s my script, but you never know.

Okay @mdegans

Hope you’re having a good day. I was able to successfully install cv2 4.4 with the script provided. Thank you.
But I’ve noticed that there is no ffmpeg support which i think is required in my case for streaming an rtsp feed from an IP camera (I’m not 100% sure, it’s hanging now with some NVMlite error) using VideoCapture().
It would be great if you could help me by giving info on how to build with ffmpeg support.

Thanks in advance.
P.S: I’m using Jetson Xavier NX with 18.04 LTS

Maybe you can try an opencv gstreamer VideoWriter to shmsink and use rstp server to use this source for streaming such as here.

If you want to use ffmpeg, you may just enable ffmpeg support with -D WITH_FFMPEG=ON when configuring your opencv build with cmake. You need to have a ffmpeg version installed. Check the cmake configure log for found libs.

For more details about using your own ffmpeg version you may also have a look to this post.