Prompt
Why are my encoded videos not playing on Safari after transcoding?
Latest observation
Safari is usually picky about both the video codec and the container/encoding settings. If transcoded videos won’t play in Safari, the most common reasons are:
1) Wrong codec
Safari supports these best:
- H.264/AVC for video
- AAC for audio
- Container: MP4 or MOV
If your transcoded file uses something like:
- H.265/HEVC (sometimes supported, but not universally)
- VP9
- AV1
- Opus audio in MP4/WebM
Safari may refuse to play it.
2) MP4 not optimized for streaming
Even if it’s H.264/AAC, Safari may have trouble if the MP4 isn’t “fast start” optimized.
The moov atom should be at the beginning of the file so playback can start before the full file is downloaded.
A fix is often:
-movflags +faststart
3) Pixel format not compatible
Safari can be sensitive to pixel format. Use:
- yuv420p
Some encoders produce yuv444p or other formats that won’t play everywhere.
4) Unsupported profile/level settings
Safari may reject files encoded with unusual H.264 profiles/levels. Safe choices are often:
- Baseline, Main, or High profile
- Reasonable level for the resolution/framerate
5) Audio issues
Sometimes the video is fine but Safari won’t play because audio is encoded in an unsupported format or with unusual channel/sample settings.
Use:
- AAC-LC
- 44.1 kHz or 48 kHz
6) File server / MIME type issues
If you’re serving the video from a web server, Safari may fail if the HTTP headers are wrong. Make sure:
Content-Type: video/mp4- Byte-range requests are supported
- The file isn’t blocked by CORS, auth, or incorrect caching headers
7) Corrupted/transcoding output
The transcode may have succeeded structurally but still be invalid. Check with:
ffprobe- Play the file locally in QuickTime
- Verify codecs, pixel format, and container
A Safari-friendly ffmpeg example
ffmpeg -i input.mov \
-c:v libx264 -profile:v high -pix_fmt yuv420p \
-c:a aac -b:a 128k \
-movflags +faststart \
output.mp4
What to check first
If you want the fastest diagnosis, inspect the output with:
ffprobe output.mp4
Look for:
codec_name=h264codec_name=aacpix_fmt=yuv420p- container =
mov,mp4,m4a,3gp,3g2,mj2
If you want, paste your ffmpeg command or ffprobe output, and I can tell you exactly why Safari is rejecting it.