Browse Source

scripts for Pine64 camera

master
jebba 12 months ago
parent
commit
6851984583
  1. 9
      config/jebbacam.conf
  2. 11
      scripts/jebbatime-battery
  3. 9
      scripts/redstone-cam-pinecube1
  4. 9
      scripts/redstone-cam-pinecube1-playlist
  5. 14
      scripts/redstone-cam-pinecube1-wifi
  6. 45
      scripts/redstone-pinecube1-stream-cedarh264-hires
  7. 57
      scripts/redstone-pinecube1-stream-cedarh264-mid-hardenc
  8. 15
      scripts/redstone-pinecube1-stream-mjpeg
  9. 12
      scripts/redstone-pinecube1-stream-webserver
  10. 33
      scripts/redstone-pinecube1-stream-x264
  11. 29
      scripts/redstone-pinecube1-stream-x264-1080p
  12. 29
      scripts/redstone-pinecube1-stream-x264-1280x960
  13. 29
      scripts/redstone-pinecube1-stream-x264-5mpix
  14. 29
      scripts/redstone-pinecube1-stream-x264-720p
  15. 33
      scripts/redstone-pinecube1-stream-x264-hires
  16. 29
      scripts/redstone-pinecube1-stream-x264-qvga
  17. 28
      scripts/redstone-pinecube1-stream-x264-vga

9
config/jebbacam.conf

@ -0,0 +1,9 @@ @@ -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

11
scripts/jebbatime-battery

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

9
scripts/redstone-cam-pinecube1

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

9
scripts/redstone-cam-pinecube1-playlist

@ -0,0 +1,9 @@ @@ -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

14
scripts/redstone-cam-pinecube1-wifi

@ -0,0 +1,14 @@ @@ -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

45
scripts/redstone-pinecube1-stream-cedarh264-hires

@ -0,0 +1,45 @@ @@ -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 ! \

57
scripts/redstone-pinecube1-stream-cedarh264-mid-hardenc

@ -0,0 +1,57 @@ @@ -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
####################################

15
scripts/redstone-pinecube1-stream-mjpeg

@ -0,0 +1,15 @@ @@ -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"

12
scripts/redstone-pinecube1-stream-webserver

@ -0,0 +1,12 @@ @@ -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

33
scripts/redstone-pinecube1-stream-x264

@ -0,0 +1,33 @@ @@ -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

29
scripts/redstone-pinecube1-stream-x264-1080p

@ -0,0 +1,29 @@ @@ -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

29
scripts/redstone-pinecube1-stream-x264-1280x960

@ -0,0 +1,29 @@ @@ -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

29
scripts/redstone-pinecube1-stream-x264-5mpix

@ -0,0 +1,29 @@ @@ -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

29
scripts/redstone-pinecube1-stream-x264-720p

@ -0,0 +1,29 @@ @@ -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

33
scripts/redstone-pinecube1-stream-x264-hires

@ -0,0 +1,33 @@ @@ -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 ! \

29
scripts/redstone-pinecube1-stream-x264-qvga

@ -0,0 +1,29 @@ @@ -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

28
scripts/redstone-pinecube1-stream-x264-vga

@ -0,0 +1,28 @@ @@ -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
Loading…
Cancel
Save