scripts for Pine64 camera

master
jebba 2021-07-14 21:39:21 -06:00
parent 7a68f1e44a
commit 6851984583
17 changed files with 420 additions and 0 deletions

View File

@ -0,0 +1,9 @@
# Put in ~/.config/jebbacam.conf
CAM_GIT_ROOT=~/pinecam-cruft
CAM_HOSTNAME=pinecube1
CAM_ETH_IP=10.1.1.101
CAM_WIFI_IP=192.168.1.101
CAM_PORT=8000
CAM_RTSPPORT=8554

View File

@ -0,0 +1,11 @@
#!/bin/bash
# Get config
. ~/.config/jebbatime.conf
cd $JEBBATIMEGITROOT
./tools/wasptool \
--battery \
--device $JEBBATIMEMAC

View File

@ -0,0 +1,9 @@
#!/bin/bash
set -x
# Get config
. ~/.config/jebbacam.conf
mplayer rtsp://$CAM_ETH_IP:$CAM_RTSPPORT/video

View File

@ -0,0 +1,9 @@
#!/bin/bash
set -x
#mplayer rtsp://192.168.110.249:8554/video
#vlc rtsp://192.168.110.249:8554/video
mplayer http://192.168.1.117:8000/playlist.m3u8

View File

@ -0,0 +1,14 @@
#!/bin/bash
set -x
# Get config
. ~/.config/jebbacam.conf
mplayer \
-fs \
http://$CAM_WIFI_IP:$CAM_PORT/playlist.m3u8
exit
-vf rotate=1

View File

@ -0,0 +1,45 @@
#!/bin/bash
set -x
sudo mkdir -p /dev/shm/hls/
sudo chown jebba /dev/shm/hls/
cd /dev/shm/hls/
#sudo python3 -m http.server &
media-ctl \
--set-v4l2 \
'"ov5640 1-003c":0[fmt:UYVY8_2X8/1920x1080@1/30]'
gst-launch-1.0 \
v4l2src ! \
decodebin ! \
videoconvert ! \
cedar_h264enc ! \
h264parse ! \
hlssink \
target-duration=1 \
playlist-length=2 \
max-files=3
exit
matroskamux ! \
video/x-raw,width=1920,height=1080,format=UYVY,framerate=30/1 ! \
decodebin ! \
videoconvert ! \
video/x-raw,format=I420 ! \
gst-launch-1.0 -ve videotestsrc ! cedar_h264enc ! h264parse ! matroskamux ! filesink location="cedar.mkv"
gst-launch-1.0 -ve videotestsrc ! cedar_h264enc ! ffmux_mp4 ! filesink location="cedar.mp4"
# clockoverlay ! \
# timeoverlay valignment=bottom ! \
speed-preset=ultrafast \
tune=zerolatency ! \

View File

@ -0,0 +1,57 @@
#!/bin/bash
set -x
sudo mkdir -p /dev/shm/hls/
sudo chown jebba /dev/shm/hls/
cd /dev/shm/hls/
#sudo python3 -m http.server &
media-ctl \
--set-v4l2 \
'"ov5640 1-003c":0[fmt:UYVY8_2X8/640x480@1/15]'
gst-launch-1.0 \
v4l2src ! \
video/x-raw,width=640,height=480,format=UYVY,framerate=15/1 ! \
decodebin ! \
videoconvert ! \
video/x-raw,format=I420 ! \
cedar_h264enc ! \
h264parse ! \
tune=zerolatency ! \
matroskamux ! \
hlssink \
target-duration=1 \
playlist-length=2 \
max-files=3
exit
gst-launch -ve videotestsrc ! cedar_h264enc ! h264parse ! matroskamux ! filesink location="cedar.mkv"
gst-launch -ve videotestsrc ! cedar_h264enc ! ffmux_mp4 ! filesink location="cedar.mp4"
# clockoverlay ! \
# timeoverlay valignment=bottom ! \
####################################
# OK
gst-launch-1.0 \
v4l2src ! \
video/x-raw,width=640,height=480,format=UYVY,framerate=15/1 ! \
decodebin ! \
videoconvert ! \
video/x-raw,format=I420 ! \
x264enc \
speed-preset=ultrafast \
tune=zerolatency ! \
mpegtsmux ! \
hlssink \
target-duration=1 \
playlist-length=2 \
max-files=3
####################################

View File

@ -0,0 +1,15 @@
#!/bin/bash
set -x
H="720";
W="1280";
F="JPEG_1X8";
media-ctl \
--set-v4l2 \
"'ov5640 1-003c':0[fmt:${F}/${W}x${H}]"
gst-rtsp-launch \
"v4l2src ! image/jpeg,width=${W},height=${H} ! rtpjpegpay name=pay0"

View File

@ -0,0 +1,12 @@
#!/bin/bash
set -x
sudo mkdir -p /dev/shm/hls/
sudo chown jebba /dev/shm/hls/
cd /dev/shm/hls/
sudo python3 -m http.server

View File

@ -0,0 +1,33 @@
#!/bin/bash
set -x
sudo mkdir -p /dev/shm/hls/
sudo chown jebba /dev/shm/hls/
cd /dev/shm/hls/
#sudo python3 -m http.server &
media-ctl \
--set-v4l2 \
'"ov5640 1-003c":0[fmt:UYVY8_2X8/240x320@1/15]'
gst-launch-1.0 \
v4l2src ! \
video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! \
decodebin ! \
videoconvert ! \
video/x-raw,format=I420 ! \
clockoverlay ! \
timeoverlay valignment=bottom ! \
x264enc \
speed-preset=ultrafast \
tune=zerolatency ! \
mpegtsmux ! \
hlssink \
target-duration=1 \
playlist-length=2 \
max-files=3

View File

@ -0,0 +1,29 @@
#!/bin/bash
set -x
#sudo mkdir -p /dev/shm/hls/
#sudo chown jebba /dev/shm/hls/
cd /dev/shm/hls/
#sudo python3 -m http.server &
# 30 max FPS
media-ctl \
--set-v4l2 \
'"ov5640 1-003c":0[fmt:UYVY8_2X8/1920x1080@1/15]'
gst-launch-1.0 \
v4l2src ! \
video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! \
decodebin ! \
videoconvert ! \
video/x-raw,format=I420 ! \
x264enc \
speed-preset=ultrafast \
tune=zerolatency ! \
mpegtsmux ! \
hlssink \
target-duration=1 \
playlist-length=2 \
max-files=3

View File

@ -0,0 +1,29 @@
#!/bin/bash
set -x
#sudo mkdir -p /dev/shm/hls/
#sudo chown jebba /dev/shm/hls/
cd /dev/shm/hls/
#sudo python3 -m http.server &
# 45 max FPS
media-ctl \
--set-v4l2 \
'"ov5640 1-003c":0[fmt:UYVY8_2X8/1280x960@1/15]'
gst-launch-1.0 \
v4l2src ! \
video/x-raw,width=1280,height=960,format=UYVY,framerate=15/1 ! \
decodebin ! \
videoconvert ! \
video/x-raw,format=I420 ! \
x264enc \
speed-preset=ultrafast \
tune=zerolatency ! \
mpegtsmux ! \
hlssink \
target-duration=1 \
playlist-length=2 \
max-files=3

View File

@ -0,0 +1,29 @@
#!/bin/bash
set -x
#sudo mkdir -p /dev/shm/hls/
#sudo chown jebba /dev/shm/hls/
cd /dev/shm/hls/
#sudo python3 -m http.server &
# 15 max FPS
media-ctl \
--set-v4l2 \
'"ov5640 1-003c":0[fmt:UYVY8_2X8/2592x1944@1/15]'
gst-launch-1.0 \
v4l2src ! \
video/x-raw,width=2592,height=1944,format=UYVY,framerate=15/1 ! \
decodebin ! \
videoconvert ! \
video/x-raw,format=I420 ! \
x264enc \
speed-preset=ultrafast \
tune=zerolatency ! \
mpegtsmux ! \
hlssink \
target-duration=1 \
playlist-length=2 \
max-files=3

View File

@ -0,0 +1,29 @@
#!/bin/bash
set -x
#sudo mkdir -p /dev/shm/hls/
#sudo chown jebba /dev/shm/hls/
cd /dev/shm/hls/
#sudo python3 -m http.server &
# 60 max FPS
media-ctl \
--set-v4l2 \
'"ov5640 1-003c":0[fmt:UYVY8_2X8/1280x720@1/15]'
gst-launch-1.0 \
v4l2src ! \
video/x-raw,width=1280,height=720,format=UYVY,framerate=15/1 ! \
decodebin ! \
videoconvert ! \
video/x-raw,format=I420 ! \
x264enc \
speed-preset=ultrafast \
tune=zerolatency ! \
mpegtsmux ! \
hlssink \
target-duration=1 \
playlist-length=2 \
max-files=3

View File

@ -0,0 +1,33 @@
#!/bin/bash
set -x
sudo mkdir -p /dev/shm/hls/
sudo chown jebba /dev/shm/hls/
cd /dev/shm/hls/
sudo python3 -m http.server &
media-ctl \
--set-v4l2 \
'"ov5640 1-003c":0[fmt:UYVY8_2X8/1920x1080@1/5]'
gst-launch-1.0 \
v4l2src ! \
video/x-raw,width=1920,height=1080,format=UYVY,framerate=5/1 ! \
decodebin ! \
videoconvert ! \
video/x-raw,format=I420 ! \
x264enc \
speed-preset=ultrafast \
tune=zerolatency ! \
mpegtsmux ! \
hlssink \
target-duration=1 \
playlist-length=2 \
max-files=3
# clockoverlay ! \
# timeoverlay valignment=bottom ! \

View File

@ -0,0 +1,29 @@
#!/bin/bash
set -x
#sudo mkdir -p /dev/shm/hls/
#sudo chown jebba /dev/shm/hls/
cd /dev/shm/hls/
#sudo python3 -m http.server &
# 120 max FPS
media-ctl \
--set-v4l2 \
'"ov5640 1-003c":0[fmt:UYVY8_2X8/320x240@1/15]'
gst-launch-1.0 \
v4l2src ! \
video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! \
decodebin ! \
videoconvert ! \
video/x-raw,format=I420 ! \
x264enc \
speed-preset=ultrafast \
tune=zerolatency ! \
mpegtsmux ! \
hlssink \
target-duration=1 \
playlist-length=2 \
max-files=3

View File

@ -0,0 +1,28 @@
#!/bin/bash
set -x
#sudo mkdir -p /dev/shm/hls/
#sudo chown jebba /dev/shm/hls/
cd /dev/shm/hls/
#sudo python3 -m http.server &
media-ctl \
--set-v4l2 \
'"ov5640 1-003c":0[fmt:UYVY8_2X8/640x480@1/15]'
gst-launch-1.0 \
v4l2src ! \
video/x-raw,width=640,height=480,format=UYVY,framerate=15/1 ! \
decodebin ! \
videoconvert ! \
video/x-raw,format=I420 ! \
x264enc \
speed-preset=ultrafast \
tune=zerolatency ! \
mpegtsmux ! \
hlssink \
target-duration=1 \
playlist-length=2 \
max-files=3