Kaltura server now supports the new abilities to clip or trim an entry. The trimming or clipping is done physically on the file system using conversion engines such as FFMPEG.
Clipping vs Trimming:
$filter = new KalturaMediaEntryFilter(); $filter->rootEntryIdEqual = '0_ad523s'; //Add your source entry id here $results = $client->media->listAction($filter, null);
In order to chain several clips from a single video, create a dynamic playlist with this filter:
$filter = new KalturaMediaEntryFilterForPlaylist(); $filter->rootEntryIdEqual = '0_ad523s'; //Add your source entry id here
// Params $overwrite = true; //Decides whether to trim the entry or clip it // Entry Data $entryId = '0_ad523s';//Add your entry ID $startTime = 100; //Set the start time of the clip / trim in milliseconds $endTime = 5000; //Set the end time of the clip / trim in milliseconds $clipDuration = $endTime - $startTime; // Create New Clip $operation1 = new KalturaClipAttributes(); $operation1->offset = $startTime; $operation1->duration = $clipDuration; // Add New Resource $resource = new KalturaOperationResource(); $resource->resource = new KalturaEntryResource(); $resource->resource->entryId = $entryId; $resource->operationAttributes = array($operation1); if( $overwrite ) { // Trim Entry try { $resultEntry = $client->media->updateContent($entryId, $resource); } catch( Exception $e ){ die('{"error": "' . $e->getMessage() . '"}'); } } else { // Create New Media Entry $entry = new KalturaMediaEntry(); $entry->name = "New Clipped Entry Name"; $entry->description = "New Clipped Entry Description"; $entry->mediaType = 1; //The new media type // New Clip $resultEntry = $client->media->add($entry); $resultEntry = $client->media->addContent($resultEntry->id, $resource); }
*Code was taken from our new clipping application
So trim away!