Skip to main content

Trim

Instead of using an entire file, you can just specify the portions of the file that you would like to use. You can specify trim locations in a number of different ways, including by in/out points in time, by in_points+duration, by timecode, etc. The example below trims 2 minutes of content out of the source file starting at 10 minutes into the file.


Example Trim Object

{
"name": "Hybrik Trim",
"payload": {
"elements": [
{
"uid": "source_file",
"kind": "source",
"payload": {
"kind": "asset_url",
"payload": {
"storage_provider": "s3",
"url": "s3://my_bucket/my_input_folder/my_file.mp4",
"trim": {
"inpoint_sec": 600,
"outpoint_sec": 720
}
}
}
},
{
"uid": "transcode_task",
"kind": "transcode",
"payload": {
"location": {
"storage_provider": "s3",
"path": "s3://my_other_bucket/my_output_folder",
"access": {
"credentials_key": "my_other_aws_creds"
}
},
"targets": [
]
}
}
],
"connections": [
]
}
}

by_sec_in_out

You can trim by defining the input and output seconds.

NameTypeDescription
inpoint_secnumberStart the trimmed section at this point in the source.
outpoint_secnumberEnd the trimmed section at this point in the source.
precisionenum                          
sample
frame
Whether to trim at audio-sample boundaries or at video-frame boundaries
sequence_timingenum                          
relative
absolute
Whether the specified in- and out-values are relative to the start of the source at 0 seconds, or absolute based on timecode of the source.

Example by_sec_in_out

{
"uid": "source_file",
"kind": "source",
"payload": {
"kind": "asset_url",
"payload": {
"storage_provider": "s3",
"url": "s3://my_bucket/my_input_folder/my_file.mp4",
"trim": {
"inpoint_sec": 600,
"outpoint_sec": 720
}
}
}
}

by_sec_in_dur

You can trim by defining the start point and duration in seconds.

NameTypeDescription
inpoint_secnumberStart the trimmed section at this point in the source.
duration_secnumberSet the duration in seconds of the trimmed section.

Example by_sec_in_dur

{
"uid": "source_file",
"kind": "source",
"payload": {
"kind": "asset_url",
"payload": {
"storage_provider": "s3",
"url": "s3://my_bucket/my_input_folder/my_file.mp4",
"trim": {
"inpoint_sec": 600,
"duration": 120
}
}
}
}

by_timecode

You can trim by defining the inpoint and outpoint in timecode.

NameTypeDescription
inpoint_tcstringStart the trimmed section at this point in the source.
default: 00:00:00:00
outpoint_tcstringEnd the trimmed section at this point in the source.

Example by_timecode

{
"uid": "source_file",
"kind": "source",
"payload": {
"kind": "asset_url",
"payload": {
"storage_provider": "s3",
"url": "s3://my_bucket/my_input_folder/my_file.mp4",
"trim": {
"inpoint_tc": "00:14:00:23",
"outpoint_tc": "00:18:34:12"
}
}
}
}

by_asset_timecode

You can trim by defining the inpoint and outpoint in timecode with control over which timecode to use as a reference.

NameTypeDescription
inpoint_asset_tcstringThe timecode of the inpoint.
default: 00:00:00:00
outpoint_asset_tcstringThe timecode of the outpoint.
source_timecode_selectorenum                          
first
highest
lowest
mxf
gop
sdti
smpte
material_package
source_package
The location of the timecode data to be used.
default: first
timecode_formatenum                          
df
ndf
auto
Whether to use drop-frame or non-drop-frame timecode.

Example by_asset_timecode

{
"uid": "source_file",
"kind": "source",
"payload": {
"kind": "asset_url",
"payload": {
"storage_provider": "s3",
"url": "s3://my_bucket/my_input_folder/my_file.mp4",
"trim": {
"source_timecode_selector": "mxf",
"inpoint_asset_tc": "00:14:00:23",
"outpoint_asset_tc": "00:18:34:12"
}
}
}
}

by_frame_nr

You can trim by defining the inpoint and outpoint in frames.

NameTypeDescription
inpoint_frameintegerThe inpoint frame number.
outpoint_frameintegerThe outpoint frame number.

Example by_frame_nr

{
"uid": "source_file",
"kind": "source",
"payload": {
"kind": "asset_url",
"payload": {
"storage_provider": "s3",
"url": "s3://my_bucket/my_input_folder/my_file.mp4",
"trim": {
"inpoint_frame": 1239,
"outpoint_frame": 2572
}
}
}
}

by_section_nr

You can trim by defining the inpoint and outpoint based on the section, where each section is an element in a complex source.

NameTypeDescription
start_sectionintegerThe inpoint section.
end_sectionintegerThe outpoint section.

Example by_section_nr

{
"uid": "source_file",
"kind": "source",
"payload": {
"kind": "asset_url",
"payload": {
"storage_provider": "s3",
"url": "s3://my_bucket/my_input_folder/my_file.mp4",
"trim": {
"start_section": 4,
"end_section": 12
}
}
}
}

by_media_track

You can trim by defining the inpoint and outpoint and specifying which media track will be the reference point.

NameTypeDescription
inpointenum                          
track_begin
reference_track_begin
How to interpret the start point.
inpoint_secnumberThe inpoint in seconds.
inpoint_frameintegerThe inpoint in frames.
inpoint_tcstringThe inpoint in timecode
default: 00:00:00:00
reference_media_trackenum                          
video
audio
Which track to use as reference.

Example by_media_track

{
"uid": "source_file",
"kind": "source",
"payload": {
"kind": "asset_url",
"payload": {
"storage_provider": "s3",
"url": "s3://my_bucket/my_input_folder/my_file.mp4",
"trim": {
"inpoint_sec": 362,
"reference_media_track": "audio"
}
}
}
}