Ejemplo n.º 1
0
 public function GenerateCommandLine(KDLFlavor $predesign, KDLFlavor $target, $extra = null)
 {
     //		$cmdLineGenerator = $target->SetTranscoderCmdLineGenerator($predesign);
     $cmdLineGenerator = new KDLTranscoderCommand($predesign, $target);
     $params = new KDLOperationParams();
     $params->Set($this->_id, $extra);
     if (isset($predesign->_video)) {
         return $cmdLineGenerator->Generate($params, $predesign->_video->_bitRate);
     } else {
         return $cmdLineGenerator->Generate($params, 0);
     }
 }
 static function mergeTranscoderObjArr(array $trPrmArr, $transParse, $extraParse = null, array $transDictionary = null)
 {
     foreach ($transParse as $key => $trId) {
         if ($trId == null) {
             continue;
         }
         if ($extraParse && array_key_exists($key, $extraParse)) {
             $trEx = $extraParse[$key];
         } else {
             $trEx = null;
         }
         if (is_array($trId)) {
             $auxArr = array();
             $trPrmArr[$key] = KDLUtils::mergeTranscoderObjArr($auxArr, $trId, $trEx, $transDictionary);
         } else {
             $trId = KDLUtils::trima($trId);
             if (!is_null($transDictionary) && array_key_exists($trId, $transDictionary)) {
                 $trId = $transDictionary[$trId];
             }
             $trPrm = new KDLOperationParams();
             $trPrm->Set($trId, $trEx);
             $trPrmArr[$key] = $trPrm;
         }
     }
     return $trPrmArr;
 }
Ejemplo n.º 3
0
 private function setProfileWithIntermediateSource($contId, $vidId, $vidBr, $vidHeight, $audId, $audBr, $audSr, $engVer, $engine)
 {
     $interSrcFlavor = new KDLFlavor();
     $interSrcFlavor->_name = "Automatic Intermediate Source";
     $interSrcFlavor->_id = 0;
     $interSrcFlavor->_container = new KDLContainerData();
     $interSrcFlavor->_container->_id = $contId;
     $vid = new KDLVideoData();
     $vid->_id = $vidId;
     $vid->_bitRate = $vidBr;
     $vid->_height = $vidHeight;
     $interSrcFlavor->_video = $vid;
     $aud = new KDLAudioData();
     $aud->_id = $audId;
     $aud->_bitRate = $audBr;
     $aud->_sampleRate = $audSr;
     $interSrcFlavor->_audio = $aud;
     $interSrcFlavor->_engineVersion = $engVer;
     $opr = new KDLOperationParams();
     $opr->Set($engine);
     if ($interSrcFlavor->_engineVersion == 1) {
         $opr->_engine = KalturaPluginManager::loadObject('KDLOperatorBase', $opr->_id);
     } else {
         $opr->_engine = new KDLOperatorWrapper($opr->_id);
     }
     if ($opr->_engine == null) {
         return null;
     }
     $interSrcFlavor->_transcoders[] = $opr;
     $interSrcProfile = new KDLProfile();
     $interSrcProfile->_flavors[] = $interSrcFlavor;
     return $interSrcProfile;
 }