public static function ConvertMediainfoCdl2Mediadataset(mediaInfo $cdlMediaInfo, KDLMediaDataSet &$medSet)
 {
     //		KalturaLog::log(__METHOD__."->".$cdlMediaInfo->getRawData());
     $medSet->_container = new KDLContainerData();
     $medSet->_streamsCollectionStr = $cdlMediaInfo->getMultiStreamInfo();
     $medSet->_container->_id = $cdlMediaInfo->getContainerId();
     $medSet->_container->_format = $cdlMediaInfo->getContainerFormat();
     $medSet->_container->_duration = $cdlMediaInfo->getContainerDuration();
     $medSet->_container->_bitRate = $cdlMediaInfo->getContainerBitRate();
     $medSet->_container->_fileSize = $cdlMediaInfo->getFileSize();
     if ($medSet->_container->IsDataSet() == false) {
         $medSet->_container = null;
     }
     $medSet->_video = new KDLVideoData();
     $medSet->_video->_id = $cdlMediaInfo->getVideoCodecId();
     $medSet->_video->_format = $cdlMediaInfo->getVideoFormat();
     $medSet->_video->_duration = $cdlMediaInfo->getVideoDuration();
     $medSet->_video->_bitRate = $cdlMediaInfo->getVideoBitRate();
     $medSet->_video->_width = $cdlMediaInfo->getVideoWidth();
     $medSet->_video->_height = $cdlMediaInfo->getVideoHeight();
     $medSet->_video->_frameRate = $cdlMediaInfo->getVideoFrameRate();
     $medSet->_video->_dar = $cdlMediaInfo->getVideoDar();
     $medSet->_video->_rotation = $cdlMediaInfo->getVideoRotation();
     $medSet->_video->_scanType = $cdlMediaInfo->getScanType();
     /*		{
     				$medLoader = new KDLMediaInfoLoader($cdlMediaInfo->getRawData());
     				$md = new KDLMediadataset();
     				$medLoader->Load($md);
     				if($md->_video)
     					$medSet->_video->_scanType = $md->_video->_scanType;
     		}
     */
     if ($medSet->_video->IsDataSet() == false) {
         $medSet->_video = null;
     }
     $medSet->_audio = new KDLAudioData();
     $medSet->_audio->_id = $cdlMediaInfo->getAudioCodecId();
     $medSet->_audio->_format = $cdlMediaInfo->getAudioFormat();
     $medSet->_audio->_duration = $cdlMediaInfo->getAudioDuration();
     $medSet->_audio->_bitRate = $cdlMediaInfo->getAudioBitRate();
     $medSet->_audio->_channels = $cdlMediaInfo->getAudioChannels();
     $medSet->_audio->_sampleRate = $cdlMediaInfo->getAudioSamplingRate();
     $medSet->_audio->_resolution = $cdlMediaInfo->getAudioResolution();
     if ($medSet->_audio->IsDataSet() == false) {
         $medSet->_audio = null;
     }
     return $medSet;
 }
예제 #2
0
 public static function ConvertMediainfoCdl2Mediadataset(mediaInfo $cdlMediaInfo, KDLMediaDataSet &$medSet)
 {
     $medSet->_container = new KDLContainerData();
     /**/
     $contentStreams = $cdlMediaInfo->getContentStreams();
     if (isset($contentStreams)) {
         if (is_string($contentStreams)) {
             $fromJson = json_decode($contentStreams);
             $medSet->_contentStreams = isset($fromJson) ? $fromJson : null;
         } else {
             $medSet->_contentStreams = $contentStreams;
         }
     }
     $medSet->_container->_id = $cdlMediaInfo->getContainerId();
     $medSet->_container->_format = $cdlMediaInfo->getContainerFormat();
     $medSet->_container->_duration = $cdlMediaInfo->getContainerDuration();
     $medSet->_container->_bitRate = $cdlMediaInfo->getContainerBitRate();
     $medSet->_container->_fileSize = $cdlMediaInfo->getFileSize();
     $medSet->_container->_isFastStart = $cdlMediaInfo->getIsFastStart();
     if ($medSet->_container->IsDataSet() == false) {
         $medSet->_container = null;
     }
     $medSet->_video = new KDLVideoData();
     $medSet->_video->_id = $cdlMediaInfo->getVideoCodecId();
     $medSet->_video->_format = $cdlMediaInfo->getVideoFormat();
     $medSet->_video->_duration = $cdlMediaInfo->getVideoDuration();
     $medSet->_video->_bitRate = $cdlMediaInfo->getVideoBitRate();
     $medSet->_video->_width = $cdlMediaInfo->getVideoWidth();
     $medSet->_video->_height = $cdlMediaInfo->getVideoHeight();
     $medSet->_video->_frameRate = $cdlMediaInfo->getVideoFrameRate();
     $medSet->_video->_dar = $cdlMediaInfo->getVideoDar();
     $medSet->_video->_rotation = $cdlMediaInfo->getVideoRotation();
     $medSet->_video->_scanType = $cdlMediaInfo->getScanType();
     /*		{
     				$medLoader = new KDLMediaInfoLoader($cdlMediaInfo->getRawData());
     				$md = new KDLMediadataset();
     				$medLoader->Load($md);
     				if($md->_video)
     					$medSet->_video->_scanType = $md->_video->_scanType;
     		}
     */
     if ($medSet->_video->IsDataSet() == false) {
         $medSet->_video = null;
     }
     $medSet->_audio = new KDLAudioData();
     $medSet->_audio->_id = $cdlMediaInfo->getAudioCodecId();
     $medSet->_audio->_format = $cdlMediaInfo->getAudioFormat();
     $medSet->_audio->_duration = $cdlMediaInfo->getAudioDuration();
     $medSet->_audio->_bitRate = $cdlMediaInfo->getAudioBitRate();
     $medSet->_audio->_channels = $cdlMediaInfo->getAudioChannels();
     $medSet->_audio->_sampleRate = $cdlMediaInfo->getAudioSamplingRate();
     $medSet->_audio->_resolution = $cdlMediaInfo->getAudioResolution();
     if ($medSet->_audio->IsDataSet() == false) {
         $medSet->_audio = null;
     }
     return $medSet;
 }