Trim an HDR clip: why precision keyframe works and exact does not
Sume video trim refuses HDR sources on the exact re-encode but copies them on keyframe. What each mode keeps, and how to cut an HDR clip without flattening it.

Sume video trim handles an HDR clip differently depending on precision. With precision: "exact" (the default) the job fails with hdr_source_unsupported and next_action: use_precision_keyframe_or_sdr_source. With precision: "keyframe" the cut succeeds, because it is a stream copy.
This is the rule in the trim worker, read 2026-10-05: an exact cut re-encodes to libx264 and yuv420p, an 8-bit SDR pixel format, and that would silently flatten PQ or HLG footage. A keyframe cut copies the compressed stream untouched, so there is nothing to flatten and HDR passes bit-exact.
What you give up with keyframe
A keyframe cut can only start on a keyframe, so the output may begin a GOP early. The result reports actual_start_seconds, and the video trim docs tell you to re-base your later times against it. The output conform object (width, height, fps) is exact-only, so a keyframe cut with output returns video_trim_output_requires_exact.
A safe request for an HDR source
Ask for the copy cut explicitly and read the real start from the result.
curl -X POST https://api.sume.com/v1/video-trim \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: hdr-cut-001" \
-d '{
"video_url": "https://media.sume.com/artifacts/artf_demo/hdr.mp4",
"start": 12,
"duration": 20,
"precision": "keyframe"
}'Choosing between the two
| Mode | HDR source | Start accuracy | Output conform |
|---|---|---|---|
| exact (default) | Refused: hdr_source_unsupported | Frame accurate | Allowed |
| keyframe | Passes, bit-exact copy | Up to one GOP early | Refused |
If the clip is going to a timeline or a filter later, remember both of those stages also need SDR. A keyframe cut keeps HDR for archive or delivery, not for the next Sume stage.
Sources
Related posts
More in Media tools
- Trim or filter on a PNG or audio file: the not-a-video refusal
Sume video trim and video filter refuse a still image or a file with no video stream. The reason codes, the probe fields that predict them, and the right tool.
- True pixel art from an AI image: quantize to 16 colors in Pillow
AI models draw pixel-art looks at full resolution. Downscale with NEAREST, quantize to 16 colors without dither, and upscale clean to get real pixel art.
- Join TTS lines into one track: match output_format before concat
Sume timeline audio concat joins 1 to 20 parts but needs one channel layout. Set the same TTS output_format on every line, then concat once.
- TTS mp3 bit rate: 32k to 192k file size per minute for voice audio
Sume TTS 1.0 accepts mp3 bit_rate 32000, 64000, 96000, 128000 or 192000. See the size per minute of each, plus a two-take listening test before you pick one.
Written by Sume