@libmedia/avutil 0.10.0 → 0.12.0
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/cjs/AVStream.d.ts +255 -12
- package/dist/cjs/AVStream.js +32 -3
- package/dist/cjs/AVStream.js.map +1 -1
- package/dist/cjs/avformat.d.ts +4 -1
- package/dist/cjs/codec.d.ts +65 -1
- package/dist/cjs/codecs/aac.d.ts +2 -2
- package/dist/cjs/codecs/ac3.d.ts +1 -1
- package/dist/cjs/codecs/av1.d.ts +2 -2
- package/dist/cjs/codecs/dts.d.ts +1 -1
- package/dist/cjs/codecs/flac.d.ts +2 -2
- package/dist/cjs/codecs/h264.d.ts +5 -5
- package/dist/cjs/codecs/h264.js +4 -5
- package/dist/cjs/codecs/h264.js.map +1 -1
- package/dist/cjs/codecs/hevc.d.ts +5 -5
- package/dist/cjs/codecs/hevc.js +2 -3
- package/dist/cjs/codecs/hevc.js.map +1 -1
- package/dist/cjs/codecs/mp3.d.ts +3 -3
- package/dist/cjs/codecs/mpeg4.d.ts +1 -1
- package/dist/cjs/codecs/mpegvideo.d.ts +1 -1
- package/dist/cjs/codecs/opus.d.ts +2 -2
- package/dist/cjs/codecs/vp8.d.ts +3 -3
- package/dist/cjs/codecs/vp9.d.ts +3 -3
- package/dist/cjs/codecs/vp9.js.map +1 -1
- package/dist/cjs/codecs/vvc.d.ts +5 -5
- package/dist/cjs/codecs/vvc.js +2 -3
- package/dist/cjs/codecs/vvc.js.map +1 -1
- package/dist/cjs/constant.d.ts +1 -0
- package/dist/cjs/constant.js +3 -2
- package/dist/cjs/constant.js.map +1 -1
- package/dist/cjs/enum.d.ts +138 -12
- package/dist/cjs/enum.js +36 -23
- package/dist/cjs/enum.js.map +1 -1
- package/dist/cjs/function/analyzeAVFormat.d.ts +1 -1
- package/dist/cjs/function/analyzeUrlIOLoader.d.ts +1 -1
- package/dist/cjs/function/audioData2AVFrame.d.ts +1 -1
- package/dist/cjs/function/avPCMBuffer2AVFrame.d.ts +2 -2
- package/dist/cjs/function/avPCMBuffer2AVFrame.js +4 -4
- package/dist/cjs/function/avPCMBuffer2AVFrame.js.map +1 -1
- package/dist/cjs/function/avframe2AudioData.d.ts +1 -1
- package/dist/cjs/function/avframe2VideoFrame.d.ts +1 -1
- package/dist/cjs/function/avpacket2EncodedAudioChunk.d.ts +1 -1
- package/dist/cjs/function/avpacket2EncodedAudioChunk.js +2 -0
- package/dist/cjs/function/avpacket2EncodedAudioChunk.js.map +1 -1
- package/dist/cjs/function/avpacket2EncodedVideoChunk.d.ts +1 -1
- package/dist/cjs/function/avpacket2EncodedVideoChunk.js +2 -0
- package/dist/cjs/function/avpacket2EncodedVideoChunk.js.map +1 -1
- package/dist/cjs/function/compileResource.d.ts +1 -1
- package/dist/cjs/function/compileResource.js.map +1 -1
- package/dist/cjs/function/encodedAudioChunk2AVPacket.d.ts +1 -1
- package/dist/cjs/function/encodedAudioChunk2AVPacket.js +1 -1
- package/dist/cjs/function/encodedAudioChunk2AVPacket.js.map +1 -1
- package/dist/cjs/function/encodedVideoChunk2AVPacket.d.ts +1 -1
- package/dist/cjs/function/encodedVideoChunk2AVPacket.js +36 -4
- package/dist/cjs/function/encodedVideoChunk2AVPacket.js.map +1 -1
- package/dist/cjs/function/getAudioCodec.d.ts +1 -1
- package/dist/cjs/function/getVideoCodec.d.ts +1 -1
- package/dist/cjs/function/getWasmUrl.js +15 -0
- package/dist/cjs/function/getWasmUrl.js.map +1 -1
- package/dist/cjs/function/hasAlphaChannel.d.ts +1 -1
- package/dist/cjs/function/isHdr.d.ts +1 -1
- package/dist/cjs/function/isHdr.js.map +1 -1
- package/dist/cjs/function/videoFrame2AVFrame.d.ts +1 -1
- package/dist/cjs/implement/AVFramePoolImpl.d.ts +4 -3
- package/dist/cjs/implement/AVFramePoolImpl.js.map +1 -1
- package/dist/cjs/implement/AVPCMBufferPoolImpl.d.ts +4 -3
- package/dist/cjs/implement/AVPCMBufferPoolImpl.js.map +1 -1
- package/dist/cjs/implement/AVPacketPoolImpl.d.ts +4 -3
- package/dist/cjs/implement/AVPacketPoolImpl.js.map +1 -1
- package/dist/cjs/pixelFormatDescriptor.d.ts +1 -0
- package/dist/cjs/pixelFormatDescriptor.js +17 -4
- package/dist/cjs/pixelFormatDescriptor.js.map +1 -1
- package/dist/cjs/stringEnum.d.ts +26 -1
- package/dist/cjs/stringEnum.js +36 -5
- package/dist/cjs/stringEnum.js.map +1 -1
- package/dist/cjs/struct/audiosample.d.ts +1 -1
- package/dist/cjs/struct/avbuffer.d.ts +1 -1
- package/dist/cjs/struct/avcodecparameters.d.ts +10 -5
- package/dist/cjs/struct/avcodecparameters.js.map +1 -1
- package/dist/cjs/struct/avframe.d.ts +4 -4
- package/dist/cjs/struct/avframe.js +4 -6
- package/dist/cjs/struct/avframe.js.map +1 -1
- package/dist/cjs/struct/avpacket.d.ts +1 -1
- package/dist/cjs/struct/avpcmbuffer.d.ts +1 -1
- package/dist/cjs/struct/avsubtitle.d.ts +1 -1
- package/dist/cjs/util/amf.d.ts +4 -4
- package/dist/cjs/util/av1syntax.d.ts +1 -1
- package/dist/cjs/util/avbuffer.d.ts +2 -1
- package/dist/cjs/util/avbuffer.js.map +1 -1
- package/dist/cjs/util/avdict.d.ts +2 -1
- package/dist/cjs/util/avdict.js.map +1 -1
- package/dist/cjs/util/avframe.d.ts +2 -1
- package/dist/cjs/util/avframe.js +7 -7
- package/dist/cjs/util/avframe.js.map +1 -1
- package/dist/cjs/util/avpacket.d.ts +2 -2
- package/dist/cjs/util/channel.d.ts +1 -1
- package/dist/cjs/util/codecparameters.d.ts +1 -1
- package/dist/cjs/util/encryption.d.ts +2 -2
- package/dist/cjs/util/expgolomb.d.ts +2 -2
- package/dist/cjs/util/nalu.d.ts +1 -1
- package/dist/cjs/util/pixel.js.map +1 -1
- package/dist/cjs/util/rational.d.ts +1 -1
- package/dist/cjs/util/serialize.d.ts +5 -5
- package/dist/esm/AVStream.d.ts +255 -12
- package/dist/esm/AVStream.js +32 -2
- package/dist/esm/AVStream.js.map +1 -1
- package/dist/esm/avformat.d.ts +4 -1
- package/dist/esm/codec.d.ts +65 -1
- package/dist/esm/codecs/aac.d.ts +2 -2
- package/dist/esm/codecs/ac3.d.ts +1 -1
- package/dist/esm/codecs/av1.d.ts +2 -2
- package/dist/esm/codecs/dts.d.ts +1 -1
- package/dist/esm/codecs/flac.d.ts +2 -2
- package/dist/esm/codecs/h264.d.ts +5 -5
- package/dist/esm/codecs/h264.js +4 -5
- package/dist/esm/codecs/h264.js.map +1 -1
- package/dist/esm/codecs/hevc.d.ts +5 -5
- package/dist/esm/codecs/hevc.js +2 -3
- package/dist/esm/codecs/hevc.js.map +1 -1
- package/dist/esm/codecs/mp3.d.ts +3 -3
- package/dist/esm/codecs/mpeg4.d.ts +1 -1
- package/dist/esm/codecs/mpegvideo.d.ts +1 -1
- package/dist/esm/codecs/opus.d.ts +2 -2
- package/dist/esm/codecs/vp8.d.ts +3 -3
- package/dist/esm/codecs/vp9.d.ts +3 -3
- package/dist/esm/codecs/vp9.js.map +1 -1
- package/dist/esm/codecs/vvc.d.ts +5 -5
- package/dist/esm/codecs/vvc.js +2 -3
- package/dist/esm/codecs/vvc.js.map +1 -1
- package/dist/esm/constant.d.ts +1 -0
- package/dist/esm/constant.js +2 -0
- package/dist/esm/constant.js.map +1 -1
- package/dist/esm/enum.d.ts +138 -12
- package/dist/esm/enum.js +36 -23
- package/dist/esm/enum.js.map +1 -1
- package/dist/esm/function/analyzeAVFormat.d.ts +1 -1
- package/dist/esm/function/analyzeUrlIOLoader.d.ts +1 -1
- package/dist/esm/function/audioData2AVFrame.d.ts +1 -1
- package/dist/esm/function/avPCMBuffer2AVFrame.d.ts +2 -2
- package/dist/esm/function/avPCMBuffer2AVFrame.js +2 -2
- package/dist/esm/function/avPCMBuffer2AVFrame.js.map +1 -1
- package/dist/esm/function/avframe2AudioData.d.ts +1 -1
- package/dist/esm/function/avframe2VideoFrame.d.ts +1 -1
- package/dist/esm/function/avpacket2EncodedAudioChunk.d.ts +1 -1
- package/dist/esm/function/avpacket2EncodedAudioChunk.js +1 -0
- package/dist/esm/function/avpacket2EncodedAudioChunk.js.map +1 -1
- package/dist/esm/function/avpacket2EncodedVideoChunk.d.ts +1 -1
- package/dist/esm/function/avpacket2EncodedVideoChunk.js +1 -0
- package/dist/esm/function/avpacket2EncodedVideoChunk.js.map +1 -1
- package/dist/esm/function/compileResource.d.ts +1 -1
- package/dist/esm/function/compileResource.js.map +1 -1
- package/dist/esm/function/encodedAudioChunk2AVPacket.d.ts +1 -1
- package/dist/esm/function/encodedAudioChunk2AVPacket.js +2 -2
- package/dist/esm/function/encodedAudioChunk2AVPacket.js.map +1 -1
- package/dist/esm/function/encodedVideoChunk2AVPacket.d.ts +1 -1
- package/dist/esm/function/encodedVideoChunk2AVPacket.js +7 -4
- package/dist/esm/function/encodedVideoChunk2AVPacket.js.map +1 -1
- package/dist/esm/function/getAudioCodec.d.ts +1 -1
- package/dist/esm/function/getVideoCodec.d.ts +1 -1
- package/dist/esm/function/getWasmUrl.js +15 -0
- package/dist/esm/function/getWasmUrl.js.map +1 -1
- package/dist/esm/function/hasAlphaChannel.d.ts +1 -1
- package/dist/esm/function/isHdr.d.ts +1 -1
- package/dist/esm/function/isHdr.js.map +1 -1
- package/dist/esm/function/videoFrame2AVFrame.d.ts +1 -1
- package/dist/esm/implement/AVFramePoolImpl.d.ts +4 -3
- package/dist/esm/implement/AVFramePoolImpl.js.map +1 -1
- package/dist/esm/implement/AVPCMBufferPoolImpl.d.ts +4 -3
- package/dist/esm/implement/AVPCMBufferPoolImpl.js.map +1 -1
- package/dist/esm/implement/AVPacketPoolImpl.d.ts +4 -3
- package/dist/esm/implement/AVPacketPoolImpl.js.map +1 -1
- package/dist/esm/pixelFormatDescriptor.d.ts +1 -0
- package/dist/esm/pixelFormatDescriptor.js +13 -0
- package/dist/esm/pixelFormatDescriptor.js.map +1 -1
- package/dist/esm/stringEnum.d.ts +26 -1
- package/dist/esm/stringEnum.js +39 -4
- package/dist/esm/stringEnum.js.map +1 -1
- package/dist/esm/struct/audiosample.d.ts +1 -1
- package/dist/esm/struct/avbuffer.d.ts +1 -1
- package/dist/esm/struct/avcodecparameters.d.ts +10 -5
- package/dist/esm/struct/avcodecparameters.js.map +1 -1
- package/dist/esm/struct/avframe.d.ts +4 -4
- package/dist/esm/struct/avframe.js +4 -6
- package/dist/esm/struct/avframe.js.map +1 -1
- package/dist/esm/struct/avpacket.d.ts +1 -1
- package/dist/esm/struct/avpcmbuffer.d.ts +1 -1
- package/dist/esm/struct/avsubtitle.d.ts +1 -1
- package/dist/esm/util/amf.d.ts +4 -4
- package/dist/esm/util/av1syntax.d.ts +1 -1
- package/dist/esm/util/avbuffer.d.ts +2 -1
- package/dist/esm/util/avbuffer.js.map +1 -1
- package/dist/esm/util/avdict.d.ts +2 -1
- package/dist/esm/util/avdict.js.map +1 -1
- package/dist/esm/util/avframe.d.ts +2 -1
- package/dist/esm/util/avframe.js +2 -2
- package/dist/esm/util/avframe.js.map +1 -1
- package/dist/esm/util/avpacket.d.ts +2 -2
- package/dist/esm/util/channel.d.ts +1 -1
- package/dist/esm/util/codecparameters.d.ts +1 -1
- package/dist/esm/util/encryption.d.ts +2 -2
- package/dist/esm/util/expgolomb.d.ts +2 -2
- package/dist/esm/util/nalu.d.ts +1 -1
- package/dist/esm/util/pixel.js.map +1 -1
- package/dist/esm/util/rational.d.ts +1 -1
- package/dist/esm/util/serialize.d.ts +5 -5
- package/package.json +3 -3
package/dist/cjs/AVStream.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Data } from "@libmedia/common/types/type";
|
|
1
|
+
import type { Data } from "@libmedia/common/types/type";
|
|
2
2
|
import AVCodecParameters from "./struct/avcodecparameters";
|
|
3
|
-
import { AVPacketSideDataType } from "./codec";
|
|
4
|
-
import { Rational } from "./struct/rational";
|
|
3
|
+
import type { AVPacketSideDataType } from "./codec";
|
|
4
|
+
import type { Rational } from "./struct/rational";
|
|
5
|
+
import type AVPacket from "./struct/avpacket";
|
|
5
6
|
export declare const enum AVStreamMetadataKey {
|
|
6
7
|
/**
|
|
7
8
|
* 表演者(歌手、乐队等)
|
|
@@ -27,10 +28,6 @@ export declare const enum AVStreamMetadataKey {
|
|
|
27
28
|
* 语言
|
|
28
29
|
*/
|
|
29
30
|
LANGUAGE = "language",
|
|
30
|
-
/**
|
|
31
|
-
* 语言描述
|
|
32
|
-
*/
|
|
33
|
-
LANGUAGE_STRING = "languageString",
|
|
34
31
|
/**
|
|
35
32
|
* 歌曲或作品的标题
|
|
36
33
|
*/
|
|
@@ -99,6 +96,10 @@ export declare const enum AVStreamMetadataKey {
|
|
|
99
96
|
* 最后更改时间
|
|
100
97
|
*/
|
|
101
98
|
MODIFICATION_TIME = "modificationTime",
|
|
99
|
+
/**
|
|
100
|
+
* 专辑表演者排序
|
|
101
|
+
*/
|
|
102
|
+
ALBUM_ARTIST_SORT = "albumArtistSort",
|
|
102
103
|
/**
|
|
103
104
|
* 专辑排序
|
|
104
105
|
*/
|
|
@@ -111,6 +112,10 @@ export declare const enum AVStreamMetadataKey {
|
|
|
111
112
|
* 标题排序
|
|
112
113
|
*/
|
|
113
114
|
TITLE_SORT = "titleSort",
|
|
115
|
+
/**
|
|
116
|
+
* 作曲者排序
|
|
117
|
+
*/
|
|
118
|
+
COMPOSER_SORT = "composerSort",
|
|
114
119
|
/**
|
|
115
120
|
* 分组
|
|
116
121
|
*/
|
|
@@ -158,11 +163,36 @@ export declare const enum AVStreamMetadataKey {
|
|
|
158
163
|
}
|
|
159
164
|
export declare const enum AVDisposition {
|
|
160
165
|
NONE = 0,
|
|
166
|
+
/**
|
|
167
|
+
* The stream should be chosen by default among other streams of the same type,
|
|
168
|
+
* unless the user has explicitly specified otherwise.
|
|
169
|
+
*/
|
|
161
170
|
DEFAULT = 1,
|
|
171
|
+
/**
|
|
172
|
+
* The stream is not in original language.
|
|
173
|
+
*
|
|
174
|
+
* @note AV_DISPOSITION_ORIGINAL is the inverse of this disposition. At most
|
|
175
|
+
* one of them should be set in properly tagged streams.
|
|
176
|
+
* @note This disposition may apply to any stream type, not just audio.
|
|
177
|
+
*/
|
|
162
178
|
DUB = 2,
|
|
179
|
+
/**
|
|
180
|
+
* The stream is in original language.
|
|
181
|
+
*
|
|
182
|
+
* @see the notes for AV_DISPOSITION_DUB
|
|
183
|
+
*/
|
|
163
184
|
ORIGINAL = 4,
|
|
185
|
+
/**
|
|
186
|
+
* The stream is a commentary track.
|
|
187
|
+
*/
|
|
164
188
|
COMMENT = 8,
|
|
189
|
+
/**
|
|
190
|
+
* The stream contains song lyrics.
|
|
191
|
+
*/
|
|
165
192
|
LYRICS = 16,
|
|
193
|
+
/**
|
|
194
|
+
* The stream contains karaoke audio.
|
|
195
|
+
*/
|
|
166
196
|
KARAOKE = 32,
|
|
167
197
|
/**
|
|
168
198
|
* Track should be used during playback by default.
|
|
@@ -196,19 +226,60 @@ export declare const enum AVDisposition {
|
|
|
196
226
|
*/
|
|
197
227
|
TIMED_THUMBNAILS = 2048,
|
|
198
228
|
/**
|
|
199
|
-
*
|
|
229
|
+
* The stream is intended to be mixed with a spatial audio track. For example,
|
|
230
|
+
* it could be used for narration or stereo music, and may remain unchanged by
|
|
231
|
+
* listener head rotation.
|
|
232
|
+
*/
|
|
233
|
+
NON_DIEGETIC = 4096,
|
|
234
|
+
/**
|
|
235
|
+
* The stream is sparse, thumbnail images for other stream in picture format like heif
|
|
236
|
+
*/
|
|
237
|
+
THUMBNAIL = 8192,
|
|
238
|
+
/**
|
|
239
|
+
* The subtitle stream contains captions, providing a transcription and possibly
|
|
240
|
+
* a translation of audio. Typically intended for hearing-impaired audiences.
|
|
200
241
|
*/
|
|
201
242
|
CAPTIONS = 65536,
|
|
243
|
+
/**
|
|
244
|
+
* The subtitle stream contains a textual description of the video content.
|
|
245
|
+
* Typically intended for visually-impaired audiences or for the cases where the
|
|
246
|
+
* video cannot be seen.
|
|
247
|
+
*/
|
|
202
248
|
DESCRIPTIONS = 131072,
|
|
249
|
+
/**
|
|
250
|
+
* The subtitle stream contains time-aligned metadata that is not intended to be
|
|
251
|
+
* directly presented to the user.
|
|
252
|
+
*/
|
|
203
253
|
METADATA = 262144,
|
|
204
254
|
/**
|
|
205
|
-
*
|
|
255
|
+
* The stream is intended to be mixed with another stream before presentation.
|
|
256
|
+
* Used for example to signal the stream contains an image part of a HEIF grid,
|
|
257
|
+
* or for mix_type=0 in mpegts.
|
|
206
258
|
*/
|
|
207
259
|
DEPENDENT = 524288,
|
|
208
260
|
/**
|
|
209
261
|
* still images in video stream (still_picture_flag=1 in mpegts
|
|
210
262
|
*/
|
|
211
|
-
STILL_IMAGE = 1048576
|
|
263
|
+
STILL_IMAGE = 1048576,
|
|
264
|
+
/**
|
|
265
|
+
* still images in video stream (still_picture_flag=1 in mpegts
|
|
266
|
+
*/
|
|
267
|
+
MULTILAYER = 2097152
|
|
268
|
+
}
|
|
269
|
+
export declare const enum AVDiscard {
|
|
270
|
+
AVDISCARD_NONE = -16,
|
|
271
|
+
AVDISCARD_DEFAULT = 0,
|
|
272
|
+
AVDISCARD_NONREF = 8,
|
|
273
|
+
AVDISCARD_BIDIR = 16,
|
|
274
|
+
AVDISCARD_NONINTRA = 24,
|
|
275
|
+
AVDISCARD_NONKEY = 32,
|
|
276
|
+
AVDISCARD_ALL = 48
|
|
277
|
+
}
|
|
278
|
+
export declare const enum AVStreamGroupParamsType {
|
|
279
|
+
NONE = 0,
|
|
280
|
+
IAMF_AUDIO_ELEMENT = 1,
|
|
281
|
+
IAMF_MIX_PRESENTATION = 2,
|
|
282
|
+
TILE_GRID = 3
|
|
212
283
|
}
|
|
213
284
|
/**
|
|
214
285
|
* from FFmpeg
|
|
@@ -281,6 +352,10 @@ export default class AVStream {
|
|
|
281
352
|
* AV_DISPOSITION_* bit field
|
|
282
353
|
*/
|
|
283
354
|
disposition: AVDisposition;
|
|
355
|
+
/**
|
|
356
|
+
* Selects which packets can be discarded at will and do not need to be demuxed.
|
|
357
|
+
*/
|
|
358
|
+
discard: AVDiscard;
|
|
284
359
|
/**
|
|
285
360
|
*
|
|
286
361
|
* 封装时间基
|
|
@@ -309,11 +384,169 @@ export default class AVStream {
|
|
|
309
384
|
* pos 到 sample index 的映射
|
|
310
385
|
*/
|
|
311
386
|
sampleIndexesPosMap: Map<int64, int32>;
|
|
387
|
+
/**
|
|
388
|
+
* For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet
|
|
389
|
+
* will contain the attached picture.
|
|
390
|
+
*
|
|
391
|
+
* decoding: set by libavformat, must not be modified by the caller.
|
|
392
|
+
* encoding: unused
|
|
393
|
+
*/
|
|
394
|
+
attachedPic: pointer<AVPacket>;
|
|
395
|
+
destroy(): void;
|
|
396
|
+
}
|
|
397
|
+
export declare class AVStreamGroupTileGrid {
|
|
398
|
+
/**
|
|
399
|
+
* Width of the canvas.
|
|
400
|
+
*
|
|
401
|
+
* Must be > 0.
|
|
402
|
+
*/
|
|
403
|
+
codedWidth: int32;
|
|
404
|
+
/**
|
|
405
|
+
* Width of the canvas.
|
|
406
|
+
*
|
|
407
|
+
* Must be > 0.
|
|
408
|
+
*/
|
|
409
|
+
codedHeight: int32;
|
|
410
|
+
/**
|
|
411
|
+
* An @ref nb_tiles sized array of offsets in pixels from the topleft edge
|
|
412
|
+
* of the canvas, indicating where each stream should be placed.
|
|
413
|
+
* It must be allocated with the av_malloc() family of functions.
|
|
414
|
+
*
|
|
415
|
+
* - demuxing: set by libavformat, must not be modified by the caller.
|
|
416
|
+
* - muxing: set by the caller before avformat_write_header().
|
|
417
|
+
*
|
|
418
|
+
* Freed by libavformat in avformat_free_context().
|
|
419
|
+
*/
|
|
420
|
+
offsets: {
|
|
421
|
+
/**
|
|
422
|
+
* Index of the stream in the group this tile references.
|
|
423
|
+
*
|
|
424
|
+
* Must be < @ref AVStreamGroup.nb_streams "nb_streams".
|
|
425
|
+
*/
|
|
426
|
+
idx: int32;
|
|
427
|
+
/**
|
|
428
|
+
* Offset in pixels from the left edge of the canvas where the tile
|
|
429
|
+
* should be placed.
|
|
430
|
+
*/
|
|
431
|
+
horizontal: int32;
|
|
432
|
+
/**
|
|
433
|
+
* Offset in pixels from the top edge of the canvas where the tile
|
|
434
|
+
* should be placed.
|
|
435
|
+
*/
|
|
436
|
+
vertical: int32;
|
|
437
|
+
}[];
|
|
438
|
+
/**
|
|
439
|
+
* The pixel value per channel in RGBA format used if no pixel of any tile
|
|
440
|
+
* is located at a particular pixel location.
|
|
441
|
+
*
|
|
442
|
+
* @see av_image_fill_color().
|
|
443
|
+
* @see av_parse_color().
|
|
444
|
+
*/
|
|
445
|
+
background: uint8[];
|
|
446
|
+
/**
|
|
447
|
+
* Offset in pixels from the left edge of the canvas where the actual image
|
|
448
|
+
* meant for presentation starts.
|
|
449
|
+
*
|
|
450
|
+
* This field must be >= 0 and < @ref coded_width.
|
|
451
|
+
*/
|
|
452
|
+
horizontalOffset: int32;
|
|
453
|
+
/**
|
|
454
|
+
* Offset in pixels from the top edge of the canvas where the actual image
|
|
455
|
+
* meant for presentation starts.
|
|
456
|
+
*
|
|
457
|
+
* This field must be >= 0 and < @ref coded_height.
|
|
458
|
+
*/
|
|
459
|
+
verticalOffset: int32;
|
|
460
|
+
/**
|
|
461
|
+
* Width of the final image for presentation.
|
|
462
|
+
*
|
|
463
|
+
* Must be > 0 and <= (@ref coded_width - @ref horizontal_offset).
|
|
464
|
+
* When it's not equal to (@ref coded_width - @ref horizontal_offset), the
|
|
465
|
+
* result of (@ref coded_width - width - @ref horizontal_offset) is the
|
|
466
|
+
* amount amount of pixels to be cropped from the right edge of the
|
|
467
|
+
* final image before presentation.
|
|
468
|
+
*/
|
|
469
|
+
width: int32;
|
|
470
|
+
/**
|
|
471
|
+
* Height of the final image for presentation.
|
|
472
|
+
*
|
|
473
|
+
* Must be > 0 and <= (@ref coded_height - @ref vertical_offset).
|
|
474
|
+
* When it's not equal to (@ref coded_height - @ref vertical_offset), the
|
|
475
|
+
* result of (@ref coded_height - height - @ref vertical_offset) is the
|
|
476
|
+
* amount amount of pixels to be cropped from the bottom edge of the
|
|
477
|
+
* final image before presentation.
|
|
478
|
+
*/
|
|
479
|
+
height: int32;
|
|
480
|
+
/**
|
|
481
|
+
* Additional data associated with the grid.
|
|
482
|
+
*
|
|
483
|
+
* Should be allocated with av_packet_side_data_new() or
|
|
484
|
+
* av_packet_side_data_add(), and will be freed by avformat_free_context().
|
|
485
|
+
*/
|
|
486
|
+
sideData: Partial<Record<AVPacketSideDataType, Uint8Array>>;
|
|
487
|
+
}
|
|
488
|
+
export declare class AVStreamGroup {
|
|
489
|
+
/**
|
|
490
|
+
* format private data
|
|
491
|
+
*/
|
|
492
|
+
privData: Data;
|
|
493
|
+
/**
|
|
494
|
+
* Group index in AVFormatContext.
|
|
495
|
+
*/
|
|
496
|
+
index: int32;
|
|
497
|
+
/**
|
|
498
|
+
* Group type-specific group ID.
|
|
499
|
+
*
|
|
500
|
+
* decoding: set by libavformat
|
|
501
|
+
* encoding: may set by the user
|
|
502
|
+
*/
|
|
503
|
+
id: int32;
|
|
504
|
+
/**
|
|
505
|
+
* Group type
|
|
506
|
+
*
|
|
507
|
+
* decoding: set by libavformat on group creation
|
|
508
|
+
* encoding: set by avformat_stream_group_create()
|
|
509
|
+
*/
|
|
510
|
+
type: AVStreamGroupParamsType;
|
|
511
|
+
/**
|
|
512
|
+
* Group type-specific parameters
|
|
513
|
+
*/
|
|
514
|
+
params: AVStreamGroupTileGrid;
|
|
515
|
+
/**
|
|
516
|
+
* Metadata that applies to the whole group.
|
|
517
|
+
*
|
|
518
|
+
* - demuxing: set by libavformat on group creation
|
|
519
|
+
* - muxing: may be set by the caller before avformat_write_header()
|
|
520
|
+
*
|
|
521
|
+
* Freed by libavformat in avformat_free_context().
|
|
522
|
+
*/
|
|
523
|
+
metadata: Data;
|
|
524
|
+
/**
|
|
525
|
+
* A list of streams in the group. New entries are created with
|
|
526
|
+
* avformat_stream_group_add_stream().
|
|
527
|
+
*
|
|
528
|
+
* - demuxing: entries are created by libavformat on group creation.
|
|
529
|
+
* If AVFMTCTX_NOHEADER is set in ctx_flags, then new entries may also
|
|
530
|
+
* appear in av_read_frame().
|
|
531
|
+
* - muxing: entries are created by the user before avformat_write_header().
|
|
532
|
+
*
|
|
533
|
+
* Freed by libavformat in avformat_free_context().
|
|
534
|
+
*/
|
|
535
|
+
streams: AVStream[];
|
|
536
|
+
/**
|
|
537
|
+
* Stream group disposition - a combination of AV_DISPOSITION_* flags.
|
|
538
|
+
* This field currently applies to all defined AVStreamGroupParamsType.
|
|
539
|
+
*
|
|
540
|
+
* - demuxing: set by libavformat when creating the group or in
|
|
541
|
+
* avformat_find_stream_info().
|
|
542
|
+
* - muxing: may be set by the caller before avformat_write_header().
|
|
543
|
+
*/
|
|
544
|
+
disposition: int32;
|
|
312
545
|
destroy(): void;
|
|
313
546
|
}
|
|
314
547
|
export interface AVStreamInterface {
|
|
315
|
-
index:
|
|
316
|
-
id:
|
|
548
|
+
index: int32;
|
|
549
|
+
id: int32;
|
|
317
550
|
codecpar: pointer<AVCodecParameters>;
|
|
318
551
|
nbFrames: int64;
|
|
319
552
|
metadata: Data;
|
|
@@ -321,6 +554,16 @@ export interface AVStreamInterface {
|
|
|
321
554
|
startTime: int64;
|
|
322
555
|
disposition: int32;
|
|
323
556
|
timeBase: Rational;
|
|
557
|
+
attachedPic: pointer<AVPacket>;
|
|
558
|
+
}
|
|
559
|
+
export interface AVStreamGroupInterface {
|
|
560
|
+
index: int32;
|
|
561
|
+
id: int32;
|
|
562
|
+
type: AVStreamGroupParamsType;
|
|
563
|
+
params: AVStreamGroupTileGrid;
|
|
564
|
+
metadata: Data;
|
|
565
|
+
streams: AVStreamInterface[];
|
|
566
|
+
disposition: int32;
|
|
324
567
|
}
|
|
325
568
|
export interface AVStreamMetadataEncryption {
|
|
326
569
|
schemeType: number;
|
package/dist/cjs/AVStream.js
CHANGED
|
@@ -8,9 +8,9 @@ var __importDefault = this && this.__importDefault || function(mod) {
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", {
|
|
10
10
|
value: !0
|
|
11
|
-
});
|
|
11
|
+
}), exports.AVStreamGroup = exports.AVStreamGroupTileGrid = void 0;
|
|
12
12
|
|
|
13
|
-
const cheap__identifier__0 = require("./struct/avcodecparameters"), cheap__identifier__1 = require("@libmedia/cheap/std/make"), cheap__identifier__2 = require("./struct/rational"), cheap__identifier__4 = require("@libmedia/cheap/std/unmake"), avcodecparameters_1 = __importDefault(require("./struct/avcodecparameters")), constant_1 = require("./constant");
|
|
13
|
+
const cheap__identifier__0 = require("./struct/avcodecparameters"), cheap__identifier__1 = require("@libmedia/cheap/std/make"), cheap__identifier__2 = require("./struct/rational"), cheap__identifier__4 = require("@libmedia/cheap/std/unmake"), avcodecparameters_1 = __importDefault(require("./struct/avcodecparameters")), constant_1 = require("./constant"), avpacket_1 = require("./util/avpacket");
|
|
14
14
|
|
|
15
15
|
exports.default = class {
|
|
16
16
|
index=constant_1.NOPTS_VALUE;
|
|
@@ -25,13 +25,42 @@ exports.default = class {
|
|
|
25
25
|
startTime=constant_1.NOPTS_VALUE_BIGINT;
|
|
26
26
|
firstDTS=constant_1.NOPTS_VALUE_BIGINT;
|
|
27
27
|
disposition=0;
|
|
28
|
+
discard=-16;
|
|
28
29
|
timeBase=cheap__identifier__1.default(cheap__identifier__2.Rational);
|
|
29
30
|
sampleIndexes=[];
|
|
30
31
|
sampleIndexesPosMap=new Map;
|
|
32
|
+
attachedPic=0;
|
|
31
33
|
destroy() {
|
|
32
34
|
this.codecpar && (this.codecpar.destroy(), cheap__identifier__4.default(this.codecpar),
|
|
33
35
|
this.codecpar = null), this.timeBase && (cheap__identifier__4.default(this.timeBase),
|
|
34
|
-
this.timeBase = null), this.
|
|
36
|
+
this.timeBase = null), this.attachedPic && ((0, avpacket_1.destroyAVPacket)(this.attachedPic),
|
|
37
|
+
this.attachedPic = 0), this.sampleIndexes.length = 0, this.sampleIndexesPosMap.clear();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
exports.AVStreamGroupTileGrid = class {
|
|
42
|
+
codedWidth=0;
|
|
43
|
+
codedHeight=0;
|
|
44
|
+
offsets=[];
|
|
45
|
+
background=null;
|
|
46
|
+
horizontalOffset=constant_1.NOPTS_VALUE;
|
|
47
|
+
verticalOffset=constant_1.NOPTS_VALUE;
|
|
48
|
+
width=0;
|
|
49
|
+
height=0;
|
|
50
|
+
sideData={};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
exports.AVStreamGroup = class {
|
|
54
|
+
privData=null;
|
|
55
|
+
index=constant_1.NOPTS_VALUE;
|
|
56
|
+
id=constant_1.NOPTS_VALUE;
|
|
57
|
+
type=0;
|
|
58
|
+
params=null;
|
|
59
|
+
metadata={};
|
|
60
|
+
streams=[];
|
|
61
|
+
disposition=0;
|
|
62
|
+
destroy() {
|
|
63
|
+
this.streams.length = 0, this.params = null;
|
|
35
64
|
}
|
|
36
65
|
};
|
|
37
66
|
//# sourceMappingURL=AVStream.js.map
|
package/dist/cjs/AVStream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["avcodecparameters_1","__importDefault","require","constant_1","exports","default","index","NOPTS_VALUE","id","privData","privateData2","codecpar","cheap__identifier__1","cheap__identifier__0","sideData","nbFrames","BigInt","metadata","duration","NOPTS_VALUE_BIGINT","startTime","firstDTS","disposition","timeBase","cheap__identifier__2","Rational","sampleIndexes","sampleIndexesPosMap","Map","destroy","this","cheap__identifier__4","length","clear"],"sources":["../../AVStream.ts"],"mappings":";;;;;;;;;;;;mPA0BAA,sBAAAC,gBAAAC,QAAA,gCAEAC,aAAAD,QAAA;;
|
|
1
|
+
{"version":3,"names":["avcodecparameters_1","__importDefault","require","constant_1","avpacket_1","exports","default","index","NOPTS_VALUE","id","privData","privateData2","codecpar","cheap__identifier__1","cheap__identifier__0","sideData","nbFrames","BigInt","metadata","duration","NOPTS_VALUE_BIGINT","startTime","firstDTS","disposition","discard","timeBase","cheap__identifier__2","Rational","sampleIndexes","sampleIndexesPosMap","Map","attachedPic","destroy","this","cheap__identifier__4","destroyAVPacket","length","clear","AVStreamGroupTileGrid","codedWidth","codedHeight","offsets","background","horizontalOffset","verticalOffset","width","height","AVStreamGroup","type","params","streams"],"sources":["../../AVStream.ts"],"mappings":";;;;;;;;;;;;mPA0BAA,sBAAAC,gBAAAC,QAAA,gCAEAC,aAAAD,QAAA,eAGAE,aAAAF,QAAA;;AA6SAG,QAAAC,UAAA;IAIEC,MAAeJ,WAAAK;IAOfC,GAAYN,WAAAK;IAKZE,SAAiB;IAIjBC,aAAqB;IAErBC,SAAQC,qBAAAP,QAA8C,IAAIN,oBAAAM,SAAmBQ,qBAAAR;IAiB7ES,SAA8D;IAK9DC,SAAQC,OAAA;IAERC,SAAiB;IAUjBC,SAAkBhB,WAAAiB;IAUlBC,UAAmBlB,WAAAiB;IAKnBE,SAAkBnB,WAAAiB;IAKlBG,YAAW;IAKXC,SAAO;IAcPC,SAAQZ,qBAAAP,QAAAoB,qBAAAC;IAKRC,cAOM;IAKNC,oBAAyC,IAAIC;IAS7CC,YAAW;IAEJ,OAAAC;QACDC,KAAKrB,aACPqB,KAAKrB,SAASoB,WACdE,qBAAA5B,QAAO2B,KAAKrB;QACZqB,KAAKrB,WAAW,OAEdqB,KAAKR,aACPS,qBAAA5B,QAAO2B,KAAKR;QACZQ,KAAKR,WAAW,OAEdQ,KAAKF,iBACP,GAAA3B,WAAA+B,iBAAgBF,KAAKF;QACrBE,KAAKF,cAAW,IAElBE,KAAKL,cAAcQ,SAAS,GAC5BH,KAAKJ,oBAAoBQ;AAC3B;;;AAGFhC,QAAAiC,wBAAA;IAMEC,WAAoB;IAMpBC,YAAqB;IAYrBC,QAiBM;IASNC,WAAsB;IAQtBC,iBAA0BxC,WAAAK;IAQ1BoC,eAAwBzC,WAAAK;IAWxBqC,MAAe;IAWfC,OAAgB;IAQhB/B,SAA8D;;;AAGhEV,QAAA0C,gBAAA;IAIErC,SAAiB;IAKjBH,MAAeJ,WAAAK;IAQfC,GAAYN,WAAAK;IAQZwC,KAAI;IAKJC,OAAgC;IAUhC/B,SAAiB;IAajBgC,QAAsB;IAUtB3B,YAAqB;IAErB,OAAAS;QACEC,KAAKiB,QAAQd,SAAS,GACtBH,KAAKgB,SAAS;AAChB","ignoreList":[]}
|
package/dist/cjs/avformat.d.ts
CHANGED
package/dist/cjs/codec.d.ts
CHANGED
|
@@ -851,6 +851,70 @@ export declare const enum AVPacketSideDataType {
|
|
|
851
851
|
* SMPTE 2094-40:2016 standard.
|
|
852
852
|
*/
|
|
853
853
|
AV_PKT_DATA_DYNAMIC_HDR10_PLUS = 31,
|
|
854
|
+
/**
|
|
855
|
+
* IAMF Mix Gain Parameter Data associated with the audio frame. This metadata
|
|
856
|
+
* is in the form of the AVIAMFParamDefinition struct and contains information
|
|
857
|
+
* defined in sections 3.6.1 and 3.8.1 of the Immersive Audio Model and
|
|
858
|
+
* Formats standard.
|
|
859
|
+
*/
|
|
860
|
+
AV_PKT_DATA_IAMF_MIX_GAIN_PARAM = 32,
|
|
861
|
+
/**
|
|
862
|
+
* IAMF Demixing Info Parameter Data associated with the audio frame. This
|
|
863
|
+
* metadata is in the form of the AVIAMFParamDefinition struct and contains
|
|
864
|
+
* information defined in sections 3.6.1 and 3.8.2 of the Immersive Audio Model
|
|
865
|
+
* and Formats standard.
|
|
866
|
+
*/
|
|
867
|
+
AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM = 33,
|
|
868
|
+
/**
|
|
869
|
+
* IAMF Recon Gain Info Parameter Data associated with the audio frame. This
|
|
870
|
+
* metadata is in the form of the AVIAMFParamDefinition struct and contains
|
|
871
|
+
* information defined in sections 3.6.1 and 3.8.3 of the Immersive Audio Model
|
|
872
|
+
* and Formats standard.
|
|
873
|
+
*/
|
|
874
|
+
AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM = 34,
|
|
875
|
+
/**
|
|
876
|
+
* Ambient viewing environment metadata, as defined by H.274. This metadata
|
|
877
|
+
* should be associated with a video stream and contains data in the form
|
|
878
|
+
* of the AVAmbientViewingEnvironment struct.
|
|
879
|
+
*/
|
|
880
|
+
AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT = 35,
|
|
881
|
+
/**
|
|
882
|
+
* The number of pixels to discard from the top/bottom/left/right border of the
|
|
883
|
+
* decoded frame to obtain the sub-rectangle intended for presentation.
|
|
884
|
+
*
|
|
885
|
+
* @code
|
|
886
|
+
* u32le crop_top
|
|
887
|
+
* u32le crop_bottom
|
|
888
|
+
* u32le crop_left
|
|
889
|
+
* u32le crop_right
|
|
890
|
+
* @endcode
|
|
891
|
+
*/
|
|
892
|
+
AV_PKT_DATA_FRAME_CROPPING = 36,
|
|
893
|
+
/**
|
|
894
|
+
* Raw LCEVC payload data, as a uint8_t array, with NAL emulation
|
|
895
|
+
* bytes intact.
|
|
896
|
+
*/
|
|
897
|
+
AV_PKT_DATA_LCEVC = 37,
|
|
898
|
+
/**
|
|
899
|
+
* This side data contains information about the reference display width(s)
|
|
900
|
+
* and reference viewing distance(s) as well as information about the
|
|
901
|
+
* corresponding reference stereo pair(s), i.e., the pair(s) of views to be
|
|
902
|
+
* displayed for the viewer's left and right eyes on the reference display
|
|
903
|
+
* at the reference viewing distance.
|
|
904
|
+
* The payload is the AV3DReferenceDisplaysInfo struct defined in
|
|
905
|
+
* libavutil/tdrdi.h.
|
|
906
|
+
*/
|
|
907
|
+
AV_PKT_DATA_3D_REFERENCE_DISPLAYS = 38,
|
|
908
|
+
/**
|
|
909
|
+
* Contains the last received RTCP SR (Sender Report) information
|
|
910
|
+
* in the form of the AVRTCPSenderReport struct.
|
|
911
|
+
*/
|
|
912
|
+
AV_PKT_DATA_RTCP_SR = 39,
|
|
913
|
+
/**
|
|
914
|
+
* Extensible image file format metadata. The payload is a buffer containing
|
|
915
|
+
* EXIF metadata, starting with either 49 49 2a 00, or 4d 4d 00 2a.
|
|
916
|
+
*/
|
|
917
|
+
AV_PKT_DATA_EXIF = 40,
|
|
854
918
|
/**
|
|
855
919
|
* The number of side data types.
|
|
856
920
|
* This is not part of the public API/ABI in the sense that it may
|
|
@@ -859,5 +923,5 @@ export declare const enum AVPacketSideDataType {
|
|
|
859
923
|
* If its value becomes huge, some code using it
|
|
860
924
|
* needs to be updated as it assumes it to be smaller than other limits.
|
|
861
925
|
*/
|
|
862
|
-
AV_PKT_DATA_NB =
|
|
926
|
+
AV_PKT_DATA_NB = 41
|
|
863
927
|
}
|
package/dist/cjs/codecs/aac.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AVPacketSideDataType } from "../codec";
|
|
2
|
-
import AVCodecParameters from "../struct/avcodecparameters";
|
|
2
|
+
import type AVCodecParameters from "../struct/avcodecparameters";
|
|
3
3
|
import BitReader from "@libmedia/common/io/BitReader";
|
|
4
|
-
import { Uint8ArrayInterface } from "@libmedia/common/io/interface";
|
|
4
|
+
import type { Uint8ArrayInterface } from "@libmedia/common/io/interface";
|
|
5
5
|
export declare const enum MPEG4AudioObjectTypes {
|
|
6
6
|
NULL = 0,
|
|
7
7
|
/**
|
package/dist/cjs/codecs/ac3.d.ts
CHANGED
package/dist/cjs/codecs/av1.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AVPacketSideDataType } from "../codec";
|
|
2
|
-
import { Uint8ArrayInterface } from "@libmedia/common/io/interface";
|
|
3
|
-
import AVCodecParameters from "../struct/avcodecparameters";
|
|
2
|
+
import type { Uint8ArrayInterface } from "@libmedia/common/io/interface";
|
|
3
|
+
import type AVCodecParameters from "../struct/avcodecparameters";
|
|
4
4
|
export declare const enum AV1Profile {
|
|
5
5
|
Main = 0,
|
|
6
6
|
High = 1,
|
package/dist/cjs/codecs/dts.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AVPacketSideDataType } from "../codec";
|
|
2
|
-
import { Uint8ArrayInterface } from "@libmedia/common/io/interface";
|
|
3
|
-
import AVCodecParameters from "../struct/avcodecparameters";
|
|
2
|
+
import type { Uint8ArrayInterface } from "@libmedia/common/io/interface";
|
|
3
|
+
import type AVCodecParameters from "../struct/avcodecparameters";
|
|
4
4
|
export declare const enum MetaDataBlockType {
|
|
5
5
|
STREAMINFO = 0,
|
|
6
6
|
PADDING = 1,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import AVPacket from "../struct/avpacket";
|
|
1
|
+
import type AVPacket from "../struct/avpacket";
|
|
2
2
|
import { AVPacketSideDataType } from "../codec";
|
|
3
|
-
import { Uint8ArrayInterface } from "@libmedia/common/io/interface";
|
|
4
|
-
import AVCodecParameters from "../struct/avcodecparameters";
|
|
5
|
-
import { Data } from "@libmedia/common/types/type";
|
|
3
|
+
import type { Uint8ArrayInterface } from "@libmedia/common/io/interface";
|
|
4
|
+
import type AVCodecParameters from "../struct/avcodecparameters";
|
|
5
|
+
import type { Data } from "@libmedia/common/types/type";
|
|
6
6
|
export declare const H264_MAX_DPB_FRAMES = 16;
|
|
7
7
|
export declare const NALULengthSizeMinusOne = 3;
|
|
8
8
|
export declare const enum PictureType {
|
|
@@ -159,7 +159,7 @@ export declare function annexbAddExtradata(data: Uint8ArrayInterface, extradata:
|
|
|
159
159
|
*
|
|
160
160
|
* 需要保证 data 是 safe 的
|
|
161
161
|
*/
|
|
162
|
-
export declare function avcc2Annexb(data: Uint8ArrayInterface, extradata?: Uint8ArrayInterface): {
|
|
162
|
+
export declare function avcc2Annexb(data: Uint8ArrayInterface, extradata?: Uint8ArrayInterface, naluLengthSizeMinusOne?: int32): {
|
|
163
163
|
key: boolean;
|
|
164
164
|
bufferPointer: pointer<uint8>;
|
|
165
165
|
length: number;
|
package/dist/cjs/codecs/h264.js
CHANGED
|
@@ -94,8 +94,8 @@ exports.annexbExtradata2AvccExtradata = function(data) {
|
|
|
94
94
|
7 === type ? spss.push(nalu) : 8 === type ? ppss.push(nalu) : 13 === type ? spsExts.push(nalu) : 6 === type ? seis.push(nalu) : 9 !== type && others.push(nalu);
|
|
95
95
|
})), nalus2Annexb(spss, ppss, spsExts, seis, others);
|
|
96
96
|
}
|
|
97
|
-
}, exports.avcc2Annexb = function(data, extradata) {
|
|
98
|
-
|
|
97
|
+
}, exports.avcc2Annexb = function(data, extradata, naluLengthSizeMinusOne = exports.NALULengthSizeMinusOne) {
|
|
98
|
+
extradata && (naluLengthSizeMinusOne = 3 & extradata[4]);
|
|
99
99
|
let spss = [], ppss = [], spsExts = [], key = !1;
|
|
100
100
|
if (extradata) {
|
|
101
101
|
const result = extradata2SpsPps(extradata);
|
|
@@ -115,7 +115,6 @@ exports.annexbExtradata2AvccExtradata = function(data) {
|
|
|
115
115
|
if (extradata && naluUtil.isAnnexb(extradata)) array.each(naluUtil.splitNaluByStartCode(extradata), (nalu => {
|
|
116
116
|
if (7 === (31 & nalu[0])) return sps = nalu, !1;
|
|
117
117
|
})); else if (extradata && extradata.length >= 6) {
|
|
118
|
-
stream.metadata.naluLengthSizeMinusOne = 3 & extradata[4];
|
|
119
118
|
const {spss: spss} = extradata2SpsPps(extradata);
|
|
120
119
|
spss.length && (sps = spss[0]);
|
|
121
120
|
}
|
|
@@ -182,8 +181,8 @@ function extradata2SpsPps(extradata) {
|
|
|
182
181
|
}
|
|
183
182
|
|
|
184
183
|
function spsPps2Extradata(spss, ppss, spsExts = []) {
|
|
185
|
-
spss.length > 32 && (logger.warn(`h264 metadata's sps max length is 32, but get ${spss.length}`, cheap__fileName__0,
|
|
186
|
-
spss = spss.slice(0, 32)), spss.length > 256 && (logger.warn(`h264 metadata's pps max length is 256, but get ${spss.length}`, cheap__fileName__0,
|
|
184
|
+
spss.length > 32 && (logger.warn(`h264 metadata's sps max length is 32, but get ${spss.length}`, cheap__fileName__0, 218),
|
|
185
|
+
spss = spss.slice(0, 32)), spss.length > 256 && (logger.warn(`h264 metadata's pps max length is 256, but get ${spss.length}`, cheap__fileName__0, 222),
|
|
187
186
|
spss = spss.slice(0, 256));
|
|
188
187
|
let length = 7;
|
|
189
188
|
length = spss.reduce(((prev, sps) => prev + 2 + sps.length), length), length = ppss.reduce(((prev, pps) => prev + 2 + pps.length), length);
|