FFmpeg Cookbook

X (Twitter) Video Compressor & Compliance Checker

Auto-check X's official video requirements and fix only what's failing — minimal re-encode, lossless when possible.

Local processing only — your file never leaves the browser
📋 X video requirements (non-Premium posts)
🐦
Drag & drop a video, or tap to select
MP4 / MOV / MKV / WebM, up to 500 MB
🎬

X compliance check

Duration (≤ 140s)
File size (≤ 512MB)
Video codec
Pixel format
Audio codec
Frame rate (≤ 60fps)
Processing… 0%

Useful next tools

Popular uses
Auto-check X (Twitter) post complianceHEVC/HDR yuv420p conversionCap videos above 60fps

What this tool does

  • Auto-check all 6 X video requirements (duration, size, codec, pix_fmt, audio, fps)
  • Highlights violations clearly so you can see what is wrong at a glance
  • Fixes only what is failing — already-compliant items are stream-copied
  • Back-calculates video bitrate from duration when size exceeds 512MB (0.95 safety factor)
  • Outputs H.264 High Profile + yuv420p + AAC LC 128k + faststart
  • Duration > 140s is flagged as not auto-fixable, with a clear link to the Trim tool

How to use

  1. 1

    Add your video

    Drop a video (up to 500 MB) or pick one from your device.

  2. 2

    Run compliance check

    All 6 X requirements are checked at once. Violations show an auto-fix plan.

  3. 3

    Trim first if duration is over

    Over 140s cannot be auto-fixed. Use the Trim tool, then come back.

  4. 4

    Make X-ready & download

    The tool applies only the necessary fixes and produces an X-ready MP4.

What each setting means

Duration (≤ 140s)
Non-Premium X posts are capped at 140 seconds (2:20). Over the limit means the post is rejected. Not auto-fixable here — use the Trim tool.
Size (≤ 512MB)
X's video file cap is 512MB. When exceeded, video bitrate is back-calculated from duration so the output stays under 512MB.
Video codec
X officially recommends H.264 High Profile. HEVC / VP9 / AV1 are re-encoded with libx264.
Pixel format (yuv420p)
X accepts only 4:2:0 8-bit (yuv420p). 10-bit / 4:2:2 / 4:4:4 are rejected as-is and will be converted.
Audio codec (AAC LC)
X recommends AAC LC (Low Complexity). HE-AAC / Opus / MP3 / PCM are converted to AAC LC.
Frame rate (≤ 60fps)
Above 60fps is outside the spec. The fps filter caps it at 60fps.

Recommended settings

Post a 4K HDR phone video to X
Compliance check → Auto-fix (H.264 / yuv420p / bitrate back-calc to 512MB)
10-bit HDR is rejected by X. The tool transcodes only what is required.
Post iPhone HEVC (H.265) videos
Compliance check → Auto-fix (transcode to H.264)
X requires H.264. HEVC will fail to upload.
Cut a long video down for X
Trim to ≤140s first → run this tool
X strictly enforces 140s. The Trim+Compliance flow is the reliable path.
120fps iPhone slow-motion
Compliance check → Auto-fix (cap at 60fps)
Above 60fps is out of spec. The fps filter conforms it to 60fps.
Already H.264 + AAC under 512MB
Compliance check → Auto-fix (faststart only)
If all checks pass, no re-encode is needed — just a faststart-wrapped MP4.

Common pitfalls

Symptom: "Media file could not be processed" on X

Cause: Even a single failing requirement (pix_fmt, codec, bitrate, audio profile) causes rejection.

Fix: Run the compliance check first to see which item is failing, then auto-fix.

Symptom: Duration shows 141.0s and X rejects it

Cause: Sub-second rounding. X caps at exactly 140.0s.

Fix: Trim to about 139s to leave a safety margin.

Symptom: Output still exceeds 512MB

Cause: Very long input pushed bitrate calc to the floor.

Fix: Lower resolution (720p / 540p) or trim the duration shorter.

Symptom: X Premium accounts have different limits — does this still apply?

Cause: X Premium supports up to 3 hours / 8GB videos.

Fix: This tool targets non-Premium (140s / 512MB). For Premium, use the general compress tool.

Symptom: Colors look off after conversion

Cause: HDR → SDR tone mapping is a separate concern.

Fix: This tool converts pix_fmt but does not tone-map HDR content. Use a dedicated color tool.

Equivalent FFmpeg commands

Reference commands you can run on the desktop FFmpeg CLI.

Full conversion to X spec (targeting 512MB)
ffmpeg -i input.mp4 -map 0:v:0? -map 0:a:0? -c:v libx264 -preset veryfast -profile:v high -pix_fmt yuv420p -b:v 4500k -maxrate 4950k -bufsize 9000k -c:a aac -b:a 128k -profile:a aac_low -movflags +faststart output.mp4
Bitrate sized for a 60-second 512MB target.
pix_fmt only (HDR → 8-bit)
ffmpeg -i input.mp4 -map 0:v:0? -map 0:a:0? -c:v libx264 -preset veryfast -profile:v high -pix_fmt yuv420p -c:a copy -movflags +faststart output.mp4
Video re-encoded, audio copied.
Cap at 60fps
ffmpeg -i input.mp4 -map 0:v:0? -map 0:a:0? -vf "fps=60" -c:v libx264 -preset veryfast -profile:v high -pix_fmt yuv420p -crf 23 -c:a copy -movflags +faststart output.mp4
Trim first (duration over)
ffmpeg -i input.mp4 -t 139 -c copy output_trimmed.mp4
Safety margin at 139s; then run this tool.

Browser support & limits

  • Max input size: 500MB (browser-only processing)
  • Duration > 140s is not auto-fixable (trim first)
  • X Premium long-form videos (3 hours / 8GB) are not targeted here
  • HDR → SDR tone mapping (color correction) is out of scope

Privacy

This tool runs ffmpeg.wasm directly in your browser. Files never leave your device — everything runs locally. Read the privacy policy →

Frequently asked questions

Where are X's video requirements documented?

In the X (Twitter) Help Center and X API Documentation media upload best practices. This tool implements those requirements.

What about Premium (formerly Blue)?

Premium supports long videos up to 3 hours / 8GB. This tool is optimized for non-Premium (140s / 512MB). For Premium, use the general compress tool.

Why H.264 High Profile specifically?

X officially supports it best. Main and Baseline often pass too, but High is the most stable target.

Is 10-bit / 12-bit pix_fmt really rejected?

Yes. X accepts only 8-bit yuv420p. iPhone HDR (yuv420p10le) is rejected as-is.

Doesn't HE-AAC sometimes work?

It can pass in some environments, but X officially recommends AAC LC. HE-AAC can cause playback issues, so this tool transcodes to LC.

Does capping fps to 60 hurt quality?

The fps filter drops frames temporally. Sports / gameplay clips can look less smooth, but it is required for X.

Is my file uploaded?

No. All processing runs locally in your browser; the file is not sent externally.

Related tools

In depth: context unique to this tool

How X's upload pipeline actually rejects your video

When you tap 'Tweet' with a video attached, X's pipeline runs six parallel checks the moment the file lands on its servers: (1) file size (non-Premium 512 MB, Premium 8 GB), (2) duration (non-Premium 140s, Premium 3h), (3) video codec (must be H.264 High Profile — HEVC, VP9, AV1 are rejected), (4) pixel format (4:2:0 8-bit yuv420p only — 10-bit HDR is rejected), (5) audio codec (AAC LC — HE-AAC, Opus, MP3 are commonly rejected), (6) frame rate (≤ 60 fps).

Any one violation causes the upload to fail, but X's UI returns a generic "Your media file could not be processed" message that gives zero hints about which check failed. The preflight checker here verifies all six locally before you upload, so the "I keep retrying and it keeps failing" loop ends.

Why X only accepts H.264 High Profile + yuv420p

X's video pipeline limits codec/pixel format choices for a specific reason: timeline videos must preview instantly across a vast matrix of OS, browser, and device combinations. HEVC works on Apple devices but breaks on parts of Android and Windows. VP9 is great on Chrome / Android but problematic on Safari. AV1 is efficient but burns CPU on older hardware. The 'reliable across all combinations' lowest common denominator is H.264 High Profile.

The pix_fmt restriction is even tighter: 10-bit HDR (yuv420p10le, yuv422p10le) fails because of color-space mapping and bandwidth concerns. iPhone Pro models record in HDR by default, which is why so many people get rejected uploading directly from their phone. This tool transcodes pix_fmt violations to 8-bit yuv420p via libx264, so HDR iPhone footage uploads cleanly (note: no tone mapping, so colors may look slightly faded — that's a separate problem).

X Premium changes the rules — strategies for non-Premium users

X Premium (formerly Twitter Blue) loosens video limits dramatically: up to 3 hours (10,800 seconds), up to 8 GB, and long-form videos qualify for revenue sharing. This tool is tuned for non-Premium constraints (140s / 512MB). Premium users uploading long-form should use the [general compress tool](/en/tools/compress/) with custom targets instead — more flexible.

Effective video strategies for non-Premium accounts: (1) Focus on 'highlight' / 'short' content that fits in 140s naturally. (2) Host long-form on YouTube / TikTok and use X for link distribution. (3) Use threaded posts to chain multiple 140s videos into a sequence. This tool directly supports strategy (1): videos that pass the compliance check upload first-try, eliminating the wasted-time loop between recording and posting.