From 0d441072e15cf0df081af3ae566e7bf1ebd9dcdb Mon Sep 17 00:00:00 2001 From: Metacube Date: Sun, 5 Apr 2026 09:01:30 +0200 Subject: [PATCH] Delete time_Screenshot --- time_Screenshot | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 time_Screenshot diff --git a/time_Screenshot b/time_Screenshot deleted file mode 100644 index 5996c77..0000000 --- a/time_Screenshot +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -# Konfiguration -output_dir="./image" -rtsp_url="rtsp://admin:Kk@619477@mkesslerg.duckdns.org:88/videoMain" -interval=60 # 10 Minuten 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") - local output_file="$output_dir/screenshot_$timestamp.jpg" - local log_file="$output_dir/ffmpeg_log_$timestamp.txt" - - echo "Versuche Screenshot zu erstellen..." - echo "Befehl: ffmpeg -i $rtsp_url -vframes 1 -q:v 2 $output_file" - - ffmpeg -i "$rtsp_url" -vframes 1 -q:v 2 -ss 00:00:01 "$output_file" - - - if [ -f "$output_file" ]; then - echo "Screenshot erstellt: $output_file" - echo "FFmpeg Log:" - cat "$log_file" - else - echo "Fehler beim Erstellen des Screenshots." - echo "FFmpeg Log:" - cat "$log_file" - fi -} -# Funktion zum Löschen alter Bilder -delete_old_images() { - find "$output_dir" -type f -name "screenshot_*.jpg" -mmin +1440 -delete - echo "Bilder älter als 24 Stunden wurden gelöscht." -} - -# Hauptschleife -while true; do -echo "Starte Screenshot-Aufnahme..." -echo "Bilder werden in $output_dir gespeichert" -take_screenshot - delete_old_images - sleep $interval - done