@remotion/media-parser 4.0.252 → 4.0.253
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abort.d.ts +1 -0
- package/dist/abort.js +7 -0
- package/dist/containers/flac/get-channel-count.d.ts +1 -1
- package/dist/containers/iso-base-media/get-keyframes.js +5 -2
- package/dist/containers/iso-base-media/get-moov-atom.js +2 -2
- package/dist/containers/iso-base-media/get-sample-positions-from-track.d.ts +4 -1
- package/dist/containers/iso-base-media/get-sample-positions-from-track.js +7 -3
- package/dist/containers/iso-base-media/mdat/mdat.js +3 -3
- package/dist/containers/iso-base-media/traversal.d.ts +1 -1
- package/dist/containers/iso-base-media/traversal.js +5 -8
- package/dist/containers/webm/av1-codec-private.js +1 -1
- package/dist/controller.d.ts +17 -0
- package/dist/controller.js +31 -0
- package/dist/download-and-parse-media.js +3 -1
- package/dist/emitter.d.ts +20 -0
- package/dist/emitter.js +29 -0
- package/dist/errors.d.ts +4 -0
- package/dist/errors.js +13 -1
- package/dist/esm/from-fetch.mjs +134 -8
- package/dist/esm/from-node.mjs +8 -8
- package/dist/esm/from-web-file.mjs +8 -8
- package/dist/esm/index.mjs +2640 -2490
- package/dist/get-duration.js +5 -2
- package/dist/get-fps.js +3 -0
- package/dist/index.d.ts +9 -7
- package/dist/index.js +7 -1
- package/dist/internal-parse-media.js +17 -7
- package/dist/media-parser-controller.d.ts +17 -0
- package/dist/media-parser-controller.js +31 -0
- package/dist/options.d.ts +4 -1
- package/dist/parse-media.js +3 -1
- package/dist/pause-signal.d.ts +11 -0
- package/dist/pause-signal.js +38 -0
- package/dist/perform-seek.js +3 -2
- package/dist/readers/from-fetch.js +11 -8
- package/dist/readers/from-node.js +8 -8
- package/dist/readers/from-web-file.js +8 -8
- package/dist/readers/reader.d.ts +2 -1
- package/dist/remotion-license-acknowledge.d.ts +6 -0
- package/dist/remotion-license-acknowledge.js +17 -0
- package/dist/state/iso-base-media/cached-sample-positions.d.ts +2 -2
- package/dist/state/iso-base-media/cached-sample-positions.js +12 -6
- package/dist/state/iso-base-media/iso-state.d.ts +2 -2
- package/dist/state/parser-state.d.ts +6 -5
- package/dist/state/parser-state.js +3 -3
- package/dist/state/sample-callbacks.d.ts +3 -2
- package/dist/state/sample-callbacks.js +3 -3
- package/dist/throttled-progress.d.ts +3 -2
- package/dist/throttled-progress.js +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/LICENSE.md +0 -49
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type BufferIterator } from '../buffer-iterator';
|
|
2
2
|
import type { AvcPPs, AvcProfileInfo } from '../containers/avc/parse-avc';
|
|
3
3
|
import { type LogLevel } from '../log';
|
|
4
|
+
import type { MediaParserController } from '../media-parser-controller';
|
|
4
5
|
import type { OnDiscardedData, Options, ParseMediaFields, ParseMediaMode, ParseMediaSrc } from '../options';
|
|
5
6
|
import type { ReaderInterface } from '../readers/reader';
|
|
6
7
|
import type { OnAudioTrack, OnVideoTrack } from '../webcodec-sample-types';
|
|
@@ -12,10 +13,10 @@ export type SpsAndPps = {
|
|
|
12
13
|
sps: AvcProfileInfo;
|
|
13
14
|
pps: AvcPPs;
|
|
14
15
|
};
|
|
15
|
-
export declare const makeParserState: ({ hasAudioTrackHandlers, hasVideoTrackHandlers,
|
|
16
|
+
export declare const makeParserState: ({ hasAudioTrackHandlers, hasVideoTrackHandlers, controller, fields, onAudioTrack, onVideoTrack, contentLength, logLevel, mode, src, readerInterface, onDiscardedData, }: {
|
|
16
17
|
hasAudioTrackHandlers: boolean;
|
|
17
18
|
hasVideoTrackHandlers: boolean;
|
|
18
|
-
|
|
19
|
+
controller: MediaParserController;
|
|
19
20
|
fields: Options<ParseMediaFields>;
|
|
20
21
|
onAudioTrack: OnAudioTrack | null;
|
|
21
22
|
onVideoTrack: OnVideoTrack | null;
|
|
@@ -117,7 +118,7 @@ export declare const makeParserState: ({ hasAudioTrackHandlers, hasVideoTrackHan
|
|
|
117
118
|
};
|
|
118
119
|
getFlacCodecNumber: () => number;
|
|
119
120
|
};
|
|
120
|
-
|
|
121
|
+
controller: MediaParserController;
|
|
121
122
|
mode: ParseMediaMode;
|
|
122
123
|
eventLoop: {
|
|
123
124
|
eventLoopBreakIfNeeded: () => Promise<void>;
|
|
@@ -164,8 +165,8 @@ export declare const makeParserState: ({ hasAudioTrackHandlers, hasVideoTrackHan
|
|
|
164
165
|
};
|
|
165
166
|
iso: {
|
|
166
167
|
flatSamples: {
|
|
167
|
-
getSamples: () => import("./iso-base-media/cached-sample-positions").FlatSample[] | null;
|
|
168
|
-
setSamples: (samples: import("./iso-base-media/cached-sample-positions").FlatSample[]) => void;
|
|
168
|
+
getSamples: (mdatStart: number) => import("./iso-base-media/cached-sample-positions").FlatSample[] | null;
|
|
169
|
+
setSamples: (mdatStart: number, samples: import("./iso-base-media/cached-sample-positions").FlatSample[]) => void;
|
|
169
170
|
};
|
|
170
171
|
moov: {
|
|
171
172
|
setMoovBox: (moov: import("../containers/iso-base-media/moov/moov").MoovBox) => void;
|
|
@@ -18,7 +18,7 @@ const structure_1 = require("./structure");
|
|
|
18
18
|
const transport_stream_1 = require("./transport-stream");
|
|
19
19
|
const video_section_1 = require("./video-section");
|
|
20
20
|
const webm_1 = require("./webm");
|
|
21
|
-
const makeParserState = ({ hasAudioTrackHandlers, hasVideoTrackHandlers,
|
|
21
|
+
const makeParserState = ({ hasAudioTrackHandlers, hasVideoTrackHandlers, controller, fields, onAudioTrack, onVideoTrack, contentLength, logLevel, mode, src, readerInterface, onDiscardedData, }) => {
|
|
22
22
|
let skippedBytes = 0;
|
|
23
23
|
const iterator = (0, buffer_iterator_1.getArrayBufferIterator)(new Uint8Array([]), contentLength);
|
|
24
24
|
const increaseSkippedBytes = (bytes) => {
|
|
@@ -48,7 +48,7 @@ const makeParserState = ({ hasAudioTrackHandlers, hasVideoTrackHandlers, signal,
|
|
|
48
48
|
aac: (0, aac_state_1.aacState)(),
|
|
49
49
|
flac: (0, flac_state_1.flacState)(),
|
|
50
50
|
callbacks: (0, sample_callbacks_1.sampleCallback)({
|
|
51
|
-
|
|
51
|
+
controller,
|
|
52
52
|
hasAudioTrackHandlers,
|
|
53
53
|
hasVideoTrackHandlers,
|
|
54
54
|
fields,
|
|
@@ -78,7 +78,7 @@ const makeParserState = ({ hasAudioTrackHandlers, hasVideoTrackHandlers, signal,
|
|
|
78
78
|
videoSection: (0, video_section_1.videoSectionState)(),
|
|
79
79
|
logLevel,
|
|
80
80
|
iterator,
|
|
81
|
-
|
|
81
|
+
controller,
|
|
82
82
|
mode,
|
|
83
83
|
eventLoop: (0, last_eventloop_break_1.eventLoopState)(logLevel),
|
|
84
84
|
src,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { MediaParserController } from '../media-parser-controller';
|
|
1
2
|
import type { AllOptions, Options, ParseMediaFields } from '../options';
|
|
2
3
|
import type { AudioOrVideoSample, OnAudioSample, OnVideoSample } from '../webcodec-sample-types';
|
|
3
4
|
import { type KeyframesState } from './keyframes';
|
|
4
5
|
import type { SlowDurationAndFpsState } from './slow-duration-fps';
|
|
5
6
|
import type { StructureState } from './structure';
|
|
6
|
-
export declare const sampleCallback: ({
|
|
7
|
-
|
|
7
|
+
export declare const sampleCallback: ({ controller, hasAudioTrackHandlers, hasVideoTrackHandlers, fields, keyframes, emittedFields, slowDurationAndFpsState, structure, }: {
|
|
8
|
+
controller: MediaParserController;
|
|
8
9
|
hasAudioTrackHandlers: boolean;
|
|
9
10
|
hasVideoTrackHandlers: boolean;
|
|
10
11
|
fields: Options<ParseMediaFields>;
|
|
@@ -4,7 +4,7 @@ exports.sampleCallback = void 0;
|
|
|
4
4
|
const can_skip_tracks_1 = require("./can-skip-tracks");
|
|
5
5
|
const has_tracks_section_1 = require("./has-tracks-section");
|
|
6
6
|
const need_samples_for_fields_1 = require("./need-samples-for-fields");
|
|
7
|
-
const sampleCallback = ({
|
|
7
|
+
const sampleCallback = ({ controller, hasAudioTrackHandlers, hasVideoTrackHandlers, fields, keyframes, emittedFields, slowDurationAndFpsState, structure, }) => {
|
|
8
8
|
const videoSampleCallbacks = {};
|
|
9
9
|
const audioSampleCallbacks = {};
|
|
10
10
|
const queuedAudioSamples = {};
|
|
@@ -31,7 +31,7 @@ const sampleCallback = ({ signal, hasAudioTrackHandlers, hasVideoTrackHandlers,
|
|
|
31
31
|
queuedVideoSamples[id] = [];
|
|
32
32
|
},
|
|
33
33
|
onAudioSample: async (trackId, audioSample) => {
|
|
34
|
-
if (signal
|
|
34
|
+
if (controller._internals.signal.aborted) {
|
|
35
35
|
throw new Error('Aborted');
|
|
36
36
|
}
|
|
37
37
|
if (typeof samplesForTrack[trackId] === 'undefined') {
|
|
@@ -54,7 +54,7 @@ const sampleCallback = ({ signal, hasAudioTrackHandlers, hasVideoTrackHandlers,
|
|
|
54
54
|
return (_a = samplesForTrack[trackId]) !== null && _a !== void 0 ? _a : 0;
|
|
55
55
|
},
|
|
56
56
|
onVideoSample: async (trackId, videoSample) => {
|
|
57
|
-
if (signal
|
|
57
|
+
if (controller._internals.signal.aborted) {
|
|
58
58
|
throw new Error('Aborted');
|
|
59
59
|
}
|
|
60
60
|
if (typeof samplesForTrack[trackId] === 'undefined') {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MediaParserController } from './media-parser-controller';
|
|
1
2
|
import type { ParseMediaOnProgress, ParseMediaProgress } from './options';
|
|
2
3
|
type ReturnType = {
|
|
3
4
|
get: () => ParseMediaProgress;
|
|
@@ -5,10 +6,10 @@ type ReturnType = {
|
|
|
5
6
|
stopAndGetLastProgress: () => void;
|
|
6
7
|
};
|
|
7
8
|
export type ParseMediaProgressFn = (state: (prevState: ParseMediaProgress) => ParseMediaProgress) => void;
|
|
8
|
-
export declare const throttledStateUpdate: ({ updateFn, everyMilliseconds,
|
|
9
|
+
export declare const throttledStateUpdate: ({ updateFn, everyMilliseconds, controller, }: {
|
|
9
10
|
updateFn: ParseMediaOnProgress | null;
|
|
10
11
|
everyMilliseconds: number;
|
|
11
|
-
|
|
12
|
+
controller: MediaParserController;
|
|
12
13
|
totalBytes: number | null;
|
|
13
14
|
}) => ReturnType;
|
|
14
15
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.throttledStateUpdate = void 0;
|
|
4
|
-
const throttledStateUpdate = ({ updateFn, everyMilliseconds,
|
|
4
|
+
const throttledStateUpdate = ({ updateFn, everyMilliseconds, controller, }) => {
|
|
5
5
|
let currentState = {
|
|
6
6
|
bytes: 0,
|
|
7
7
|
percentage: null,
|
|
@@ -28,7 +28,7 @@ const throttledStateUpdate = ({ updateFn, everyMilliseconds, signal, }) => {
|
|
|
28
28
|
const onAbort = () => {
|
|
29
29
|
clearInterval(interval);
|
|
30
30
|
};
|
|
31
|
-
signal
|
|
31
|
+
controller._internals.signal.addEventListener('abort', onAbort, { once: true });
|
|
32
32
|
return {
|
|
33
33
|
get: () => currentState,
|
|
34
34
|
update: (fn) => {
|
|
@@ -36,7 +36,7 @@ const throttledStateUpdate = ({ updateFn, everyMilliseconds, signal, }) => {
|
|
|
36
36
|
},
|
|
37
37
|
stopAndGetLastProgress: () => {
|
|
38
38
|
clearInterval(interval);
|
|
39
|
-
signal
|
|
39
|
+
controller._internals.signal.removeEventListener('abort', onAbort);
|
|
40
40
|
return currentState;
|
|
41
41
|
},
|
|
42
42
|
};
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.
|
|
1
|
+
export declare const VERSION = "4.0.253";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/media-parser"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/media-parser",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.253",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@types/wicg-file-system-access": "2023.10.5",
|
|
11
11
|
"eslint": "9.14.0",
|
|
12
|
-
"@remotion/example-videos": "4.0.
|
|
13
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
12
|
+
"@remotion/example-videos": "4.0.253",
|
|
13
|
+
"@remotion/eslint-config-internal": "4.0.253"
|
|
14
14
|
},
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
package/LICENSE.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Remotion License
|
|
2
|
-
|
|
3
|
-
In Remotion 5.0, the license will slightly change. [View the changes here](https://github.com/remotion-dev/remotion/pull/3750).
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
|
|
8
|
-
|
|
9
|
-
- [Free license](#free-license)
|
|
10
|
-
- [Company license](#company-license)
|
|
11
|
-
|
|
12
|
-
## Free license
|
|
13
|
-
|
|
14
|
-
Copyright © 2025 [Remotion](https://www.remotion.dev)
|
|
15
|
-
|
|
16
|
-
### Eligibility
|
|
17
|
-
|
|
18
|
-
You are eligible to use Remotion for free if you are:
|
|
19
|
-
|
|
20
|
-
- an individual
|
|
21
|
-
- a for-profit organization with up to 3 employees
|
|
22
|
-
- a non-profit or not-for-profit organization
|
|
23
|
-
- evaluating whether Remotion is a good fit, and are not yet using it in a commercial way
|
|
24
|
-
|
|
25
|
-
### Allowed use cases
|
|
26
|
-
|
|
27
|
-
Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
|
|
28
|
-
|
|
29
|
-
### Disallowed use cases
|
|
30
|
-
|
|
31
|
-
It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, or sublicensing your own derivate of Remotion.
|
|
32
|
-
|
|
33
|
-
### Warranty notice
|
|
34
|
-
|
|
35
|
-
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
|
|
36
|
-
|
|
37
|
-
### Support
|
|
38
|
-
|
|
39
|
-
Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
|
|
40
|
-
|
|
41
|
-
## Company license
|
|
42
|
-
|
|
43
|
-
You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support (read the [Support Policy](https://www.remotion.dev/docs/support)).
|
|
44
|
-
|
|
45
|
-
Visit [remotion.pro](https://www.remotion.pro/license) for pricing and to buy a license.
|
|
46
|
-
|
|
47
|
-
### FAQs
|
|
48
|
-
|
|
49
|
-
Are you not sure whether you need a company license because of an edge case? Here are some [frequently asked questions](https://www.remotion.pro/faq).
|