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.
Name | Type | Description |
---|---|---|
inpoint_sec | number | Start the trimmed section at this point in the source. |
outpoint_sec | number | End the trimmed section at this point in the source. |
precision | enum sample frame | Whether to trim at audio-sample boundaries or at video-frame boundaries |
sequence_timing | enum 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.
Name | Type | Description |
---|---|---|
inpoint_sec | number | Start the trimmed section at this point in the source. |
duration_sec | number | Set 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.
Name | Type | Description |
---|---|---|
inpoint_tc | string | Start the trimmed section at this point in the source. default: 00:00:00:00 |
outpoint_tc | string | End 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.
Name | Type | Description |
---|---|---|
inpoint_asset_tc | string | The timecode of the inpoint. default: 00:00:00:00 |
outpoint_asset_tc | string | The timecode of the outpoint. |
source_timecode_selector | enum first highest lowest mxf gop sdti smpte material_package source_package | The location of the timecode data to be used. default: first |
timecode_format | enum 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.
Name | Type | Description |
---|---|---|
inpoint_frame | integer | The inpoint frame number. |
outpoint_frame | integer | The 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.
Name | Type | Description |
---|---|---|
start_section | integer | The inpoint section. |
end_section | integer | The 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.
Name | Type | Description |
---|---|---|
inpoint | enum track_begin reference_track_begin | How to interpret the start point. |
inpoint_sec | number | The inpoint in seconds. |
inpoint_frame | integer | The inpoint in frames. |
inpoint_tc | string | The inpoint in timecode default: 00:00:00:00 |
reference_media_track | enum 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"
}
}
}
}