Warning
This project is no longer maintained. Please us v4l2-test
(https://github.com/pmliquify/v4l2-test) instead.
- Recommended OS is Ubuntu 18.04 LTS or Ubuntu 20.04 LTS
- You need git to clone this repository
- All other packages are installed by the scripts contained in this repository
-
Create a directory and clone the repository
$ cd <working_dir> $ git clone https://github.com/pmliquify/vc_mipi_demo
-
Setup the toolchain.
$ cd vc_mipi_demo/bin $ ./setup.sh --host
-
Build vcmipidemo and vcimgnetsrv. You can find the built binaries in the
src
directory.$ ./build.sh --all
Before you start image streaming you should setup your video device to define the pixelformat and image resolution.
# v4l2-ctl --set-fmt-video=pixelformat=RG10,width=3840,height=3040
The demo per default outputs as ASCII art. You can adjust exposure (shutter) and gain by using the -s
and -g
options.
# ./vcmipidemo -s 1000 -g 10
If you have a display attached and a kernel with framebuffer support, you can get a better image output by streaming it to the framebuffer. Suppress the default ASCII art output with -a
and activate the framebuffer output with -f
.
# ./vcmipidemo -af -s 1000 -g 10
To see some raw image informations for each captured image activate that output with -x
.
# ./vcmipidemo -afx -s 1000 -g 10
To store images to the file system use the -o
option. You will get a sequence of image files in ppm format.
# ./vcmipidemo -ao 1000 -g 10
If your have a headless hardware setup, you can stream the image via network by using the VCImgNetSrv and VCImgNetClient.
-
Install the frontend on Windows 10
- Copy vcimgnetclient.py to a folder on the windows pc.
- Download and Install python-2.7.11.msi
- Download and Install pygtk-all-in-one-2.24.2.win32-py2.7.msi
- Do not start the python script yet!
-
Open a new terminal to the target and start the vcimgnetsrv. The server starts to listen for the connection from the VCImgNetClient.
$ ssh root@<target-ip> # ./vcimgnetsrv Start VC Image Net Server ... Listen on port 2002
-
Execute the python script vcimgnetclient.py.
- The window from the VCImgNetClient should show up.
- Choose e.g. option Interpete as RGB
- Click the Receive Image Button.
- In the first terminal you should see that the client had connected to the server.
# ./vcimgnetsrv Start VC Image Net Server ... Listen on port 2002 Client connected!
- The plain gray mainframe in the VCImgNetClient window should change to a diagonal hatched pattern. A moving bar shows that the app is waiting to receive image data.
-
Open a second terminal and start the vcmipidemo to start the image stream. The application starts streaming and should show some image information and the first few bytes from the image. Please note the option -ax6 to suppress ASCII output and the option to output image informations and apply the 6 bit shift correction
$ ssh root@<target-ip> # ./vcmipidemo -ax6 -s 10000 -g 10 [#0001, ts: 337321, t: 0 ms] (dx: 1920, dy: 1080, pitch: 3840) - 9024 5022 f025 0022 7024 a022 0025 4022 2025 b022 [#0002, ts: 337338, t: 17 ms] (dx: 1920, dy: 1080, pitch: 3840) - 4025 7021 b024 7022 1025 1022 9025 8022 2025 7022 [#0003, ts: 337354, t: 16 ms] (dx: 1920, dy: 1080, pitch: 3840) - 0025 f021 8024 d022 2025 5022 e024 7022 6025 1022 [#0004, ts: 337387, t: 17 ms] (dx: 1920, dy: 1080, pitch: 3840) - e024 7022 6025 4022 4024 4022 f024 c022 d024 e021 ...
On Windows you can see the live image stream.