New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mp4-muxer

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mp4-muxer - npm Package Compare versions

Comparing version 2.1.4 to 2.2.0

4

build/mp4-muxer.d.ts

@@ -17,3 +17,3 @@ /**

*/
codec: 'avc' | 'hevc',
codec: 'avc' | 'hevc' | 'vp9' | 'av1',
/**

@@ -36,3 +36,3 @@ * The width of the video, in pixels.

*/
codec: 'aac',
codec: 'aac' | 'opus',
/**

@@ -39,0 +39,0 @@ * The number of audio channels in the audio track.

@@ -322,12 +322,10 @@ "use strict";

track.info.type === "video" ? videoSampleDescription(
track.info.codec === "avc" ? "avc1" : "hvc1",
track,
track.info.codec === "avc" ? avcC(track) : hvcC(track)
VIDEO_CODEC_TO_BOX_NAME[track.info.codec],
track
) : soundSampleDescription(
"mp4a",
track,
esds(track)
AUDIO_CODEC_TO_BOX_NAME[track.info.codec],
track
)
]);
var videoSampleDescription = (compressionType, track, child) => box(compressionType, [
var videoSampleDescription = (compressionType, track) => box(compressionType, [
Array(6).fill(0),

@@ -362,7 +360,9 @@ // Reserved

], [
child
VIDEO_CODEC_TO_CONFIGURATION_BOX[track.info.codec](track)
]);
var avcC = (track) => track.codecPrivate && box("avcC", [...track.codecPrivate]);
var hvcC = (track) => track.codecPrivate && box("hvcC", [...track.codecPrivate]);
var soundSampleDescription = (compressionType, track, child) => box(compressionType, [
var vpcC = (track) => track.codecPrivate && box("vpcC", [...track.codecPrivate]);
var av1C = (track) => track.codecPrivate && box("av1C", [...track.codecPrivate]);
var soundSampleDescription = (compressionType, track) => box(compressionType, [
Array(6).fill(0),

@@ -389,3 +389,3 @@ // Reserved

], [
child
AUDIO_CODEC_TO_CONFIGURATION_BOX[track.info.codec](track)
]);

@@ -428,2 +428,16 @@ var esds = (track) => fullBox("esds", 0, 0, [

]);
var dOps = (track) => box("dOps", [
u8(0),
// Version
u8(track.info.numberOfChannels),
// OutputChannelCount
u16(3840),
// PreSkip, should be at least 80 milliseconds worth of playback, measured in 48000 Hz samples
u32(track.info.sampleRate),
// InputSampleRate
fixed16(0),
// OutputGain
u8(0)
// ChannelMappingFamily
]);
var stts = (track) => {

@@ -492,2 +506,22 @@ return fullBox("stts", 0, 0, [

};
var VIDEO_CODEC_TO_BOX_NAME = {
"avc": "avc1",
"hevc": "hvc1",
"vp9": "vp09",
"av1": "av01"
};
var VIDEO_CODEC_TO_CONFIGURATION_BOX = {
"avc": avcC,
"hevc": hvcC,
"vp9": vpcC,
"av1": av1C
};
var AUDIO_CODEC_TO_BOX_NAME = {
"aac": "mp4a",
"opus": "opus"
};
var AUDIO_CODEC_TO_CONFIGURATION_BOX = {
"aac": esds,
"opus": dOps
};

@@ -810,6 +844,6 @@ // src/target.ts

var GLOBAL_TIMESCALE = 1e3;
var SUPPORTED_VIDEO_CODECS2 = ["avc", "hevc", "vp9", "av1"];
var SUPPORTED_AUDIO_CODECS2 = ["aac", "opus"];
var TIMESTAMP_OFFSET = 2082844800;
var MAX_CHUNK_DURATION = 0.5;
var SUPPORTED_VIDEO_CODECS = ["avc", "hevc"];
var SUPPORTED_AUDIO_CODECS = ["aac"];
var FIRST_TIMESTAMP_BEHAVIORS = ["strict", "offset"];

@@ -902,6 +936,6 @@ var _options, _writer, _mdat, _videoTrack, _audioTrack, _creationTime, _finalized, _validateOptions, validateOptions_fn, _writeHeader, writeHeader_fn, _prepareTracks, prepareTracks_fn, _generateMpeg4AudioSpecificConfig, generateMpeg4AudioSpecificConfig_fn, _addSampleToTrack, addSampleToTrack_fn, _validateTimestamp, validateTimestamp_fn, _writeCurrentChunk, writeCurrentChunk_fn, _maybeFlushStreamingTargetWriter, maybeFlushStreamingTargetWriter_fn, _ensureNotFinalized, ensureNotFinalized_fn;

validateOptions_fn = function(options) {
if (options.video && !SUPPORTED_VIDEO_CODECS.includes(options.video.codec)) {
if (options.video && !SUPPORTED_VIDEO_CODECS2.includes(options.video.codec)) {
throw new Error(`Unsupported video codec: ${options.video.codec}`);
}
if (options.audio && !SUPPORTED_AUDIO_CODECS.includes(options.audio.codec)) {
if (options.audio && !SUPPORTED_AUDIO_CODECS2.includes(options.audio.codec)) {
throw new Error(`Unsupported audio codec: ${options.audio.codec}`);

@@ -908,0 +942,0 @@ }

{
"name": "mp4-muxer",
"version": "2.1.4",
"version": "2.2.0",
"description": "MP4 multiplexer in pure TypeScript with support for WebCodecs API, video & audio.",

@@ -5,0 +5,0 @@ "main": "./build/mp4-muxer.js",

@@ -87,3 +87,3 @@ # mp4-muxer - JavaScript MP4 multiplexer

video?: {
codec: 'avc' | 'hevc',
codec: 'avc' | 'hevc' | 'vp9' | 'av1',
width: number,

@@ -94,3 +94,3 @@ height: number

audio?: {
codec: 'aac',
codec: 'aac' | 'opus',
numberOfChannels: number,

@@ -103,3 +103,3 @@ sampleRate: number

```
Codecs currently supported by this library are AVC/H.264 and HEVC/H.265 for video, and AAC for audio.
Codecs currently supported by this library are AVC/H.264, HEVC/H.265, VP1 and AV1 for video, and AAC and Opus for audio.
#### `target`

@@ -106,0 +106,0 @@ This option specifies where the data created by the muxer will be written. The options are:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc