Hello
Vous n’êtes pas obligé de modifier le plugin … vous pouvez tout gérer par un scénario … enregistrement sur le jeedom d’une snapshot à partir d’une url …et si vous voulez vous pouvez prendre plein de snap et faire une vidéo et apres l’envoyer avec le canal que vous souhaitez …dans l’exemple ci-dessous via jeedomConnect
function sendvideo($scenario,$message) {
$date = new DateTime();
$dateMef=$date->format('Y-m-d H:i:s');
//Build video from snapshot
$filePath='/var/www/html/snapshots/records/';
$fileName='_snap_record_Garage.jpg';
$scenario->setLog($filePath.'temp');
$scenario->setLog(str_pad($nb, 8, '0', STR_PAD_LEFT).$fileName);
$startTime=strtotime("now");
$endTime=$startTime+30;
$nb=0;
$nbSnapshot=30;
//while ( strtotime("now") <= $endTime) {
while ($nb <= $nbSnapshot) {
$scenario->setLog(strtotime("now") .'| endtime : ' . $endTime);
commonsFunction::get_file($scenario,'http://192.168.1.135:8765/picture/1/current/',$filePath.'/temp/',str_pad($nb++, 8, '0', STR_PAD_LEFT).$fileName);
sleep(1);
}
if (file_exists($filePath.'/temp/')) {
$output_file = 'buildVideo' . '_' . date('Y-m-d_H-i-s') . '.mp4';
$files = scandir($filePath.'/temp/');
if (count($files) > 1) {
//$first_number = substr($files[2], 0, 6);
$first_number = substr($files[2], 0, 1);
$start = '-start_number ' . $first_number . ' ';
}
$framerate="1";
$engine = config::byKey('rtsp::engine','camera','avconv');
$scenario->setLog('engine : ' .$engine);
$scenario->setLog('Start : ' . $start);
$shellCmd=$engine.' -framerate ' . $framerate . ' ' . $start . ' -f image2 -i ' . $filePath .'temp/' . '%08d' . '_snap_record_Garage.jpg -pix_fmt yuv420p ' . '/var/www/html/snapshots/records/' .$output_file;
$scenario->setLog($shellCmd);
$result=shell_exec($shellCmd);
notificationFunction::sendJeedomConnectMessage($scenario,'chris','Notif_Camera','/var/www/html/snapshots/records/' .$output_file,'Camera Garage Motion eye : '. $dateMef,$message);
shell_exec(system::getCmdSudo() . 'rm -rf ' . $filePath.'/temp/*.jpg');
}
}
La fonction commonsFunction::get_file permet d’enregistrer l’image à partir d’une url
public function get_file($scenario,$file, $local_path, $newfilename) {
$err_msg = '';
$out = fopen($local_path.$newfilename,"wb");
//$scenario->setLog("Attempting message download for $file to $out");
if ($out == FALSE){
$scenario->setLog("File not opened<br>");
exit;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_FILE, $out);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, $file);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_exec($ch);
//$scenario->setLog("Error is : ".curl_error($ch));
curl_close($ch);
}
A ça il faut ajouter un pti script de purge des fichiers et le tour est joué … moi je fais une vidéo si une personne ouvre le garage et que l’alarme est activée… 
$scenario->setLog("Start script delete snapshots");
//31 jours
//$delta=2678400;
//16 jours
$delta=1382400;
//Delete videos
deleteFile($scenario,'/var/www/html/snapshots/records/',$delta);
$scenario->setLog(' ');
//delete snapshots
deleteFile($scenario,'/var/www/html/snapshots/',$delta);
function deleteFile($scenario,$path,$delta) {
try {
$nbDelete=0;
$scenario->setLog('Function deleteFile : ' . $path . ' - delta : ' . $delta);
$folder=new DirectoryIterator($path);
$scenario->setLog('Path : ' . $path . ' -> esapce utilisé avant purge : ' . shell_exec('du -sh '. $path));
foreach($folder as $file) {
try {
if($file->isFile() && !$file->isDot() && (time() - $file->getMTime() > $delta)) {
unlink($path.$file->getFilename());
$nbDelete++;
$scenario->setLog("File : " . $file->getFilename() . '| creation date : ' . $file->getMTime() . ' ==> deleted');
}
} catch (Exception $e) {
$scenario->setLog(' => Error on deleteFile function on a file : ' . $e->getMessage());
}
}
$scenario->setLog(' - Nb fichiers purgés : ' . $nbDelete);
$scenario->setLog('Path : ' . $path . ' -> esapce utilisé après purge : ' . shell_exec('du -sh '. $path));
} catch (Exception $e) {
$scenario->setLog(' => Error on deleteFile function : ' . $e->getMessage());
}
}
$scenario->setLog("End script delete snapshots");
Avec ça peut importe le plugin vous etes en capacité de sauvegarder des snaps … de créer un ptite video et de l’envoyer
Si ça peut aider et que vous avez des soucis d’intégration hésitez pas par MP
@chris94440