From 4e871fa4b615e526d766762b3f70f80ce71810a4 Mon Sep 17 00:00:00 2001 From: metacube2 Date: Wed, 7 Aug 2024 09:02:05 +0200 Subject: [PATCH] Create time_Screenshot --- time_Screenshot | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 time_Screenshot diff --git a/time_Screenshot b/time_Screenshot new file mode 100644 index 0000000..2ed9bf6 --- /dev/null +++ b/time_Screenshot @@ -0,0 +1,29 @@ +#!/bin/bash + +# Konfiguration +output_dir="./image" +rtsp_url="rtsp://admin:Kk@619477@mkesslerg.duckdns.org:88/videoMain" +interval=3600 # 1 Stunde in Sekunden + +# Erstelle das Ausgabeverzeichnis, falls es nicht existiert +mkdir -p "$output_dir" + +# Funktion zum Erstellen eines Screenshots +take_screenshot() { + local timestamp=$(date +"%Y%m%d_%H%M%S") + ffmpeg -y -i "$rtsp_url" -vframes 1 "$output_dir/screenshot_$timestamp.jpg" 2>/dev/null + + if [ $? -eq 0 ]; then + echo "Screenshot erstellt: $output_dir/screenshot_$timestamp.jpg" + else + echo "Fehler beim Erstellen des Screenshots" + fi +} + +# Hauptschleife +echo "Starte stündliche Screenshot-Aufnahme..." +echo "Bilder werden in $output_dir gespeichert" +while true; do + take_screenshot + sleep $interval +done