/**
  * Execute register asset with new details to update exisiting asset
  * 
  * @param int $assetId
  * @param string $licenseStartDate
  * @param string $licenseEndDate
  * @throws kApplicativeException
  */
 private function updateWidevineAsset($assetId, $licenseStartDate, $licenseEndDate, $profile)
 {
     KalturaLog::debug("Update asset [" . $assetId . "] license start date [" . $licenseStartDate . '] license end date [' . $licenseEndDate . ']');
     $errorMessage = '';
     $wvAssetId = KWidevineBatchHelper::sendRegisterAssetRequest($profile->regServerHost, null, $assetId, $profile->portal, null, $licenseStartDate, $licenseEndDate, $profile->iv, $profile->key, $errorMessage);
     if (!$wvAssetId) {
         KBatchBase::unimpersonate();
         $logMessage = 'Asset update failed, asset id: ' . $assetId . ' error: ' . $errorMessage;
         KalturaLog::err($logMessage);
         throw new kApplicativeException(null, $logMessage);
     }
 }
 private function fixInputAssets($inputFiles)
 {
     $localTmpPath = dirname($this->data->destFileSyncLocalPath);
     $fixedInputFiles = array();
     $inputFiles = explode(',', $inputFiles);
     $returnValue = 0;
     $output = array();
     foreach ($inputFiles as $inputFile) {
         $fixedInputFile = $localTmpPath . '/' . basename($inputFile);
         $cmd = KWidevineBatchHelper::getFixAssetCmdLine($this->params->ffmpegCmd, $inputFile, $fixedInputFile);
         $lastLine = exec($cmd, $output, $returnValue);
         KalturaLog::info('Command execution output: ' . print_r($output, true));
         if ($returnValue != 0) {
             KBatchBase::unimpersonate();
             $logMessage = 'Asset fix failed: ' . $inputFile . ' error: ' . $lastLine;
             KalturaLog::err($logMessage);
             throw new KOperationEngineException($logMessage);
         }
         $fixedInputFiles[] = $fixedInputFile;
     }
     return implode(',', $fixedInputFiles);
 }