5.0.1 Why does not it work?
As we have seen in this article, the CSI connector of Orange Pi is different from that of Raspberry Pi. I got the 2MP camera sold by Orange Pi (about 7€). The quality of the image is far from equal to that of the camera v2.1 8MP Raspberry Pi, but to begin, the value for money is unbeatable.
Once the system is up to date, you can install Python 2.7. Why not Python 3 you say? It is possible without any problem. You have to choose according to your level. If you're starting out, you'll find many more examples on Python 2.7.
An object c is created which captures the video stream sent by the camera (0), that is to say that which is connected to /dev/video0 .
Vidcopy is a script that will create a virtual video output (/dev/video1 ) in which the video stream of the physical camera (/dev/video0 ) will be copied.
Now, to make the changes permanent, run the following commands. They will add the corresponding rows to the modules in the /etc/modules configuration file. The modules will be automatically loaded at the next startup.
The script remains open in the terminal. It is stopped with the combination CTRL + C. I do not have enough recoil on the script yet, but asking for an 800 x 600 image, the output switches to 640 x 480.
It only remains to connect the python script on this new video stream. Open the python script and replace 0 by 1 in the VideoCapture function like this c = cv2.VideoCapture (1). Save the script.
There you go ! You can use the image of the Orange Pi camera in your Python projects.
As always with the Orange Pi, you have a much better performance/price ratio than the Raspberry Pi if you put your hand on the keyboard ;-). On the performance side, the Orange Pi Lite with its SoC quad-core and its 512MB Ram is perfectly able to support Armbian's XFCE desktop, Open CV and Python. Remains to be tested on a more complex project, for example facial recognition or motion detection.
In Leonardo Lontra's tutorial you linked, he says you need the kernel source. Can you add a step on how to do that? Following the steps you have I get a '/lib/modules/…/build: no such file or directory' error when attempting to build v4l2loopback.
To answer my own question: I had to do a reboot. The "apt-get upgrade" actually upgraded the kernel, but "uname -r" still returned the old kernel name.
Attempting to run the scrip above returns the error "Window system doesn't support OpenGL". But I was able to use the script below to capture and save an image, so it's working!
Thank you very much for all your tips !
i have the same issue, has anyone figured it out?
Hello Techniche. Did you get an error message while compiling and installing v4l2loopback (command make && make install)?
after I actived the vidcopy, the video1 is success created. but I am trying to run the c++ program with opencv. it showed the below error.
please help. if there is any information needed, please lead me know too.
when I actives vidcopy, i have follow error messgae.
[ 380.526657] [VFE_ERR]input index(1) > dev->dev_qty(1)-1 invalid!
is it the reason why i failed opening video1?