Change H265 codec from hev1 to hvc1 for iOS compatibility by mainavinhoon · Pull Request #290 · bluenviron/mediacommon (original) (raw)
Description
Changes the H.265/HEVC codec box type from hev1 to hvc1 for better compatibility with iOS devices.
Problem
Currently, MediaMTX recordings using H.265/HEVC codec use the hev1 variant, which is not compatible with iOS/Safari. iOS requires the hvc1 variant for HEVC playback.
Solution
- Modified
internal/mp4/codec_boxes.goto usehvc1box type instead ofhev1 - This change uses
amp4.BoxTypeHvc1()for the H.265 codec
Benefits
- ✅ Enables playback on iOS devices (iPhone, iPad)
- ✅ Enables playback in Safari browser
- ✅ Maintains compatibility with Android devices
- ✅ Maintains compatibility with other modern browsers
- ✅
hvc1is the industry standard and more widely supported
Compatibility
Both hvc1 and hev1 are valid H.265/HEVC variants:
hev1: Parameter sets stored in-band (within stream)hvc1: Parameter sets stored out-of-band (in container) - required by iOS
Modern decoders support both variants. hvc1 is preferred as it's more efficient and widely compatible.
Related Issues
This fixes playback issues on iOS devices when using MediaMTX for recording H.265 streams.