Skip to main content

VideoTrimJob

Extracts a time range from a video, producing a shorter clip. Go method: Client.VideoTrim(ctx, job)

Parameters

input
string
required
Path to the source video file.
output
string
required
Path for the trimmed output clip.
start
float64
required
Start time of the clip in seconds.
end
float64
required
End time of the clip in seconds.

Example

result, err := client.VideoTrim(ctx, &dpf.VideoTrimJob{
    Input:  "video.mp4",
    Output: "clip.mp4",
    Start:  10.5,  // seconds
    End:    60.0,  // seconds
})
if err != nil {
    log.Fatal(err)
}
log.Printf("Success in %dms", result.ElapsedMs)

VideoThumbnailJob

Extracts a single frame from a video and saves it as an image. Go method: Client.VideoThumbnail(ctx, job)

Parameters

input
string
required
Path to the source video file.
output
string
required
Path for the output image file.
timestamp
string
required
Position in the video from which to extract the frame. Accepts a percentage string such as "25%" or a time in seconds such as "30.5".
format
string
Output image format. Accepted values: jpeg, png, webp. Defaults to the format inferred from the output file extension.
quality
uint8
Image quality for lossy formats (JPEG, WebP). Range: 1100.
Use "25%" as the timestamp to capture a representative frame. The first and last frames of a video are often black or transitional, so a point one quarter into the video tends to be more visually meaningful.

Example

result, err := client.VideoThumbnail(ctx, &dpf.VideoThumbnailJob{
    Input:     "video.mp4",
    Output:    "poster.jpg",
    Timestamp: "25%",   // or "30.5" for seconds
    Format:    "jpeg",  // jpeg, png, webp
    Quality:   func(u uint8) *uint8 { return &u }(85),
})
if err != nil {
    log.Fatal(err)
}
log.Printf("Success in %dms", result.ElapsedMs)

VideoProfileJob

Encodes a video using a predefined web-optimized profile. Profiles handle resolution and bitrate selection automatically. Go method: Client.VideoProfile(ctx, job)

Parameters

input
string
required
Path to the source video file.
output
string
required
Path for the encoded output file.
profile
string
required
Encoding profile to apply. Accepted values: web-low, web-mid, web-high.

Profile specifications

ProfileResolutionBitrateUse case
web-low480p1 MbpsMobile, low-bandwidth connections
web-mid720p2.5 MbpsStandard web streaming
web-high1080p5 MbpsHigh-quality web delivery

Example

result, err := client.VideoProfile(ctx, &dpf.VideoProfileJob{
    Input:   "video.mp4",
    Output:  "output.mp4",
    Profile: "web-mid",  // web-low, web-mid, web-high
})
if err != nil {
    log.Fatal(err)
}
log.Printf("Success in %dms", result.ElapsedMs)

Build docs developers (and LLMs) love