Fix HEVC from mp4.
This commit is contained in:
1 parent
ee6a471bf2
commit
2fcf67f7f6
2 files changed
+17
-2
No files matched your search
@@ -237,6 +237,14 @@
|
|||||||
free(ppValue);
|
free(ppValue);
|
||||||
return magicCookie;
|
return magicCookie;
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(media_data_name, "hvc1")) {
|
||||||
|
uint8_t *ppValue;
|
||||||
|
uint32_t pValueSize;
|
||||||
|
MP4GetTrackBytesProperty(_fileHandle, srcTrackId, "mdia.minf.stbl.stsd.hvc1.hvcC.content", &ppValue, &pValueSize);
|
||||||
|
magicCookie = [NSData dataWithBytes:ppValue length:pValueSize];
|
||||||
|
free(ppValue);
|
||||||
|
return magicCookie;
|
||||||
|
}
|
||||||
else if (!strcmp(media_data_name, "mp4v")) {
|
else if (!strcmp(media_data_name, "mp4v")) {
|
||||||
uint8_t *ppConfig; uint32_t pConfigSize;
|
uint8_t *ppConfig; uint32_t pConfigSize;
|
||||||
MP4GetTrackESConfiguration(_fileHandle, srcTrackId, &ppConfig, &pConfigSize);
|
MP4GetTrackESConfiguration(_fileHandle, srcTrackId, &ppConfig, &pConfigSize);
|
||||||
|
|||||||
+9
-2
@@ -135,6 +135,7 @@
|
|||||||
if ([track isMemberOfClass:[MP42VideoTrack class]] && track.format == kMP42VideoCodecType_H264) {
|
if ([track isMemberOfClass:[MP42VideoTrack class]] && track.format == kMP42VideoCodecType_H264) {
|
||||||
|
|
||||||
if (magicCookie.length < sizeof(uint8_t) * 6) {
|
if (magicCookie.length < sizeof(uint8_t) * 6) {
|
||||||
|
[unsupportedTracks addObject:track];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,10 +208,12 @@
|
|||||||
[helper->importer setActiveTrack:track];
|
[helper->importer setActiveTrack:track];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
[unsupportedTracks addObject:track];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
[unsupportedTracks addObject:track];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -260,8 +263,10 @@
|
|||||||
|
|
||||||
// AC-3 audio track
|
// AC-3 audio track
|
||||||
else if ([track isMemberOfClass:[MP42AudioTrack class]] && track.format == kMP42AudioCodecType_AC3) {
|
else if ([track isMemberOfClass:[MP42AudioTrack class]] && track.format == kMP42AudioCodecType_AC3) {
|
||||||
if ([magicCookie length] < sizeof(uint64_t) * 6)
|
if (magicCookie.length < sizeof(uint64_t) * 6) {
|
||||||
|
[unsupportedTracks addObject:track];
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const uint64_t *ac3Info = (const uint64_t *)[magicCookie bytes];
|
const uint64_t *ac3Info = (const uint64_t *)[magicCookie bytes];
|
||||||
|
|
||||||
@@ -399,8 +404,10 @@
|
|||||||
|
|
||||||
// VobSub bitmap track
|
// VobSub bitmap track
|
||||||
else if ([track isMemberOfClass:[MP42SubtitleTrack class]] && track.format == kMP42SubtitleCodecType_VobSub) {
|
else if ([track isMemberOfClass:[MP42SubtitleTrack class]] && track.format == kMP42SubtitleCodecType_VobSub) {
|
||||||
if (magicCookie.length < sizeof(uint32_t) * 16)
|
if (magicCookie.length < sizeof(uint32_t) * 16) {
|
||||||
|
[unsupportedTracks addObject:track];
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
dstTrackId = MP4AddSubpicTrack(_fileHandle, timeScale, 640, 480);
|
dstTrackId = MP4AddSubpicTrack(_fileHandle, timeScale, 640, 480);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user