文档手册
BUG : $'\r': command not found
- 当我们执行 shell 脚本的时候提示’\r’: command not found,但是检查了很多次并没有发现什么问题。原因是 windows 下的换行符是\r\n,而 Linux 下的换行符是\n,所以只要执行下面的命令把\r 去掉就可以了。解决方法:
#转化为unix格式
sed -i 's/\r$//' <filename>
单摄像头拍照片
#!/bin/bash
export DISPLAY=:0.0
su orangepi -c " \
gst-launch-1.0 rkisp num-buffers=20 device=/dev/video0 io-mode=1 ! \
video/x-raw,format=NV12,width=1920,height=1080,framerate=10/1 ! jpegenc ! \
multifilesink location=/home/orangepi/camera_capture_frame%d.jpg
"
单摄像头录视频
- num-buffers=512可以设置录制时间长度
#!/bin/bash
BOARD=$(cat /etc/hostname)
if [ ${BOARD} = "orangepi4" ];then
DEV="/dev/video0"
elif [ ${BOARD} = "orangepirk3399" ]; then
DEV="/dev/video5"
fi
export DISPLAY=:0.0
su orangepi -c " \
gst-launch-1.0 rkisp num-buffers=512 device=${DEV} io-mode=1 ! \
video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 ! \
mpph264enc ! queue ! h264parse ! mpegtsmux ! \
filesink location=/home/orangepi/output.ts \
"