Skip to content

Discord

currentMigrated from docs/utilities/Discord.mdx at 37c3317fd058; modified for Encode Wiki · CC BY-SA 4.0

Discord plays uploaded videos inline using each viewer’s own app or browser, so a video has to fit the upload limit and use a format every recipient’s client can decode.

From Discord’s File Attachments FAQ:

AccountLimit
Free20 MB (raised from 10 MB in August 2026)
Nitro Basic50 MB
NitroUp to 1 GB

Boosted servers raise the limit for everyone in them (50 MB at level 2, 100 MB at level 3), and Discord is experimenting with larger limits, so check what your client shows. The limit applies to the file as you select it: the mobile apps now check the size before compressing, as desktop always has.

Discord’s FAQ lists MP4 with H.264, HEVC or AV1 for video.

  • H.264 + AAC in MP4 plays on every client. Use it when you do not know who will watch.
  • AV1 looks much better at the same small size, which matters at 20 MB. Older iPhones and iPads, which only decode AV1 in hardware, may not play it.
  • HEVC plays only where the viewer’s device and browser have HEVC support, which often means hardware decoding; avoid it for general sharing. If you do use it, add -tag:v hvc1 so Apple devices recognise the stream.

Use 8-bit 4:2:0 (-pix_fmt yuv420p) for H.264; browsers and phones generally cannot decode 10-bit or 4:4:4 H.264. Convert HDR sources to SDR first unless you know your viewers have HDR displays (see Preserve colour and HDR).

Work out the bitrate the file can afford:

total kbit/s = size in MB × 8000 ÷ duration in seconds
video kbit/s = total − audio bitrate − a few percent for overhead

For a 60-second clip under 20 MB: 20 × 8000 ÷ 60 ≈ 2,666 kbit/s in total, so about 2,450 kbit/s for video with 128 kbit/s audio. Two-pass encoding lands close to the target:

Terminal window
ffmpeg -i input.mkv -c:v libx264 -preset slow -b:v 2450k -pix_fmt yuv420p -pass 1 -an -f null -
ffmpeg -i input.mkv -c:v libx264 -preset slow -b:v 2450k -pix_fmt yuv420p -pass 2 -c:a aac -b:a 128k -movflags +faststart output.mp4

Both passes need the same video options. -movflags +faststart puts the MP4 index at the front so playback can start before the whole file has loaded. If the bitrate comes out very low for the resolution, downscale (for example -vf scale=-2:720) or trim the clip; a sharp 720p video looks better than a blocky 1080p one.

CRF modes cannot promise a size. Single-pass bitrate modes, such as SVT-AV1’s, can overshoot by several percent, so leave more margin. Autocompressor does this calculation for you if you would rather not.