TikTok API video codecs: H.264, H.265, VP8, VP9 and Video trim modes

TikTok lists H.264, H.265, VP8 and VP9 for API uploads. Sume's exact trim re-encodes to libx264 yuv420p; keyframe trim copies the source stream unchanged.

5 min readSume
All posts

TikTok's Media Transfer Guide lists H.264 (recommended), H.265, VP8 and VP9 as supported video codecs for the Content Posting API. If you cut a clip with Sume's Video trim in its default exact mode, the output is a libx264 yuv420p MP4, which is H.264 and sits inside the recommended path. Keyframe mode copies the stream, so it keeps whatever codec the source had.

Which codecs and containers does TikTok list?

The Media Transfer Guide names MP4 as recommended with WebM and MOV also supported, and H.264 as the recommended codec with H.265, VP8 and VP9 also listed. It gives a frame rate of 23-60 FPS and a 360-4096 pixel resolution range in the same spec.

The page does not tell you which codec the recommendation algorithm prefers, and it does not give audio codec rules in the part read here, so this post makes no claim on either.

TikTok listed codecs and what Sume Video trim writes, read 2026-10-02
CodecListed by TikTokSume Video trim
H.264RecommendedExact mode writes libx264 yuv420p
H.265ListedOnly if the source is H.265 and you use keyframe mode
VP8ListedOnly if the source is VP8 and you use keyframe mode
VP9ListedOnly if the source is VP9 and you use keyframe mode

What does exact mode do to the codec?

Per the Video trim docs, precision: "exact" is the default and is a frame-accurate re-encode with libx264 and yuv420p. Kept audio is remuxed as AAC. Exact mode is also the only mode that accepts the output object for width, height and fps.

If your source is a VP9 WebM and you want a TikTok-safe file, one exact trim from 0 to the clip's end gives you an H.264 MP4. That is a re-encode, so it costs the same flat per-job rate as any trim.

curl -X POST https://api.sume.com/v1/video-trim \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: tiktok-h264-001" \
  -d '{
    "video_url": "https://media.sume.com/artifacts/artf_demo/clip.webm",
    "start": 0,
    "duration": 30,
    "precision": "exact"
  }'

When is keyframe mode the better choice?

precision: "keyframe" is a stream copy. It is faster and does not touch pixels, but the cut may start up to a GOP early, so you re-base against actual_start_seconds in the result. It cannot conform size or frame rate. Use it when the source is already one of TikTok's listed codecs and you only need to shorten it.

Because a keyframe cut can start early, do not use it when the first frame matters, for example a hook that must land at zero.

What does Sume not do?

Sume does not let you choose a codec: a client that sends codec, crf, vf or similar gets ffmpeg_fields_rejected, because the server compiles ffmpeg itself. It also does not post to TikTok. See the MP4, WebM or MOV question for the container side.

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume