Remotion · Troubleshooting

Remotion Codec Compatibility: Why Your Video Won't Play

A source video that plays fine everywhere else can still fail inside a Remotion composition — the renderer's playback engine is more particular than a general media player.

Remotion renders using a headless browser under the hood, which means video playback inside a composition is subject to that browser's supported codecs — narrower than a dedicated media player like VLC, which bundles many more decoders.

The safe target: H.264 + AAC in an MP4 container

This combination is universally supported across every environment Remotion runs in. If a source clip uses a less common codec — certain HEVC variants, older or unusual formats from specific camera models or screen recorders — re-encode it before importing:

ffmpeg -i source.mov -c:v libx264 -crf 18 -c:a aac -b:a 192k clean.mp4

-crf 18 keeps quality close to visually lossless, so this re-encode step doesn't introduce a noticeable quality loss even though it's a full re-encode rather than a stream copy.

Symptoms this specifically explains

  • The video plays in Remotion Studio preview but the render fails, or vice versa — different playback pipelines can handle the same file inconsistently.
  • A "could not play video/audio with src" error referencing a specific file.
  • A render that completes but with a black frame or no audio where that specific clip appears.

Checking a file's actual codec before you re-encode

ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1 input.mov

This prints the exact video codec in use — if it's already h264, the compatibility issue is elsewhere (often the audio codec, or a container-level quirk); if it's something else, re-encoding to H.264 is the direct fix.

Skip the debugging

Codec compatibility is exactly the kind of invisible failure mode a tested template has already been hardened against — one less unknown when you're just trying to get a video out the door.

See the templates

Common questions

Does this affect audio-only files too?+
Yes — the same logic applies to audio codecs. AAC is the safe target for audio, the same way H.264 is for video.
Is there a performance cost to always pre-converting footage to H.264?+
A small one-time re-encoding cost, but it removes an entire category of render-time failures — worth it for any footage from an unfamiliar or unusual source.
Can I check compatibility without re-encoding, just to be sure?+
Yes — ffprobe (shown above) tells you the codec without modifying the file, so you can confirm whether re-encoding is actually necessary before doing it.