This is an old revision of the document!
====== Raspberry Pi Video Player Setup ====== ===== Basic Setup ===== * Install latest Raspberry Pi OS Lite. * At first boot, set up account: * Username: user * Set a password. * Run `raspi-config`: * Set up Wi-Fi and SSH (temporary, for setup only). * Set hostname (e.g. videopi). * Update system: * `sudo apt update` * `sudo apt dist-upgrade` * Install VLC: * `sudo apt install vlc` ===== Add Video ===== * Obtain video via `wget` or `scp` (e.g. with WinSCP). * Assume filename is `test.mp4`. ===== Test Playback ===== * Run: * `cvlc –loop –no-video-title-show –fullscreen test.mp4` * Press `Ctrl+C` to exit. * Note: You can trigger video playback via SSH; video will display on the connected screen. ===== Enable Auto-login on tty1 ===== * Edit file: * `sudo nano /etc/systemd/system/getty.target.wants/getty@tty1.service` * Change this line: * `#ExecStart=-/sbin/agetty -o '-p – \\u' –noclear - $TERM` * To: * `ExecStart=-/sbin/agetty -o '-p -f – \\u' –autologin user –noclear - $TERM` * Note: This allows full system access to anyone with physical keyboard access. ===== Auto-Playback Script ===== Create `~/autoplay-on-tty-login`: ```bash #!/bin/bash # This script auto-plays the video on tty1 if [ $(tty) == "/dev/tty1" ]; then echo "Running $0…" echo -e '\e[93;41m \e[m' echo -e '\e[93;41m Auto-starting video playback in 5 seconds. Hit Ctrl+C to drop back to the terminal. \e[m' echo -e '\e[93;41m \e[m' echo sleep 5 bash ~/playvideo echo echo -e '\e[93;45m \e[m' echo -e '\e[93;45m Video playback aborted. Exiting this shell will restart video playback. \e[m' echo -e '\e[93;45m \e[m' echo else echo "$0: This script only runs on tty1." fi ```