diff --git a/MP42/MP42AVFImporter.m b/MP42/MP42AVFImporter.m index 15e8019..6199e5a 100644 --- a/MP42/MP42AVFImporter.m +++ b/MP42/MP42AVFImporter.m @@ -58,6 +58,10 @@ case kCMVideoCodecType_H264: result = MP42VideoFormatH264; break; + case 'hev1': + case kCMVideoCodecType_HEVC: + result = MP42VideoFormatH265; + break; case kCMVideoCodecType_MPEG4Video: result = MP42VideoFormatMPEG4Visual; break; diff --git a/MP42/MP42Muxer.m b/MP42/MP42Muxer.m index 8a2e190..3e77231 100644 --- a/MP42/MP42Muxer.m +++ b/MP42/MP42Muxer.m @@ -116,7 +116,7 @@ // H.264 video track if ([track isMemberOfClass:[MP42VideoTrack class]] && [track.format isEqualToString:MP42VideoFormatH264]) { - if ([magicCookie length] < sizeof(uint8_t) * 6) { + if (magicCookie.length < sizeof(uint8_t) * 6) { continue; } @@ -168,6 +168,19 @@ [helper->importer setActiveTrack:track]; } + // H.265 video track + else if ([track isMemberOfClass:[MP42VideoTrack class]] && [track.format isEqualToString:MP42VideoFormatH265]) { + + if (magicCookie.length < sizeof(uint8_t) * 6) { + continue; + } + + //NSSize size = [helper->importer sizeForTrack:track]; + //uint8_t *hvCCAtom = (uint8_t *)magicCookie.bytes; + + NSAssert(NO, @"H.265 muxing not implemented yet"); + } + // MPEG-4 Visual video track else if ([track isMemberOfClass:[MP42VideoTrack class]] && [track.format isEqualToString:MP42VideoFormatMPEG4Visual]) { MP4SetVideoProfileLevel(_fileHandle, MPEG4_SP_L3);