node-av 6.2.0-beta.25 → 6.2.0-beta.26
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/README.md +1 -1
- package/dist/api/audio-frame-buffer.d.ts +368 -22
- package/dist/api/audio-frame-buffer.js +687 -100
- package/dist/api/audio-frame-buffer.js.map +1 -1
- package/dist/api/demuxer.d.ts +7 -3
- package/dist/api/demuxer.js +19 -7
- package/dist/api/demuxer.js.map +1 -1
- package/dist/api/encoder.d.ts +40 -3
- package/dist/api/encoder.js +61 -23
- package/dist/api/encoder.js.map +1 -1
- package/dist/api/fmp4-stream.d.ts +103 -3
- package/dist/api/fmp4-stream.js +151 -28
- package/dist/api/fmp4-stream.js.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/io-stream.js +21 -6
- package/dist/api/io-stream.js.map +1 -1
- package/dist/api/muxer.d.ts +275 -7
- package/dist/api/muxer.js +569 -62
- package/dist/api/muxer.js.map +1 -1
- package/dist/api/rtp-stream.d.ts +19 -2
- package/dist/api/rtp-stream.js +62 -15
- package/dist/api/rtp-stream.js.map +1 -1
- package/dist/api/scaler.d.ts +19 -4
- package/dist/api/scaler.js +21 -6
- package/dist/api/scaler.js.map +1 -1
- package/dist/api/utilities/packet-age-watchdog.d.ts +198 -0
- package/dist/api/utilities/packet-age-watchdog.js +594 -0
- package/dist/api/utilities/packet-age-watchdog.js.map +1 -0
- package/dist/lib/binding.d.ts +9 -1
- package/dist/lib/binding.js +13 -0
- package/dist/lib/binding.js.map +1 -1
- package/dist/lib/format-context.d.ts +7 -0
- package/dist/lib/format-context.js +7 -0
- package/dist/lib/format-context.js.map +1 -1
- package/dist/lib/frame.d.ts +6 -2
- package/dist/lib/frame.js +11 -3
- package/dist/lib/frame.js.map +1 -1
- package/dist/lib/native-types.d.ts +3 -1
- package/package.json +12 -12
package/dist/api/muxer.d.ts
CHANGED
|
@@ -8,6 +8,20 @@ import type { BitStreamFilterAPI } from './bitstream-filter.js';
|
|
|
8
8
|
import type { Demuxer, RTPDemuxer } from './demuxer.js';
|
|
9
9
|
import type { IOOutputCallbacks } from './io-stream.js';
|
|
10
10
|
import type { ContextOptions } from './utilities/context-options.js';
|
|
11
|
+
/**
|
|
12
|
+
* Observer for the packets a Muxer accepts for writing.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export interface MuxerPacketObserver {
|
|
17
|
+
/** A packet with payload was accepted; throwing fails the write like a muxing error. */
|
|
18
|
+
onPacket(streamIndex: number): void;
|
|
19
|
+
/**
|
|
20
|
+
* An accepted packet of this stream will not reach the output (dropped, or rejected by libavformat).
|
|
21
|
+
* A libavformat error for an earlier, buffered packet is reported against the packet submitted with it.
|
|
22
|
+
*/
|
|
23
|
+
onPacketRejected(streamIndex: number): void;
|
|
24
|
+
}
|
|
11
25
|
/**
|
|
12
26
|
* Options for Muxer creation.
|
|
13
27
|
*/
|
|
@@ -61,10 +75,57 @@ export interface MuxerOptions<F extends MuxerFormat | (string & {}) = MuxerForma
|
|
|
61
75
|
*
|
|
62
76
|
* When enabled, the muxer will terminate on the first write error.
|
|
63
77
|
* When disabled, errors are logged but processing continues.
|
|
78
|
+
* Timestamp discontinuities the muxer refuses to write (see
|
|
79
|
+
* {@link MuxerOptions.dtsBackwardThreshold} and
|
|
80
|
+
* {@link MuxerOptions.dtsForwardThreshold}) are thrown either way.
|
|
64
81
|
*
|
|
65
82
|
* @default true
|
|
66
83
|
*/
|
|
67
84
|
exitOnError?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Backward DTS jump in seconds above which writing a packet fails.
|
|
87
|
+
*
|
|
88
|
+
* Audio and video DTS must not decrease, so a packet behind the stream's last
|
|
89
|
+
* written DTS is clamped forward. After a large backward jump (a live source
|
|
90
|
+
* restarting its clock) every following packet is clamped to one tick past the
|
|
91
|
+
* previous one until the source catches up again, collapsing the timeline for
|
|
92
|
+
* as long as the jump. With a threshold set, such a packet is rejected with an
|
|
93
|
+
* error instead, so the owner can restart on a fresh timeline. Smaller jumps
|
|
94
|
+
* are still clamped. `0` disables the check.
|
|
95
|
+
*
|
|
96
|
+
* Independent of this option, MP4/MOV-family outputs always reject a DTS step
|
|
97
|
+
* or packet duration that their 32-bit sample durations cannot store (INT_MAX
|
|
98
|
+
* ticks or more), where movenc would otherwise collapse the step to one tick
|
|
99
|
+
* or abort the process. Without an edit list (fragmented output without
|
|
100
|
+
* `delay_moov`) they also reject the first packet of a stream that starts
|
|
101
|
+
* more than `max_interleave_delta` (10 s) after the others and ends before
|
|
102
|
+
* the output's start, which movenc cannot store either.
|
|
103
|
+
*
|
|
104
|
+
* @default 0
|
|
105
|
+
*/
|
|
106
|
+
dtsBackwardThreshold?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Forward DTS jump in seconds, beyond the real time that passed, above which
|
|
109
|
+
* writing a packet fails.
|
|
110
|
+
*
|
|
111
|
+
* For a source read in real time, timestamps advance with the clock: a gap
|
|
112
|
+
* in the stream comes with a matching wait for the packet after it. A packet
|
|
113
|
+
* whose DTS runs further ahead than the time that passed is a
|
|
114
|
+
* discontinuity (a live source restarting its clock behind a restreamer),
|
|
115
|
+
* and writing it would leave a sample spanning the jump. With a threshold
|
|
116
|
+
* set, such a packet is rejected with an error before it reaches the
|
|
117
|
+
* output, so the owner can restart on a fresh timeline. Real time is
|
|
118
|
+
* measured per audio/video stream from when its packets are passed to
|
|
119
|
+
* writePacket(), and a packet is compared with the stream's last 128 to 256
|
|
120
|
+
* packets, so frames a parser or encoder held back during a gap do not make
|
|
121
|
+
* the end of the gap look like a jump. A stream's first packet is not
|
|
122
|
+
* checked, and a packet without DTS is measured by its PTS. Use it only for
|
|
123
|
+
* sources read in real time: a file read faster than real time has its gaps
|
|
124
|
+
* without the wait. `0` disables the check.
|
|
125
|
+
*
|
|
126
|
+
* @default 0
|
|
127
|
+
*/
|
|
128
|
+
dtsForwardThreshold?: number;
|
|
68
129
|
/**
|
|
69
130
|
* Maximum number of packets to buffer per stream in the sync queue.
|
|
70
131
|
*
|
|
@@ -290,9 +351,19 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
290
351
|
private writeWorkerPromise?;
|
|
291
352
|
private writeWorkerError?;
|
|
292
353
|
private signal?;
|
|
354
|
+
private movSampleLimit;
|
|
355
|
+
private tsNonStrict;
|
|
356
|
+
private movZeroStart;
|
|
357
|
+
private interleaveDeltaUs;
|
|
358
|
+
private trailerDiscarded;
|
|
359
|
+
private forwardThresholdMs;
|
|
360
|
+
private clock;
|
|
361
|
+
private packetObserver?;
|
|
293
362
|
/**
|
|
294
363
|
* @param options - Media output options
|
|
295
364
|
*
|
|
365
|
+
* @throws {RangeError} If dtsBackwardThreshold or dtsForwardThreshold is not a finite number >= 0
|
|
366
|
+
*
|
|
296
367
|
* @internal
|
|
297
368
|
*/
|
|
298
369
|
private constructor();
|
|
@@ -313,6 +384,8 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
313
384
|
*
|
|
314
385
|
* @throws {Error} If format required for custom I/O
|
|
315
386
|
*
|
|
387
|
+
* @throws {RangeError} If dtsBackwardThreshold or dtsForwardThreshold is not a finite number >= 0
|
|
388
|
+
*
|
|
316
389
|
* @throws {FFmpegError} If allocation or opening fails
|
|
317
390
|
*
|
|
318
391
|
* @example
|
|
@@ -387,6 +460,8 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
387
460
|
*
|
|
388
461
|
* @throws {Error} If format required for custom I/O
|
|
389
462
|
*
|
|
463
|
+
* @throws {RangeError} If dtsBackwardThreshold or dtsForwardThreshold is not a finite number >= 0
|
|
464
|
+
*
|
|
390
465
|
* @throws {FFmpegError} If allocation or opening fails
|
|
391
466
|
*
|
|
392
467
|
* @example
|
|
@@ -699,6 +774,9 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
699
774
|
*
|
|
700
775
|
* @throws {Error} If stream invalid or encoder not initialized
|
|
701
776
|
*
|
|
777
|
+
* @throws {Error} On a timestamp discontinuity the output cannot take (see {@link MuxerOptions.dtsBackwardThreshold}).
|
|
778
|
+
* With the background write queue (more than one stream) it surfaces from a later writePacket() or close().
|
|
779
|
+
*
|
|
702
780
|
* @throws {FFmpegError} If write fails
|
|
703
781
|
*
|
|
704
782
|
* @example
|
|
@@ -755,6 +833,8 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
755
833
|
*
|
|
756
834
|
* @throws {Error} If stream invalid or encoder not initialized
|
|
757
835
|
*
|
|
836
|
+
* @throws {Error} On a timestamp discontinuity the output cannot take (see {@link MuxerOptions.dtsBackwardThreshold})
|
|
837
|
+
*
|
|
758
838
|
* @throws {FFmpegError} If write fails
|
|
759
839
|
*
|
|
760
840
|
* @example
|
|
@@ -836,6 +916,54 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
836
916
|
* @internal
|
|
837
917
|
*/
|
|
838
918
|
getFormatContext(): FormatContext;
|
|
919
|
+
/**
|
|
920
|
+
* Follow the packets this muxer accepts for writing.
|
|
921
|
+
*
|
|
922
|
+
* The observer hears about every packet with payload once it is accepted
|
|
923
|
+
* (before it waits in the pre-mux queue or reaches libavformat) and about
|
|
924
|
+
* every such packet that is dropped later, so together with the output it
|
|
925
|
+
* knows what the muxer holds. close() detaches it.
|
|
926
|
+
*
|
|
927
|
+
* @param observer - Observer, or undefined to detach
|
|
928
|
+
*
|
|
929
|
+
* @internal
|
|
930
|
+
*/
|
|
931
|
+
setPacketObserver(observer: MuxerPacketObserver | undefined): void;
|
|
932
|
+
/**
|
|
933
|
+
* Replace the clock that stamps packet arrival times for the dtsForwardThreshold check.
|
|
934
|
+
*
|
|
935
|
+
* Lets tests drive real time deterministically. Set it before the first packet.
|
|
936
|
+
*
|
|
937
|
+
* @param clock - Monotonic time in ms
|
|
938
|
+
*
|
|
939
|
+
* @internal
|
|
940
|
+
*/
|
|
941
|
+
setClock(clock: () => number): void;
|
|
942
|
+
/**
|
|
943
|
+
* Make close() skip the trailer.
|
|
944
|
+
*
|
|
945
|
+
* For owners that drop whatever the muxer still emits, such as FMP4Stream
|
|
946
|
+
* after a failed session: the trailer would only push libavformat's backlog
|
|
947
|
+
* into the void, and movenc asserts on some track states a failed session
|
|
948
|
+
* can leave behind. The backlog is freed with the format context instead.
|
|
949
|
+
*
|
|
950
|
+
* @internal
|
|
951
|
+
*/
|
|
952
|
+
discardOnClose(): void;
|
|
953
|
+
/**
|
|
954
|
+
* Announce a packet the muxer has accepted to the packet observer.
|
|
955
|
+
*
|
|
956
|
+
* @param pkt - The muxer's clone of the packet
|
|
957
|
+
*
|
|
958
|
+
* @param streamIndex - Output stream index
|
|
959
|
+
*
|
|
960
|
+
* @returns True when the observer now tracks the packet
|
|
961
|
+
*
|
|
962
|
+
* @throws {Error} If the observer fails the write (the clone is freed)
|
|
963
|
+
*
|
|
964
|
+
* @internal
|
|
965
|
+
*/
|
|
966
|
+
private announcePacket;
|
|
839
967
|
/**
|
|
840
968
|
* Apply shared pre-header setup for writePacket and writePacketSync.
|
|
841
969
|
*
|
|
@@ -846,6 +974,16 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
846
974
|
* @internal
|
|
847
975
|
*/
|
|
848
976
|
private prepareHeaderWrite;
|
|
977
|
+
/**
|
|
978
|
+
* Read the muxing setup libavformat settles while writing the header.
|
|
979
|
+
*
|
|
980
|
+
* movenc decides on edit lists only then: without one (fragmented output
|
|
981
|
+
* without delay_moov) it shifts the output to start at 0 and puts each
|
|
982
|
+
* track's first sample there, which {@link checkMovLateStart} guards.
|
|
983
|
+
*
|
|
984
|
+
* @internal
|
|
985
|
+
*/
|
|
986
|
+
private readHeaderSetup;
|
|
849
987
|
/**
|
|
850
988
|
* Setup sync queues based on stream configuration.
|
|
851
989
|
*
|
|
@@ -859,6 +997,14 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
859
997
|
* @internal
|
|
860
998
|
*/
|
|
861
999
|
private setupSyncQueues;
|
|
1000
|
+
/**
|
|
1001
|
+
* Whether any stream still holds packets (or an EOF marker) in its pre-mux queue.
|
|
1002
|
+
*
|
|
1003
|
+
* @returns True if a pre-mux queue is not empty
|
|
1004
|
+
*
|
|
1005
|
+
* @internal
|
|
1006
|
+
*/
|
|
1007
|
+
private hasPreMuxPackets;
|
|
862
1008
|
/**
|
|
863
1009
|
* Flush all PreMuxQueues in DTS-sorted order.
|
|
864
1010
|
*
|
|
@@ -892,6 +1038,8 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
892
1038
|
*
|
|
893
1039
|
* @param streamIndex - Stream index
|
|
894
1040
|
*
|
|
1041
|
+
* @param arrival - When the packet reached the muxer (ms on the arrival clock)
|
|
1042
|
+
*
|
|
895
1043
|
* @internal
|
|
896
1044
|
*/
|
|
897
1045
|
private write;
|
|
@@ -905,6 +1053,8 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
905
1053
|
*
|
|
906
1054
|
* @param streamIndex - Stream index
|
|
907
1055
|
*
|
|
1056
|
+
* @param arrival - When the packet reached the muxer (ms on the arrival clock)
|
|
1057
|
+
*
|
|
908
1058
|
* @internal
|
|
909
1059
|
*/
|
|
910
1060
|
private writeInternal;
|
|
@@ -925,6 +1075,8 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
925
1075
|
*
|
|
926
1076
|
* @param streamIndex - Stream index
|
|
927
1077
|
*
|
|
1078
|
+
* @param arrival - When the packet reached the muxer (ms on the arrival clock)
|
|
1079
|
+
*
|
|
928
1080
|
* @internal
|
|
929
1081
|
*/
|
|
930
1082
|
private writeSync;
|
|
@@ -954,11 +1106,12 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
954
1106
|
* Apply the configured `startTime` offset to an encoded packet, per stream.
|
|
955
1107
|
*
|
|
956
1108
|
* `startTime` exists to strip a device's boot-relative timestamp base (e.g. the
|
|
957
|
-
* mach uptime avfoundation reports). But
|
|
958
|
-
*
|
|
959
|
-
*
|
|
960
|
-
* players (QuickTime) reject. The
|
|
961
|
-
*
|
|
1109
|
+
* mach uptime avfoundation reports). But not every stream of an output carries
|
|
1110
|
+
* that base (e.g. zero-based audio next to device video), so subtracting a large
|
|
1111
|
+
* device startTime from such a stream would push its timestamps hugely negative and
|
|
1112
|
+
* produce a broken/overflowed edit list that strict players (QuickTime) reject. The
|
|
1113
|
+
* effective offset is therefore decided once on the stream's first packet and
|
|
1114
|
+
* clamped to what the stream actually carries —
|
|
962
1115
|
* `min(startTime, max(0, firstPts))`: boot-relative streams normalize to zero,
|
|
963
1116
|
* already-zero-based streams are left untouched.
|
|
964
1117
|
*
|
|
@@ -976,8 +1129,14 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
976
1129
|
* Performs timestamp corrections:
|
|
977
1130
|
* 1. Rescales timestamps to output timebase (av_rescale_delta for audio streamcopy)
|
|
978
1131
|
* 2. Sets pkt.timeBase to output stream timebase
|
|
979
|
-
* 3.
|
|
980
|
-
* 4.
|
|
1132
|
+
* 3. Rejects backward jumps beyond dtsBackwardThreshold
|
|
1133
|
+
* 4. Fixes invalid DTS > PTS relationships
|
|
1134
|
+
* 5. Enforces monotonic DTS (never decreasing), shrinking a clamped packet's duration to the clamped step
|
|
1135
|
+
* 6. Rejects forward jumps that run ahead of real time beyond dtsForwardThreshold
|
|
1136
|
+
* 7. Rejects DTS steps/durations a movenc output cannot store, and a late stream's first packet before its start
|
|
1137
|
+
*
|
|
1138
|
+
* The stream's last muxed DTS only advances when the packet is accepted and
|
|
1139
|
+
* carries a DTS.
|
|
981
1140
|
*
|
|
982
1141
|
* @param pkt - Packet to fix
|
|
983
1142
|
*
|
|
@@ -985,9 +1144,118 @@ export declare class Muxer implements AsyncDisposable, Disposable {
|
|
|
985
1144
|
*
|
|
986
1145
|
* @param streamIndex - Stream index
|
|
987
1146
|
*
|
|
1147
|
+
* @param arrival - When the packet reached the muxer (ms on the arrival clock)
|
|
1148
|
+
*
|
|
1149
|
+
* @throws {Error} On a rejected timestamp discontinuity
|
|
1150
|
+
*
|
|
988
1151
|
* @internal
|
|
989
1152
|
*/
|
|
990
1153
|
private muxFixupTs;
|
|
1154
|
+
/**
|
|
1155
|
+
* Reject a packet whose DTS lies further behind the stream's last muxed DTS
|
|
1156
|
+
* than the configured dtsBackwardThreshold.
|
|
1157
|
+
*
|
|
1158
|
+
* Expects the DTS already rescaled to the output stream time base. No-op when
|
|
1159
|
+
* the threshold is unset or 0.
|
|
1160
|
+
*
|
|
1161
|
+
* @param dts - Packet DTS in the output time base
|
|
1162
|
+
*
|
|
1163
|
+
* @param lastMuxDts - The stream's last muxed DTS
|
|
1164
|
+
*
|
|
1165
|
+
* @param timeBase - Output stream time base
|
|
1166
|
+
*
|
|
1167
|
+
* @param streamIndex - Stream index
|
|
1168
|
+
*
|
|
1169
|
+
* @throws {Error} If the backward jump exceeds the threshold
|
|
1170
|
+
*
|
|
1171
|
+
* @internal
|
|
1172
|
+
*/
|
|
1173
|
+
private checkBackwardDts;
|
|
1174
|
+
/**
|
|
1175
|
+
* Reject a packet whose DTS runs further ahead of real time than the
|
|
1176
|
+
* configured dtsForwardThreshold.
|
|
1177
|
+
*
|
|
1178
|
+
* Tracks per stream how real time and media time move apart (the offset) and
|
|
1179
|
+
* compares the packet's offset with the lowest one of the stream's recent
|
|
1180
|
+
* packets, see FORWARD_WINDOW_BUCKET. A gap in a live source leaves the
|
|
1181
|
+
* offset level, since the wait comes with it; a jump lowers it by the size
|
|
1182
|
+
* of the jump. The stream's first packet only sets the starting point.
|
|
1183
|
+
*
|
|
1184
|
+
* @param ts - Final packet DTS (PTS without DTS) in the output time base
|
|
1185
|
+
*
|
|
1186
|
+
* @param arrival - When the packet reached the muxer (ms on the arrival clock)
|
|
1187
|
+
*
|
|
1188
|
+
* @param streamInfo - Stream description
|
|
1189
|
+
*
|
|
1190
|
+
* @param streamIndex - Stream index
|
|
1191
|
+
*
|
|
1192
|
+
* @returns The packet's offset, for {@link recordForwardDts} once the packet is accepted
|
|
1193
|
+
*
|
|
1194
|
+
* @throws {Error} If the DTS runs ahead of real time by more than the threshold
|
|
1195
|
+
*
|
|
1196
|
+
* @internal
|
|
1197
|
+
*/
|
|
1198
|
+
private checkForwardDts;
|
|
1199
|
+
/**
|
|
1200
|
+
* Make an accepted packet the reference of the stream's next forward check.
|
|
1201
|
+
*
|
|
1202
|
+
* @param state - The stream's forward check state
|
|
1203
|
+
*
|
|
1204
|
+
* @param ts - The packet's DTS (PTS without DTS) in the output time base
|
|
1205
|
+
*
|
|
1206
|
+
* @param offset - The packet's offset from {@link checkForwardDts}
|
|
1207
|
+
*
|
|
1208
|
+
* @param arrival - When the packet reached the muxer (ms on the arrival clock)
|
|
1209
|
+
*
|
|
1210
|
+
* @internal
|
|
1211
|
+
*/
|
|
1212
|
+
private recordForwardDts;
|
|
1213
|
+
/**
|
|
1214
|
+
* Reject a packet whose DTS step or duration a movenc output cannot store.
|
|
1215
|
+
*
|
|
1216
|
+
* Runs after the monotonic clamp, on the DTS movenc will see. Steps are
|
|
1217
|
+
* measured against the stream's last muxed DTS.
|
|
1218
|
+
*
|
|
1219
|
+
* @param dts - Final packet DTS, or its PTS for a packet without DTS
|
|
1220
|
+
*
|
|
1221
|
+
* @param duration - Final packet duration
|
|
1222
|
+
*
|
|
1223
|
+
* @param lastMuxDts - The stream's last muxed DTS
|
|
1224
|
+
*
|
|
1225
|
+
* @param timeBase - Output stream time base
|
|
1226
|
+
*
|
|
1227
|
+
* @param streamIndex - Stream index
|
|
1228
|
+
*
|
|
1229
|
+
* @throws {Error} If the step or duration reaches INT_MAX ticks
|
|
1230
|
+
*
|
|
1231
|
+
* @internal
|
|
1232
|
+
*/
|
|
1233
|
+
private checkMovSampleDuration;
|
|
1234
|
+
/**
|
|
1235
|
+
* Reject a stream's first packet that ends before the output's start.
|
|
1236
|
+
*
|
|
1237
|
+
* Without an edit list movenc puts each track's first sample at the output's
|
|
1238
|
+
* start, so a first packet that ends before it becomes a sample of negative
|
|
1239
|
+
* duration, and movenc aborts the process (av_assert0 in
|
|
1240
|
+
* get_cluster_duration) at the next fragment or the trailer unless a second
|
|
1241
|
+
* sample reaches it first. libavformat sets that start from the lowest DTS
|
|
1242
|
+
* it holds when it writes its first packet. It holds every packet until each
|
|
1243
|
+
* stream has sent one or its queue spans max_interleave_delta, so only a
|
|
1244
|
+
* stream that starts that much later than the others can land before it.
|
|
1245
|
+
*
|
|
1246
|
+
* @param ts - Packet DTS (PTS without DTS) in the output time base
|
|
1247
|
+
*
|
|
1248
|
+
* @param duration - Packet duration
|
|
1249
|
+
*
|
|
1250
|
+
* @param timeBase - Output stream time base
|
|
1251
|
+
*
|
|
1252
|
+
* @param streamIndex - Stream index
|
|
1253
|
+
*
|
|
1254
|
+
* @throws {Error} If the packet ends before a start libavformat may already have set
|
|
1255
|
+
*
|
|
1256
|
+
* @internal
|
|
1257
|
+
*/
|
|
1258
|
+
private checkMovLateStart;
|
|
991
1259
|
/**
|
|
992
1260
|
* Copy container metadata from input to output.
|
|
993
1261
|
*
|