mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-01 04:43:51 +02:00
Support AVC in Annex B format, add AVCDecoderConfigurationRecord extraction logic, add Annex B to AVCC converter, add support for Matroska Clusters with undefined size, & a couple other improvements
This commit is contained in:
@@ -52,6 +52,8 @@ export abstract class OutputFormat {
|
||||
|
||||
/** The file extension used by this output format, beginning with a dot. */
|
||||
abstract get fileExtension(): string;
|
||||
/** The base MIME type of the output format. */
|
||||
abstract get mimeType(): string;
|
||||
/** Returns a list of media codecs that this output format can contain. */
|
||||
abstract getSupportedCodecs(): MediaCodec[];
|
||||
/** Returns the number of tracks that this output format supports. */
|
||||
@@ -227,6 +229,10 @@ export class Mp4OutputFormat extends IsobmffOutputFormat {
|
||||
return '.mp4';
|
||||
}
|
||||
|
||||
get mimeType() {
|
||||
return 'video/mp4';
|
||||
}
|
||||
|
||||
getSupportedCodecs(): MediaCodec[] {
|
||||
return [
|
||||
...VIDEO_CODECS,
|
||||
@@ -259,6 +265,10 @@ export class MovOutputFormat extends IsobmffOutputFormat {
|
||||
return '.mov';
|
||||
}
|
||||
|
||||
get mimeType() {
|
||||
return 'video/quicktime';
|
||||
}
|
||||
|
||||
getSupportedCodecs(): MediaCodec[] {
|
||||
return [
|
||||
...VIDEO_CODECS,
|
||||
@@ -380,6 +390,10 @@ export class MkvOutputFormat extends OutputFormat {
|
||||
return '.mkv';
|
||||
}
|
||||
|
||||
get mimeType() {
|
||||
return 'video/x-matroska';
|
||||
}
|
||||
|
||||
getSupportedCodecs(): MediaCodec[] {
|
||||
return [
|
||||
...VIDEO_CODECS,
|
||||
@@ -423,6 +437,10 @@ export class WebMOutputFormat extends MkvOutputFormat {
|
||||
return '.webm';
|
||||
}
|
||||
|
||||
override get mimeType() {
|
||||
return 'video/webm';
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
override _codecUnsupportedHint(codec: MediaCodec) {
|
||||
if (new MkvOutputFormat().getSupportedCodecs().includes(codec)) {
|
||||
@@ -491,6 +509,10 @@ export class Mp3OutputFormat extends OutputFormat {
|
||||
return '.mp3';
|
||||
}
|
||||
|
||||
get mimeType() {
|
||||
return 'audio/mpeg';
|
||||
}
|
||||
|
||||
getSupportedCodecs(): MediaCodec[] {
|
||||
return ['mp3'];
|
||||
}
|
||||
@@ -556,6 +578,10 @@ export class WavOutputFormat extends OutputFormat {
|
||||
return '.wav';
|
||||
}
|
||||
|
||||
get mimeType() {
|
||||
return 'audio/wav';
|
||||
}
|
||||
|
||||
getSupportedCodecs(): MediaCodec[] {
|
||||
return [
|
||||
...PCM_AUDIO_CODECS.filter(codec =>
|
||||
@@ -628,6 +654,10 @@ export class OggOutputFormat extends OutputFormat {
|
||||
return '.ogg';
|
||||
}
|
||||
|
||||
get mimeType() {
|
||||
return 'application/ogg';
|
||||
}
|
||||
|
||||
getSupportedCodecs(): MediaCodec[] {
|
||||
return [
|
||||
...AUDIO_CODECS.filter(codec => ['vorbis', 'opus'].includes(codec)),
|
||||
|
||||
Reference in New Issue
Block a user