Difference between revisions of "Template:FriendlyCoreS5Pxx18"
(updated by API) |
(updated by API) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 29: | Line 29: | ||
===Connect to DVP Camera CAM500B=== | ===Connect to DVP Camera CAM500B=== | ||
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> | 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> | ||
− | + | Enter the following command to preview the video: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | gst-launch-1.0 -e v4l2src device=/dev/video6 ! video/x-raw,format=I420,framerate=30/1,width=1280,height=720 ! nxvideosink | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Enter the following command to start recording (VPU hardware encoding): | |
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | gst-launch-1.0 -e v4l2src device=/dev/video6 ! video/x-raw,format=I420,framerate=30/1,width=1280,height=720 ! tee name=t t. \ | |
+ | ! queue ! nxvideosink t. ! queue ! nxvideoenc bitrate=12000000 ! mp4mux ! \ | ||
+ | filesink location=result_720.mp4 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 63: | Line 64: | ||
/sys/class/i2c-dev/i2c-3/device/3-002d/wakealarm<br> | /sys/class/i2c-dev/i2c-3/device/3-002d/wakealarm<br> | ||
your board may be it does not support this feature. | your board may be it does not support this feature. | ||
+ | |||
+ | ===Installing and Using OpenCV 4.1.2=== | ||
+ | OpenCV has been pre-installed in FriendlyCore (Version after 20191126) and does not require manual installation.<br /> | ||
+ | Please refre this link: https://github.com/friendlyarm/install-opencv-on-friendlycore/blob/s5pxx18/README.md | ||
+ | <br> | ||
+ | Quick test: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | . /usr/bin/cv-env.sh | ||
+ | . /usr/bin/setqt5env-eglfs | ||
+ | cd /usr/local/share/opencv4/samples/python | ||
+ | python3 turing.py | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===Installing and Using Caffe=== | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | git clone https://github.com/friendlyarm/install-caffe-on-friendlycore | ||
+ | cd install-caffe-on-friendlycore | ||
+ | sudo ./install-caffe.sh | ||
+ | </syntaxhighlight> |
Latest revision as of 11:20, 27 November 2019
Contents
1 Run Qt 5.10.0 Demo with GPU acceleration
Run the following command
$ sudo qt5demo
2 Run Qt 5.10.0 Demo with OpenGL
Run the following command
. setqt5env cd $QTDIR cd /examples/opengl/qopenglwidget ./qopenglwidget
For more Qt 5.10.0 examples, please go to:
cd $QTDIR/examples/
3 Play HD Video with Hardware-decoding
gst-player is console player, it base on GStreamer, support VPU with Hardware-decoding:
sudo gst-player /home/pi/demo.mp4
The equivalent gsteamer command is as follows:
sudo gst-launch-1.0 filesrc location=/home/pi/demo.mp4 ! qtdemux name=demux demux. ! queue ! faad ! audioconvert ! audioresample ! alsasink device="hw:0,DEV=1" demux. ! queue ! h264parse ! nxvideodec ! nxvideosink dst-x=0 dst-y=93 dst-w=1280 dst-h=533
4 Connect to DVP Camera CAM500B
The CAM500B camera module is a 5M-pixel camera with DVP interface. For more tech details about it you can refer to Matrix - CAM500B.
Enter the following command to preview the video:
gst-launch-1.0 -e v4l2src device=/dev/video6 ! video/x-raw,format=I420,framerate=30/1,width=1280,height=720 ! nxvideosink
Enter the following command to start recording (VPU hardware encoding):
gst-launch-1.0 -e v4l2src device=/dev/video6 ! video/x-raw,format=I420,framerate=30/1,width=1280,height=720 ! tee name=t t. \ ! queue ! nxvideosink t. ! queue ! nxvideoenc bitrate=12000000 ! mp4mux ! \ filesink location=result_720.mp4
5 Power Off and Schedule Power On
“PMU Power Management” feature helps us to auto power on the board at a specific time, it is implemented by an MCU, support software power-off, and RTC alarm power-up functions.
Here’s a simple guide:
Turn on automatically after 100 seconds. (Time must be greater than 60 seconds.):
$ sudo echo 100 > /sys/class/i2c-dev/i2c-3/device/3-002d/wakealarm
After setting up the automatic boot, turn off board with the 'poweroff’ command:
$ sudo poweroff
Cancel automatic boot:
$ sudo echo 0 > /sys/class/i2c-dev/i2c-3/device/3-002d/wakealarm
Query the current settings, in the front is current time, followed by the time of automatic booting: If no automatic boot is set, it will display "disabled”.
$ sudo cat /sys/class/i2c-dev/i2c-3/device/3-002d/wakealarm
Note that some older versions of hardware may not support this feature, if you don't see this file node in your system:
/sys/class/i2c-dev/i2c-3/device/3-002d/wakealarm
your board may be it does not support this feature.
6 Installing and Using OpenCV 4.1.2
OpenCV has been pre-installed in FriendlyCore (Version after 20191126) and does not require manual installation.
Please refre this link: https://github.com/friendlyarm/install-opencv-on-friendlycore/blob/s5pxx18/README.md
Quick test:
. /usr/bin/cv-env.sh . /usr/bin/setqt5env-eglfs cd /usr/local/share/opencv4/samples/python python3 turing.py
7 Installing and Using Caffe
git clone https://github.com/friendlyarm/install-caffe-on-friendlycore cd install-caffe-on-friendlycore sudo ./install-caffe.sh