From b8ff3a003c1bf22ccb939b49b0d1929aee77eecb Mon Sep 17 00:00:00 2001 From: Sailor <> Date: Tue, 26 Nov 2019 12:39:20 +0000 Subject: [PATCH] 73_DoorBird: Feature - Videos File Format as Attribute git-svn-id: https://svn.fhem.de/fhem/trunk@20597 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/73_DoorBird.pm | 72 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/73_DoorBird.pm b/fhem/FHEM/73_DoorBird.pm index e2a34023c..eb0d2a166 100644 --- a/fhem/FHEM/73_DoorBird.pm +++ b/fhem/FHEM/73_DoorBird.pm @@ -84,6 +84,7 @@ sub DoorBird_Initialize($) "ImageFileDir " . "AudioFileDir " . "VideoFileDir " . + "VideoFileFormat:mpeg,mpg,mp4,avi,mov,dvd,vob,ogg,ogv,mkv,flv,webm " . "VideoDurationDoorbell " . "VideoDurationMotion " . "VideoDurationKeypad " . @@ -180,6 +181,7 @@ sub DoorBird_Define($$) $hash->{helper}{ImageFileDir} = AttrVal($name, "ImageFileDir", ""); $hash->{helper}{AudioFileDir} = AttrVal($name, "AudioFileDir", ""); $hash->{helper}{VideoFileDir} = AttrVal($name, "VideoFileDir", ""); + $hash->{helper}{VideoFileFormat} = AttrVal($name, "VideoFileFormat","mpeg"); $hash->{helper}{VideoDurationDoorbell} = AttrVal($name, "VideoDurationDoorbell", 0); $hash->{helper}{VideoDurationMotion} = AttrVal($name, "VideoDurationMotion", 0); $hash->{helper}{VideoDurationKeypad} = AttrVal($name, "VideoDurationKeypad", 0); @@ -501,7 +503,19 @@ sub DoorBird_Attr(@) ### Set helper in hash $hash->{helper}{VideoDurationKeypad} = "0"; } - } + } + ### Check whether VideoFileFormat attribute has been provided + elsif ($a[2] eq "VideoFileFormat") { + ### Check whether VideoFileFormat is defined + if (defined($a[3])) { + ### Set helper in hash + $hash->{helper}{VideoFileFormat} = $a[3]; + } + else { + ### Set helper in hash + $hash->{helper}{VideoFileFormat} = "mpeg"; + } + } ### Check whether EventReset attribute has been provided elsif ($a[2] eq "EventReset") { ### Remove Timer for Event Reset @@ -3521,10 +3535,10 @@ sub DoorBird_Video_Request($$$$) { ### Check whether the last "/" at the end of the path has been given otherwise add it an create complete path if ($hash->{helper}{VideoFileDir} =~ /\/\z/) { - $VideoFileName .= $VideoFileTimeStamp . "_" . $event . ".mpeg"; + $VideoFileName .= $VideoFileTimeStamp . "_" . $event . "." . $hash->{helper}{VideoFileFormat}; } else { - $VideoFileName .= "/" . $VideoFileTimeStamp . "_" . $event . ".mpeg"; + $VideoFileName .= "/" . $VideoFileTimeStamp . "_" . $event . "." . $hash->{helper}{VideoFileFormat}; } ### Log Entry for debugging purposes @@ -3564,10 +3578,10 @@ sub DoorBird_Video_Request($$$$) { ### Check whether the last "/" at the end of the path has been given otherwise add it an create complete path if ($hash->{helper}{VideoFileDir} =~ /\\\z/) { - $VideoFileName .= $VideoFileTimeStamp . "_" . $event . ".mpeg"; + $VideoFileName .= $VideoFileTimeStamp . "_" . $event . "." . $hash->{helper}{VideoFileFormat}; } else { - $VideoFileName .= "\\" . $VideoFileTimeStamp . "_" . $event . ".mpeg"; + $VideoFileName .= "\\" . $VideoFileTimeStamp . "_" . $event . "." . $hash->{helper}{VideoFileFormat}; } ### Log Entry for debugging purposes @@ -4202,6 +4216,30 @@ sub DoorBird_BlockGet($$$$) { The default value is "" = disabled
+ + + VideoFileDir : The relative (e.g. "images") or absolute (e.g. "/mnt/NAS/images") with or without trailing "/" directory path to which the video files supposed to be stored.
+ The default value is "" = disabled
+ + + + + VideoFileFormat : The file format for the video file to be stored
+ The default value is "mpeg"
+ + + + + VideoDurationDoorbell : Time in seconds for how long the video shall be recorded in case of an doorbbell event.
+ The default value is 0 = disabled
+ + + + + VideoDurationMotion : Time in seconds for how long the video shall be recorded in case of an motion sensor event.
+ The default value is 0 = disabled
+ + EventReset : Time in seconds after wich the Readings for the Events Events (e.g. "doorbell_button", "motions sensor", "keypad") shal be reset to "idle".
@@ -4373,12 +4411,36 @@ sub DoorBird_BlockGet($$$$) { Der Default Wert ist 0 = deaktiviert
+ + + VideoFileFormat : Das Dateiformat für die Videodatei
+ Der Default Wert ist "mpeg"
+ + ImageFileDir : Der relative (z.B. "images") oder absolute (z.B. "/mnt/NAS/images") Verzeichnispfad mit oder ohne nachfolgendem Pfadzeichen "/" in welchen die Bild-Dateien gespeichert werden sollen.
Der Default Wert ist 0 = deaktiviert
+ + + VideoFileDir : Der relative (z.B. "images") oderr absolute (z.B. "/mnt/NAS/images") Verzeichnispfad mit oder ohne nachfolgendem Pfadzeichen "/" in welchen die Video-Dateien gespeichert werden sollen.
+ Der Default Wert ist "" = deaktiviert
+ + + + + VideoDurationDoorbell : Zeit in Sekunden für wie lange das Video im Falle eines Klingel Events aufgenommen werden soll.
+ Der Default Wert ist 0 = deaktiviert
+ + + + + VideoDurationMotion : Zeit in Sekunden für wie lange das Video im Falle eines Bewegungssensor Events aufgenommen werden soll.
+ Der Default Wert ist 0 = deaktiviert
+ + EventReset : Zeit in Sekunden nach welcher die Readings für die Events (z.B. "doorbell_button", "motions sensor", "keypad")wieder auf "idle" gesetzt werden sollen.