Difference between revisions of "Template:FriendlyCoreAllwinnerH3/zh"
(→运行Qt示例程序) |
|||
Line 7: | Line 7: | ||
[[File:K2-QtE.png|frameless|400px|K2-QtE]]<br /> | [[File:K2-QtE.png|frameless|400px|K2-QtE]]<br /> | ||
− | === | + | ===Connect to DVP Camera CAM500B=== |
− | + | Note: this function is only supported in Linux-3.4.y<br> | |
− | + | The CAM500B camera module is a 5M-pixel camera with DVP interface. For more tech details about it you can refer to [[Matrix - CAM500B]].<br> | |
− | + | connect your H3 board to a CAM500B. Then boot OS, connect your board to a network, log into the board as root and run "mjpg-streamer": | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
$ cd /root/mjpg-streamer | $ cd /root/mjpg-streamer | ||
Line 16: | Line 16: | ||
$ ./start.sh | $ ./start.sh | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | mjpg- | + | The mjpg-streamer application is an open source video steam server. After it is successfully started the following messages will be popped up: |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
i: Using V4L2 device.: /dev/video0 | i: Using V4L2 device.: /dev/video0 | ||
Line 29: | Line 29: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | In our case the board's IP address was 192.168.1.230. We typed 192.168.1.230:8080 in a browser and were able to view the images taken from the camera's. Here is what you would expect to observe:<br> | |
[[File:mjpg-streamer-cam500a.png|frameless|400px|mjpg-streamer-cam500a]] <br> | [[File:mjpg-streamer-cam500a.png|frameless|400px|mjpg-streamer-cam500a]] <br> | ||
− | mjpg- | + | The mjpg-streamer soft-encodes data with libjpeg and you can hard-encode its data with ffmpeg which will greatly increase CPU's efficiency and speed up data encoding: |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | $ ffmpeg -t 30 -f v4l2 -channel 0 -video_size 1280x720 -i /dev/video0 -pix_fmt nv12 -r 30 -b:v 64k -c:v cedrus264 test.mp4 | + | $ ffmpeg -t 30 -f v4l2 -channel 0 -video_size 1280x720 -i /dev/video0 -pix_fmt nv12 -r 30 \ |
+ | -b:v 64k -c:v cedrus264 test.mp4 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | By default it records a 30-second video. Typing "q" stops video recording. After recording is stopped a test.mp4 file will be generated. | |
− | === | + | ===Check CPU's Working Temperature=== |
− | + | You can use the following command to read H3's temperature and frequency | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | cpu_freq | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | ===Check System Information with Rpi-Monitor=== |
− | + | Our OS contains the Rpi-Monitor utility with which users can check system information and status.<br> | |
− | + | In our case our board's IP was 192.168.1.230 and we typed the following IP in a browser: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
192.168.1.230:8888 | 192.168.1.230:8888 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | We were directed to the following page:<br> | |
[[File:rpi-monitor.png|frameless|500px|rpi-monitor]] <br> | [[File:rpi-monitor.png|frameless|500px|rpi-monitor]] <br> | ||
− | + | Users can easily check these system information and status. | |
− | === | + | ===Access GPIO Pins/Wirings with WiringNP=== |
− | + | The wiringPi library was initially developed by Gordon Henderson in C. It contains libraries to access GPIO, I2C, SPI, UART, PWM and etc. The wiringPi library contains various libraries, header files and a commandline utility:gpio. The gpio utility can be used to read and write GPIO pins.<br> | |
− | + | FriendlyElec integrated this utility in FriendlyCore system allowing users to easily access GPIO pins. For more details refer to WiringNP [[WiringNP:_WiringPi_for_NanoPi_NEO/NEO2|WiringNP]]<br /> | |
− | + |
Revision as of 03:53, 25 December 2017
Contents
1 Run Qt Demo
Run the following command:
$ sudo /opt/QtE-Demo/run.sh
Here is what you expect to see. This is an open source QtDemo:
2 Connect to DVP Camera CAM500B
Note: this function is only supported in Linux-3.4.y
The CAM500B camera module is a 5M-pixel camera with DVP interface. For more tech details about it you can refer to Matrix - CAM500B.
connect your H3 board to a CAM500B. Then boot OS, connect your board to a network, log into the board as root and run "mjpg-streamer":
$ cd /root/mjpg-streamer $ make $ ./start.sh
The mjpg-streamer application is an open source video steam server. After it is successfully started the following messages will be popped up:
i: Using V4L2 device.: /dev/video0 i: Desired Resolution: 1280 x 720 i: Frames Per Second.: 30 i: Format............: YUV i: JPEG Quality......: 90 o: www-folder-path...: ./www/ o: HTTP TCP port.....: 8080 o: username:password.: disabled o: commands..........: enabled
In our case the board's IP address was 192.168.1.230. We typed 192.168.1.230:8080 in a browser and were able to view the images taken from the camera's. Here is what you would expect to observe:
The mjpg-streamer soft-encodes data with libjpeg and you can hard-encode its data with ffmpeg which will greatly increase CPU's efficiency and speed up data encoding:
$ ffmpeg -t 30 -f v4l2 -channel 0 -video_size 1280x720 -i /dev/video0 -pix_fmt nv12 -r 30 \ -b:v 64k -c:v cedrus264 test.mp4
By default it records a 30-second video. Typing "q" stops video recording. After recording is stopped a test.mp4 file will be generated.
3 Check CPU's Working Temperature
You can use the following command to read H3's temperature and frequency
cpu_freq
4 Check System Information with Rpi-Monitor
Our OS contains the Rpi-Monitor utility with which users can check system information and status.
In our case our board's IP was 192.168.1.230 and we typed the following IP in a browser:
192.168.1.230:8888
We were directed to the following page:
Users can easily check these system information and status.
5 Access GPIO Pins/Wirings with WiringNP
The wiringPi library was initially developed by Gordon Henderson in C. It contains libraries to access GPIO, I2C, SPI, UART, PWM and etc. The wiringPi library contains various libraries, header files and a commandline utility:gpio. The gpio utility can be used to read and write GPIO pins.
FriendlyElec integrated this utility in FriendlyCore system allowing users to easily access GPIO pins. For more details refer to WiringNP WiringNP