Skip to main content
View as Markdown

Clip (Extract Segment to New Entry) - Content Management

Clip (Extract Segment to New Entry)​

Create a new entry containing a segment from an existing video.

Clone the Entry (Metadata Only)​

curl -X POST "$KALTURA_SERVICE_URL/service/baseEntry/action/clone" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "entryId=$KALTURA_SOURCE_ENTRY_ID" \
-d "cloneOptions[0][objectType]=KalturaBaseEntryCloneOptionComponent" \
-d "cloneOptions[0][itemType]=6" \
-d "cloneOptions[0][rule]=1"

The KalturaBaseEntryCloneOptionComponent with itemType=6 (flavors) and rule=1 (exclude) creates a NO_CONTENT entry (status=7) that inherits the source's metadata, tags, and categories without copying flavors.

Apply Clip Operation​

curl -X POST "$KALTURA_SERVICE_URL/service/media/action/updateContent" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "entryId=$KALTURA_CLONED_ENTRY_ID" \
-d "resource[objectType]=KalturaOperationResource" \
-d "resource[resource][objectType]=KalturaEntryResource" \
-d "resource[resource][entryId]=$KALTURA_SOURCE_ENTRY_ID" \
-d "resource[resource][flavorParamsId]=0" \
-d "resource[operationAttributes][0][objectType]=KalturaClipAttributes" \
-d "resource[operationAttributes][0][offset]=60000" \
-d "resource[operationAttributes][0][duration]=30000"

This populates the cloned entry with a 30-second clip starting at 1:00 from the source.

Alternative: Direct addContent to New Entry​

For simpler workflows where you create a fresh entry rather than cloning:

curl -X POST "$KALTURA_SERVICE_URL/service/media/action/add" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "entry[objectType]=KalturaMediaEntry" \
-d "entry[mediaType]=1" \
-d "entry[name]=Clip from Source"

Then apply the clip via addContent:

curl -X POST "$KALTURA_SERVICE_URL/service/media/action/addContent" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "entryId=$KALTURA_NEW_ENTRY_ID" \
-d "resource[objectType]=KalturaOperationResource" \
-d "resource[resource][objectType]=KalturaEntryResource" \
-d "resource[resource][entryId]=$KALTURA_SOURCE_ENTRY_ID" \
-d "resource[resource][flavorParamsId]=0" \
-d "resource[operationAttributes][0][objectType]=KalturaClipAttributes" \
-d "resource[operationAttributes][0][offset]=60000" \
-d "resource[operationAttributes][0][duration]=30000"