function runWrapperTest($contentDir, $patern) { echo "<br>\n"; $kdlSrcMedSet = getMediasetFromFile("{$contentDir}\\{$patern}"); $cdlSrcMedInf = new mediaInfo(); $cdlSrcMedInf->LoadFromMediaset($kdlSrcMedSet); $cdlFlavors[] = new flavorParams(); $cdlFlavors[0]->simulate(KDLContainerTarget::MP4, KDLVideoTarget::H264B, 0, 352, 2500, KDLAudioTarget::AAC, 96, 22050, "2,3"); $cdlTargets; $cdlTargets = KDLWrap::CDLGenerateTargetFlavors($cdlSrcMedInf, $cdlFlavors); $cmdLine = KDLWrap::CDLProceessFlavorsForCollection($cdlTargets->_targetList); if ($cdlTargets->_targetList[0]->engine_version == 0) { $cmdLine = $cdlTargets->_targetList[0]->command_lines; } else { $cmdLine = $cdlTargets->_targetList[0]->operators; $oprSets = new kOperatorSets(); // $operators = stripslashes($operators); //kLog::log(__METHOD__."\ncdlOperators(stripslsh)==>\n".print_r($operators,true)); $oprSets->setSerialized($cdlTargets->_targetList[0]->operators); $oprArr = $oprSets->getSets(); $cmdLine = $oprArr[0][0]->command; } $outFile = "aaa111.mpg"; $exec_cmd = str_replace(array(KDLCmdlinePlaceholders::InFileName, KDLCmdlinePlaceholders::OutFileName, KDLCmdlinePlaceholders::ConfigFileName), array("{$contentDir}\\{$patern}", $outFile, "mko"), $cmdLine); /* $xmlFileName = "k:\\pre.xml"; $fHd = fopen($xmlFileName, "w"); fwrite($fHd,$exec_cmd); fclose($fHd); //c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -file C:\opt\kaltura\app\batch\batches\Convert\scripts\runee3.ps1 C:\expressionencoder\ExpressionEncoder.dll W:\/content/entry/data/29/399/0_0bybp8ez_0_t75dk08i_1.mov C:\opt\kaltura\tmp\convert\convert_0_0bybp8ez_4c24801bbb92f.xml >> "C:\opt\kaltura\tmp\convert\0_0bybp8ez_0_2.log" 2>&1 $fHd = fopen("k:\\run.bat", "w"); fwrite($fHd,"c:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe -file K:\\opt\\kaltura\\app\\batch\\batches\\Convert\\scripts\\runee3.ps1 C:\\expressionencoder\\ExpressionEncoder.dll $contentDir\\$patern $xmlFileName\npause"); fclose($fHd); */ echo "1<br>\n"; echo $exec_cmd; // exec("ffmpeg ".$exec_cmd); if (!file_exists($outFile) || kFile::fileSize($outFile) == 0) { kLog::log("\nFailed"); } else { kLog::log("\nSucceeded, Filesize:" . kFile::fileSize($outFile)); } // $cdlAsset = new flavorAsset; // KDLWrap::ConvertMediainfoCdl2FlavorAsset($cdlMedInf, $cdlAsset); $cdlMedInf = new mediaInfo(); $kdlMedSet = getMediasetFromFile("{$outFile}"); $cdlMedInf->LoadFromMediaset($kdlMedSet); kLog::log("\npre CDLValidateProduct\n"); KDLWrap::CDLValidateProduct($cdlSrclMedInf, $cdlTargets->_targetList[0], $cdlMedInf); // print_r($kdlFlavor); return; }