Cleanup repo + harden offline install and watchdog
Repo hygiene: - Remove dead scripts (.wait-for-display, .display-keepalive, .keep-screen-alive) - Remove stale backup/scratch (install.sh.bak, New.txt, stale .pyc) - Stop tracking machine-specific/generated state (config/app_config.json, playlists/server_playlist.json, src/player_auth.json, generated launchers) - Prune duplicate wheel versions (one per package) - Reorganize working_files -> dev/, dev/tests/, documentation/dev-notes/, scripts/ - Extend .gitignore; fix no-op rules in repo/.gitignore Offline install (install.sh): - Non-fatal system-dep step; per-package apt retry; .deb bundle install - Skip pip self-upgrade offline; guard online fallbacks behind connectivity probe - Dependency-free fetch_url (curl/wget/urllib); --no-reboot flag - Fix corrupted literal backslash-bang escapes (shebangs, test -f, banner) - Idempotent cron install (no more stacked @reboot lines) Autostart / watchdog: - start.sh: single-instance flock lock (.player_watchdog.lock) acquired only after a display is confirmed, preventing parallel watchdogs - Set XDG_RUNTIME_DIR when missing; exit early if headless - run_player.sh: activate .venv; stop_player.sh: clear lock file
This commit is contained in:
Executable
+57
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
# Video Conversion Script for Raspberry Pi Signage Player
|
||||
# Converts videos to optimal settings: 1080p @ 30fps, H.264 codec
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: $0 <input_video> [output_video]"
|
||||
echo "Example: $0 input.mp4 output.mp4"
|
||||
echo ""
|
||||
echo "This script converts videos to Raspberry Pi-friendly settings:"
|
||||
echo " - Resolution: Max 1920x1080"
|
||||
echo " - Frame rate: 30 fps"
|
||||
echo " - Codec: H.264"
|
||||
echo " - Bitrate: ~5-8 Mbps"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INPUT_VIDEO="$1"
|
||||
OUTPUT_VIDEO="${2:-converted_$(basename "$INPUT_VIDEO")}"
|
||||
|
||||
if [ ! -f "$INPUT_VIDEO" ]; then
|
||||
echo "Error: Input file '$INPUT_VIDEO' not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Converting video for Raspberry Pi playback..."
|
||||
echo "Input: $INPUT_VIDEO"
|
||||
echo "Output: $OUTPUT_VIDEO"
|
||||
echo ""
|
||||
|
||||
# Convert video with optimal settings for Raspberry Pi
|
||||
ffmpeg -i "$INPUT_VIDEO" \
|
||||
-c:v libx264 \
|
||||
-preset medium \
|
||||
-crf 23 \
|
||||
-maxrate 8M \
|
||||
-bufsize 12M \
|
||||
-vf "scale='min(1920,iw)':'min(1080,ih)':force_original_aspect_ratio=decrease,fps=30" \
|
||||
-r 30 \
|
||||
-c:a aac \
|
||||
-b:a 128k \
|
||||
-movflags +faststart \
|
||||
-y \
|
||||
"$OUTPUT_VIDEO"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo ""
|
||||
echo "✓ Conversion completed successfully!"
|
||||
echo "Original: $(du -h "$INPUT_VIDEO" | cut -f1)"
|
||||
echo "Converted: $(du -h "$OUTPUT_VIDEO" | cut -f1)"
|
||||
echo ""
|
||||
echo "You can now use '$OUTPUT_VIDEO' in your signage player."
|
||||
else
|
||||
echo ""
|
||||
echo "✗ Conversion failed! Make sure ffmpeg is installed:"
|
||||
echo " sudo apt-get install ffmpeg"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user