mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-03 22:03:49 +02:00
Add support for HEVC in Annex B, fix HEVC codec string extraction logic
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import { extractAvcDecoderConfigurationRecord } from '../avc';
|
||||
import {
|
||||
extractAvcDecoderConfigurationRecord,
|
||||
extractHevcDecoderConfigurationRecord,
|
||||
serializeHevcDecoderConfigurationRecord,
|
||||
} from '../avc';
|
||||
import {
|
||||
AacCodecInfo,
|
||||
AudioCodec,
|
||||
@@ -1552,7 +1556,9 @@ class MatroskaVideoTrackBacking extends MatroskaTrackBacking implements InputVid
|
||||
= this.internalTrack.info.codec === 'vp9'
|
||||
|| this.internalTrack.info.codec === 'av1'
|
||||
// Packets are in Annex B format:
|
||||
|| (this.internalTrack.info.codec === 'avc' && !this.internalTrack.info.codecDescription);
|
||||
|| (this.internalTrack.info.codec === 'avc' && !this.internalTrack.info.codecDescription)
|
||||
// Packets are in Annex B format:
|
||||
|| (this.internalTrack.info.codec === 'hevc' && !this.internalTrack.info.codecDescription);
|
||||
|
||||
if (needsPacketForAdditionalInfo) {
|
||||
firstPacket = await this.getFirstPacket({});
|
||||
@@ -1568,6 +1574,9 @@ class MatroskaVideoTrackBacking extends MatroskaTrackBacking implements InputVid
|
||||
avcCodecInfo: this.internalTrack.info.codec === 'avc' && firstPacket
|
||||
? extractAvcDecoderConfigurationRecord(firstPacket.data)
|
||||
: null,
|
||||
hevcCodecInfo: this.internalTrack.info.codec === 'hevc' && firstPacket
|
||||
? extractHevcDecoderConfigurationRecord(firstPacket.data)
|
||||
: null,
|
||||
vp9CodecInfo: this.internalTrack.info.codec === 'vp9' && firstPacket
|
||||
? extractVp9CodecInfoFromFrame(firstPacket.data)
|
||||
: null,
|
||||
|
||||
Reference in New Issue
Block a user