Hallo Peter,
hat am Wochenende nicht geklappt. Aber jetzt.
Ich habe den Code leider nicht kommentiert, war ja nur für mich.:rolleyes:
Der Code enthält die absoluten Pfade zu den Bildern und dem SSMM-Programm.
Das Steuerscript braucht für jedes Bild im AVI eine Beschreibung (pict_descriptor). Das wird in der foreach-Schleife zusammengebaut. Alle verwendeten (und keine anderen) Bilder liegen in einem Verzeichnis . Die Bilder-Filenamen enthalten bei mir Datum und Uhrzeit „2009-05-21_04-46-28.jpg“ woraus ich die Einblendungen generiere. Schließlich wird das Steuerscript mit dem "project_descriptor " noch abgeschlossen und gespeichert.
IPS_ExecuteEx - lässt SSMM das dann abarbeiteten.
Gruss
Stefan
<?
class array_ereg {
function array_ereg($pattern) { $this->pattern = $pattern; }
function ereg($string) {
return preg_match("#".$this->pattern."#", $string);
}
}
function write_arr($myArray){
$myString='';
foreach ($myArray AS $key=>$value)
{
$myString .= $key."=".$value.chr(13).chr(10);
}
return $myString;
}
$folder = "C:\\Documents and Settings\\sk\\My Documents\\Captured Files\\";
$target_folder = "C:\\Documents and Settings\\sk\\My Documents\\Captured Files\\SSMM 3.7\\";
$pict_descriptor = array(
'AudioFadingTime'=>0,
'AudioFile'=>'',
'AudioStartTime'=>0,
'ColorFade_ColorRef'=>0,
'Fade2NextPicture'=>1,
'FadeOption'=>-1,
'Fading2NextPictureName'=>'Additional Dissolve',
'FileName'=>'C:\Documents and Settings\sk\My Documents\Captured Files\2009-05-21_04-46-28.jpg',
'FlightPoints'=>'',
'FlightPointsColor'=>255,
'FlightPointsRadius'=>10,
'Font_CharSet'=>0,
'Font_ClipPrecision'=>0,
'Font_Escapement'=>0,
'Font_Height'=>30,
'Font_Italic'=>0,
'Font_Name'=>'Arial',
'Font_Orientation'=>0,
'Font_OutPrecision'=>0,
'Font_PitchAndFamily'=>34,
'Font_Quality'=>0,
'Font_StrikeOut'=>0,
'Font_TextBackColor'=>5242880,
'Font_TextColor'=>16777215,
'Font_Underline'=>0,
'Font_Weight'=>200,
'Font_Width'=>14,
'IsColorFade'=>0,
'LoopAudio'=>0,
'NormalizeAudio'=>0,
'PanoramaScrolling'=>0,
'PanoramaScrollingType'=>-1,
'PictureMove'=>0,
'PictureMoveSettings'=>'',
'PictureText'=>'2009-05-21_04-46-28',
'Rotation'=>0,
'ShowPicture'=>5,
'SynchronizeFF2NP'=>0,
'Text-FadeIn'=>1,
'Text-FadeOut'=>1,
'TextBackWidth'=>2,
'TextFadeInEffectName'=>'Cross Dissolve',
'TextFadeOutEffectName'=>'Cross Dissolve',
'TextPosition'=>6
);
$project_descriptor = array(
'CropBottom'=>0,
'CropLeft'>=0,
'CropRight'=>0,
'CropTop'=>0,
'Frames-Fading2NextPicture'=>25,
'Frames-Showing-Picture'=>100,
'Frames-Text-Fade-In'=>25,
'Frames-Text-Fade-Out'=>15,
'FramesPerSeconds'=>25,
'GlobalBackgroundColorB'=>0,
'GlobalBackgroundColorG'=>0,
'GlobalBackgroundColorR'=>0,
'MaxFileSizeLimit'=>640,
'Movie-Size-X'=>640,
'Movie-Size-Y'=>480,
'Output-AVI'=>'C:\\Documents and Settings\\sk\\My Documents\\Captured Files\\SSMM 3.7\\HT_VID_1.avi',
'PictureMove_Quality'=>2,
'PictureMove_ScaleLimit'=>2,
'RescalePictures'=>1,
'TempDir'=>'C:\\Dokumente und Einstellungen\\sk\\Eigene Dateien\\SSMM 3.7\\Temp',
'UseFadingBetweenPictures'=>1,
'UseTextFading'=>1
);
$back = GetValue(22425 /*[Erdgeschoss\Haustuer\WEB-CAM\alt]*/);
//$back = $back+1;
SetValue(22425 /*[Erdgeschoss\Haustuer\WEB-CAM\alt]*/,$back);
//$day = date;
$yesterday = time()-60*60*24;
$day = date("Y-m-d",$yesterday);
echo $day.chr(13).chr(10);
$daypattern = $day."_.*\.jpg";
if (is_dir($folder)){
$contents = scandir($folder);
$bad = array(".", "..", ".DS_Store", "_notes", "Thumbs.db");
$files = array_diff($contents, $bad);
echo count($files);
$thisday = array_filter($files, array(new array_ereg($day."_.*\.jpg"), 'ereg'));
print_r($thisday);
$filecontent = '';
$piccounter = 0;
foreach($thisday as $key=>$value){
$pict_descriptor['FileName'] = $folder.$value;
echo $piccounter.': '.$pict_descriptor['FileName'].chr(13).chr(10);
$pict_descriptor['PictureText'] = str_replace(".jpg","",$value);
echo $piccounter.': '.$pict_descriptor['PictureText'].chr(13).chr(10);
$filecontent .= "[PICTURE_".$piccounter."]".chr(13).chr(10);
$filecontent .= write_arr($pict_descriptor).chr(13).chr(10);
$piccounter++;
}
$project_descriptor['Output-AVI'] = $target_folder.'HT_VID_'.$day.".avi";
$filecontent .= "[PROJECT_SETTINGS]".chr(13).chr(10);
$filecontent .= write_arr($project_descriptor).chr(13).chr(10);
$ctp=@fopen('C:\\Documents and Settings\\sk\\My Documents\\Captured Files\\SSMM 3.7\\HT_VID.ini','w+');
@fwrite($ctp,$filecontent."
");
@fclose($ctp);
IPS_ExecuteEx("C:\\Documents and Settings\\sk\\My Documents\\Captured Files\\SSMM 3.7\\ssmm.exe","-project HT_VID.ini -create CS_0.ini",FALSE,FALSE,0);
}
?>