Skip to content

Instantly share code, notes, and snippets.

@zerkz
Last active November 4, 2023 21:08
Show Gist options
  • Save zerkz/f3228b0065a934e17f34a3dbf29a8a6e to your computer and use it in GitHub Desktop.
Save zerkz/f3228b0065a934e17f34a3dbf29a8a6e to your computer and use it in GitHub Desktop.
pi3-b door viewer setup
  1. raspbian 32 bit lite, configure ssh/wifi through pi imager.
  2. sudo apt-get update && sudo apt-get upgrade && sudo apt-get install vlc git xserver-xorg xinit && sudo mkdir -p /opt/scripts /opt/systemd_services
  3. sudo git clone https://github.com/goodtft/LCD-show.git /opt/LCD-show; sudo chmod -R 755 /opt/LCD-show;cd /opt/LCD-show/;sudo ./LCD5-show
    • This gets us the full resolution (800x480) (without this driver, it gets set at 640 instead of 800)
  4. modify /boot/config.txt with the following:
    • uncomment dtoverlay=vc4-kms-v3d -- which gets commented by the previous LCD-show scripts. We need this still for libmedia previews to work.
    • add hdmi_blanking=1 to add sleep-like behavior by shutting off hdmi. hopefully works with touch screen.
  5. setup systemd service to run rtsp server.

libcamera-vid -t 0 -f --inline -o - | cvlc stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/frontdoor}' :demux=h264

# /opt/systemd_services/front_door.service
[Unit]
Description=Live Door Viewer with RTSP server included.
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=zdware
ExecStart=/opt/scripts/libcamera_rtsp.sh
[Install]
WantedBy=multi-user.target
#!/bin/bash
libcamera-vid -t 0 -p 0,0,800,480 --width 1920 --height 1080 --inline -o - | cvlc stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/frontdoor}' :demux=h264
l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment