node-av 1.2.0 → 2.0.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/README.md +37 -59
- package/dist/api/bitstream-filter.d.ts +5 -2
- package/dist/api/bitstream-filter.js +7 -4
- package/dist/api/bitstream-filter.js.map +1 -1
- package/dist/api/decoder.d.ts +135 -119
- package/dist/api/decoder.js +195 -202
- package/dist/api/decoder.js.map +1 -1
- package/dist/api/encoder.d.ts +141 -78
- package/dist/api/encoder.js +241 -193
- package/dist/api/encoder.js.map +1 -1
- package/dist/api/filter-presets.d.ts +699 -573
- package/dist/api/filter-presets.js +1157 -840
- package/dist/api/filter-presets.js.map +1 -1
- package/dist/api/filter.d.ts +180 -157
- package/dist/api/filter.js +314 -366
- package/dist/api/filter.js.map +1 -1
- package/dist/api/hardware.d.ts +28 -29
- package/dist/api/hardware.js +80 -74
- package/dist/api/hardware.js.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/io-stream.d.ts +6 -0
- package/dist/api/io-stream.js +6 -0
- package/dist/api/io-stream.js.map +1 -1
- package/dist/api/media-input.d.ts +2 -1
- package/dist/api/media-input.js +3 -8
- package/dist/api/media-input.js.map +1 -1
- package/dist/api/media-output.d.ts +37 -126
- package/dist/api/media-output.js +138 -206
- package/dist/api/media-output.js.map +1 -1
- package/dist/api/pipeline.d.ts +193 -0
- package/dist/api/pipeline.js +36 -42
- package/dist/api/pipeline.js.map +1 -1
- package/dist/api/types.d.ts +22 -57
- package/dist/api/utilities/audio-sample.d.ts +0 -8
- package/dist/api/utilities/audio-sample.js +0 -8
- package/dist/api/utilities/audio-sample.js.map +1 -1
- package/dist/api/utilities/channel-layout.d.ts +0 -8
- package/dist/api/utilities/channel-layout.js +0 -8
- package/dist/api/utilities/channel-layout.js.map +1 -1
- package/dist/api/utilities/image.d.ts +0 -8
- package/dist/api/utilities/image.js +0 -8
- package/dist/api/utilities/image.js.map +1 -1
- package/dist/api/utilities/index.d.ts +3 -3
- package/dist/api/utilities/index.js +3 -3
- package/dist/api/utilities/index.js.map +1 -1
- package/dist/api/utilities/media-type.d.ts +1 -9
- package/dist/api/utilities/media-type.js +1 -9
- package/dist/api/utilities/media-type.js.map +1 -1
- package/dist/api/utilities/pixel-format.d.ts +1 -9
- package/dist/api/utilities/pixel-format.js +1 -9
- package/dist/api/utilities/pixel-format.js.map +1 -1
- package/dist/api/utilities/sample-format.d.ts +1 -9
- package/dist/api/utilities/sample-format.js +1 -9
- package/dist/api/utilities/sample-format.js.map +1 -1
- package/dist/api/utilities/streaming.d.ts +0 -8
- package/dist/api/utilities/streaming.js +0 -8
- package/dist/api/utilities/streaming.js.map +1 -1
- package/dist/api/utilities/timestamp.d.ts +0 -8
- package/dist/api/utilities/timestamp.js +0 -8
- package/dist/api/utilities/timestamp.js.map +1 -1
- package/dist/api/utils.js +2 -0
- package/dist/api/utils.js.map +1 -1
- package/dist/constants/constants.d.ts +1 -1
- package/dist/constants/constants.js +2 -0
- package/dist/constants/constants.js.map +1 -1
- package/dist/lib/binding.d.ts +1 -0
- package/dist/lib/binding.js +2 -0
- package/dist/lib/binding.js.map +1 -1
- package/dist/lib/codec.d.ts +4 -4
- package/dist/lib/codec.js +4 -4
- package/dist/lib/dictionary.d.ts +2 -2
- package/dist/lib/dictionary.js +2 -2
- package/dist/lib/dictionary.js.map +1 -1
- package/dist/lib/error.d.ts +1 -1
- package/dist/lib/error.js +1 -1
- package/dist/lib/filter-context.d.ts +19 -2
- package/dist/lib/filter-context.js +15 -0
- package/dist/lib/filter-context.js.map +1 -1
- package/dist/lib/format-context.d.ts +18 -18
- package/dist/lib/format-context.js +20 -20
- package/dist/lib/format-context.js.map +1 -1
- package/dist/lib/frame.d.ts +43 -1
- package/dist/lib/frame.js +53 -0
- package/dist/lib/frame.js.map +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/native-types.d.ts +1 -0
- package/dist/lib/option.d.ts +176 -0
- package/dist/lib/option.js +176 -0
- package/dist/lib/option.js.map +1 -1
- package/dist/lib/utilities.d.ts +64 -1
- package/dist/lib/utilities.js +65 -0
- package/dist/lib/utilities.js.map +1 -1
- package/install/ffmpeg.js +0 -11
- package/package.json +16 -18
- package/release_notes.md +0 -48
package/dist/lib/utilities.js
CHANGED
|
@@ -18,6 +18,8 @@ import { FFmpegError } from './error.js';
|
|
|
18
18
|
* const bytesS16 = avGetBytesPerSample(AV_SAMPLE_FMT_S16); // Returns 2
|
|
19
19
|
* const bytesFloat = avGetBytesPerSample(AV_SAMPLE_FMT_FLTP); // Returns 4
|
|
20
20
|
* ```
|
|
21
|
+
*
|
|
22
|
+
* @see [av_get_bytes_per_sample](https://ffmpeg.org/doxygen/7.1/group__lavu__sampfmts.html#ga0c3c218e1dd570ad4917c69a35a6c77d) - FFmpeg Doxygen
|
|
21
23
|
*/
|
|
22
24
|
export function avGetBytesPerSample(sampleFmt) {
|
|
23
25
|
return bindings.avGetBytesPerSample(sampleFmt);
|
|
@@ -39,6 +41,8 @@ export function avGetBytesPerSample(sampleFmt) {
|
|
|
39
41
|
* const name1 = avGetSampleFmtName(AV_SAMPLE_FMT_S16); // Returns "s16"
|
|
40
42
|
* const name2 = avGetSampleFmtName(AV_SAMPLE_FMT_FLTP); // Returns "fltp"
|
|
41
43
|
* ```
|
|
44
|
+
*
|
|
45
|
+
* @see [av_get_sample_fmt_name](https://ffmpeg.org/doxygen/7.1/group__lavu__sampfmts.html#ga31b9d149b2de9821a65f4f5612970838) - FFmpeg Doxygen
|
|
42
46
|
*/
|
|
43
47
|
export function avGetSampleFmtName(sampleFmt) {
|
|
44
48
|
return bindings.avGetSampleFmtName(sampleFmt);
|
|
@@ -62,6 +66,7 @@ export function avGetSampleFmtName(sampleFmt) {
|
|
|
62
66
|
* const same = avGetPackedSampleFmt(AV_SAMPLE_FMT_FLT); // Returns AV_SAMPLE_FMT_FLT
|
|
63
67
|
* ```
|
|
64
68
|
*
|
|
69
|
+
* @see [av_get_packed_sample_fmt](https://ffmpeg.org/doxygen/7.1/group__lavu__sampfmts.html#ga7817ec0eff4dc6fc0962f31e6d138bca) - FFmpeg Doxygen
|
|
65
70
|
* @see {@link avGetPlanarSampleFmt} For getting planar version
|
|
66
71
|
*/
|
|
67
72
|
export function avGetPackedSampleFmt(sampleFmt) {
|
|
@@ -86,6 +91,7 @@ export function avGetPackedSampleFmt(sampleFmt) {
|
|
|
86
91
|
* const same = avGetPlanarSampleFmt(AV_SAMPLE_FMT_FLTP); // Returns AV_SAMPLE_FMT_FLTP
|
|
87
92
|
* ```
|
|
88
93
|
*
|
|
94
|
+
* @see [av_get_planar_sample_fmt](https://ffmpeg.org/doxygen/7.1/group__lavu__sampfmts.html#ga82caf838259d95cc6c4fd87633bb0e19) - FFmpeg Doxygen
|
|
89
95
|
* @see {@link avGetPackedSampleFmt} For getting packed version
|
|
90
96
|
*/
|
|
91
97
|
export function avGetPlanarSampleFmt(sampleFmt) {
|
|
@@ -109,10 +115,37 @@ export function avGetPlanarSampleFmt(sampleFmt) {
|
|
|
109
115
|
* const isPacked = avSampleFmtIsPlanar(AV_SAMPLE_FMT_S16); // Returns false
|
|
110
116
|
* const isPlanar = avSampleFmtIsPlanar(AV_SAMPLE_FMT_S16P); // Returns true
|
|
111
117
|
* ```
|
|
118
|
+
*
|
|
119
|
+
* @see [av_sample_fmt_is_planar](https://ffmpeg.org/doxygen/7.1/group__lavu__sampfmts.html#ga06ba8a64dc4382c422789a5d0b6bf592) - FFmpeg Doxygen
|
|
112
120
|
*/
|
|
113
121
|
export function avSampleFmtIsPlanar(sampleFmt) {
|
|
114
122
|
return bindings.avSampleFmtIsPlanar(sampleFmt);
|
|
115
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Get codec name from codec ID.
|
|
126
|
+
*
|
|
127
|
+
* Returns the canonical codec name corresponding to the codec ID.
|
|
128
|
+
*
|
|
129
|
+
* Direct mapping to avcodec_get_name().
|
|
130
|
+
*
|
|
131
|
+
* @param codecId - Codec ID from AVCodecID enum
|
|
132
|
+
* @returns Codec name string or null
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* import { AV_CODEC_ID_H264, AV_CODEC_ID_HEVC } from 'node-av/constants';
|
|
137
|
+
* import { avGetCodecName } from 'node-av/lib';
|
|
138
|
+
*
|
|
139
|
+
* const h264Name = avGetCodecName(AV_CODEC_ID_H264); // Returns "h264"
|
|
140
|
+
* const hevcName = avGetCodecName(AV_CODEC_ID_HEVC); // Returns "hevc"
|
|
141
|
+
* const unknownName = avGetCodecName(99999); // Returns null
|
|
142
|
+
* ```
|
|
143
|
+
*
|
|
144
|
+
* @see [avcodec_get_name](https://ffmpeg.org/doxygen/7.1/group__lavc__core.html#ga2016a52e94f867ebe5113bdf448e182d) - FFmpeg Doxygen
|
|
145
|
+
*/
|
|
146
|
+
export function avGetCodecName(codecId) {
|
|
147
|
+
return bindings.avGetCodecName(codecId);
|
|
148
|
+
}
|
|
116
149
|
/**
|
|
117
150
|
* Get pixel format name.
|
|
118
151
|
*
|
|
@@ -130,6 +163,8 @@ export function avSampleFmtIsPlanar(sampleFmt) {
|
|
|
130
163
|
* const name1 = avGetPixFmtName(AV_PIX_FMT_YUV420P); // Returns "yuv420p"
|
|
131
164
|
* const name2 = avGetPixFmtName(AV_PIX_FMT_RGB24); // Returns "rgb24"
|
|
132
165
|
* ```
|
|
166
|
+
*
|
|
167
|
+
* @see [av_get_pix_fmt_name](https://ffmpeg.org/doxygen/7.1/pixdesc_8c.html#ab92e2a8a9b58c982560c49df9f01e47e) - FFmpeg Doxygen
|
|
133
168
|
*/
|
|
134
169
|
export function avGetPixFmtName(pixFmt) {
|
|
135
170
|
return bindings.avGetPixFmtName(pixFmt);
|
|
@@ -150,6 +185,8 @@ export function avGetPixFmtName(pixFmt) {
|
|
|
150
185
|
* const fmt2 = avGetPixFmtFromName("rgb24"); // Returns AV_PIX_FMT_RGB24
|
|
151
186
|
* const none = avGetPixFmtFromName("invalid"); // Returns AV_PIX_FMT_NONE
|
|
152
187
|
* ```
|
|
188
|
+
*
|
|
189
|
+
* @see [av_get_pix_fmt](https://ffmpeg.org/doxygen/7.1/pixdesc_8h.html#a925ef18d69c24c3be8c53d5a7dc0660e) - FFmpeg Doxygen
|
|
153
190
|
*/
|
|
154
191
|
export function avGetPixFmtFromName(name) {
|
|
155
192
|
return bindings.avGetPixFmtFromName(name);
|
|
@@ -172,6 +209,8 @@ export function avGetPixFmtFromName(name) {
|
|
|
172
209
|
* const isSoftware = avIsHardwarePixelFormat(AV_PIX_FMT_YUV420P); // Returns false
|
|
173
210
|
* const isHardware = avIsHardwarePixelFormat(AV_PIX_FMT_CUDA); // Returns true
|
|
174
211
|
* ```
|
|
212
|
+
*
|
|
213
|
+
* @see [av_pix_fmt_desc_get](https://ffmpeg.org/doxygen/7.1/pixdesc_8c.html#afe0c3e8aef5173de28bbdaea4298f5f0) - FFmpeg Doxygen
|
|
175
214
|
*/
|
|
176
215
|
export function avIsHardwarePixelFormat(pixFmt) {
|
|
177
216
|
return bindings.avIsHardwarePixelFormat(pixFmt);
|
|
@@ -193,6 +232,8 @@ export function avIsHardwarePixelFormat(pixFmt) {
|
|
|
193
232
|
* const video = avGetMediaTypeString(AVMEDIA_TYPE_VIDEO); // Returns "video"
|
|
194
233
|
* const audio = avGetMediaTypeString(AVMEDIA_TYPE_AUDIO); // Returns "audio"
|
|
195
234
|
* ```
|
|
235
|
+
*
|
|
236
|
+
* @see [av_get_media_type_string](https://ffmpeg.org/doxygen/7.1/group__lavu__misc.html#gaf21645cfa855b2caf9699d7dc7b2d08e) - FFmpeg Doxygen
|
|
196
237
|
*/
|
|
197
238
|
export function avGetMediaTypeString(mediaType) {
|
|
198
239
|
return bindings.avGetMediaTypeString(mediaType);
|
|
@@ -224,6 +265,7 @@ export function avGetMediaTypeString(mediaType) {
|
|
|
224
265
|
* console.log(`Line sizes: ${linesizes}`);
|
|
225
266
|
* ```
|
|
226
267
|
*
|
|
268
|
+
* @see [av_image_alloc](https://ffmpeg.org/doxygen/7.1/group__lavu__picture.html#ga841e0a89a642e24141af1918a2c10448) - FFmpeg Doxygen
|
|
227
269
|
* @see {@link avImageGetBufferSize} To calculate size without allocating
|
|
228
270
|
*/
|
|
229
271
|
export function avImageAlloc(width, height, pixFmt, align) {
|
|
@@ -257,6 +299,8 @@ export function avImageAlloc(width, height, pixFmt, align) {
|
|
|
257
299
|
* AV_PIX_FMT_YUV420P, 1920, 1080
|
|
258
300
|
* );
|
|
259
301
|
* ```
|
|
302
|
+
*
|
|
303
|
+
* @see [av_image_copy2](https://ffmpeg.org/doxygen/7.1/group__lavu__picture.html#ga911cb7d723163b88bdbbdacbeeaacf2d) - FFmpeg Doxygen
|
|
260
304
|
*/
|
|
261
305
|
export function avImageCopy2(dstData, dstLinesizes, srcData, srcLinesizes, pixFmt, width, height) {
|
|
262
306
|
bindings.avImageCopy2(dstData, dstLinesizes, srcData, srcLinesizes, pixFmt, width, height);
|
|
@@ -282,6 +326,7 @@ export function avImageCopy2(dstData, dstLinesizes, srcData, srcLinesizes, pixFm
|
|
|
282
326
|
* console.log(`Need ${size} bytes for Full HD RGB24`);
|
|
283
327
|
* ```
|
|
284
328
|
*
|
|
329
|
+
* @see [av_image_get_buffer_size](https://ffmpeg.org/doxygen/7.1/group__lavu__picture.html#ga24a67963c3ae0054a2a4bab35930e694) - FFmpeg Doxygen
|
|
285
330
|
* @see {@link avImageAlloc} To allocate the buffer
|
|
286
331
|
*/
|
|
287
332
|
export function avImageGetBufferSize(pixFmt, width, height, align) {
|
|
@@ -313,6 +358,8 @@ export function avImageGetBufferSize(pixFmt, width, height, align) {
|
|
|
313
358
|
* AV_PIX_FMT_YUV420P, 1920, 1080, 1
|
|
314
359
|
* );
|
|
315
360
|
* ```
|
|
361
|
+
*
|
|
362
|
+
* @see [av_image_copy_to_buffer](https://ffmpeg.org/doxygen/7.1/group__lavu__picture.html#ga6f8576f1ef0c2d9a9f7c5ac7f9a28c52) - FFmpeg Doxygen
|
|
316
363
|
*/
|
|
317
364
|
export function avImageCopyToBuffer(dst, dstSize, srcData, srcLinesize, pixFmt, width, height, align) {
|
|
318
365
|
return bindings.avImageCopyToBuffer(dst, dstSize, srcData, srcLinesize, pixFmt, width, height, align);
|
|
@@ -332,6 +379,8 @@ export function avImageCopyToBuffer(dst, dstSize, srcData, srcLinesize, pixFmt,
|
|
|
332
379
|
* const str1 = avTs2Str(1234567n); // Returns "1234567"
|
|
333
380
|
* const str2 = avTs2Str(null); // Returns "NOPTS"
|
|
334
381
|
* ```
|
|
382
|
+
*
|
|
383
|
+
* @see [av_ts2str](https://ffmpeg.org/doxygen/7.1/timestamp_8h.html#a86d797e907fa454ed5fd34bfb0bcd747) - FFmpeg Doxygen
|
|
335
384
|
*/
|
|
336
385
|
export function avTs2Str(ts) {
|
|
337
386
|
return bindings.avTs2Str(ts);
|
|
@@ -352,6 +401,8 @@ export function avTs2Str(ts) {
|
|
|
352
401
|
* const timeStr = avTs2TimeStr(90000n, { num: 1, den: 90000 }); // Returns "1.000000"
|
|
353
402
|
* const nopts = avTs2TimeStr(null, { num: 1, den: 1000 }); // Returns "NOPTS"
|
|
354
403
|
* ```
|
|
404
|
+
*
|
|
405
|
+
* @see [av_ts2timestr](https://ffmpeg.org/doxygen/7.1/timestamp_8h.html#ad344b91ede6b86fc0a530611293f42da) - FFmpeg Doxygen
|
|
355
406
|
*/
|
|
356
407
|
export function avTs2TimeStr(ts, timeBase) {
|
|
357
408
|
if (!timeBase) {
|
|
@@ -413,6 +464,8 @@ export function avImageAllocArrays(width, height, pixFmt, align) {
|
|
|
413
464
|
* );
|
|
414
465
|
* // Returns 0 (equal)
|
|
415
466
|
* ```
|
|
467
|
+
*
|
|
468
|
+
* @see [av_compare_ts](https://ffmpeg.org/doxygen/7.1/group__lavu__math.html#ga151744358fff630942b926e67e67c415) - FFmpeg Doxygen
|
|
416
469
|
*/
|
|
417
470
|
export function avCompareTs(tsA, tbA, tsB, tbB) {
|
|
418
471
|
return bindings.avCompareTs(tsA, tbA, tsB, tbB);
|
|
@@ -439,6 +492,8 @@ export function avCompareTs(tsA, tbA, tsB, tbB) {
|
|
|
439
492
|
* );
|
|
440
493
|
* // Returns 90000n
|
|
441
494
|
* ```
|
|
495
|
+
*
|
|
496
|
+
* @see [av_rescale_q](https://ffmpeg.org/doxygen/7.1/group__lavu__math.html#gaf02994a8bbeaa91d4757df179cbe567f) - FFmpeg Doxygen
|
|
442
497
|
*/
|
|
443
498
|
export function avRescaleQ(a, bq, cq) {
|
|
444
499
|
return bindings.avRescaleQ(a, bq, cq);
|
|
@@ -457,6 +512,8 @@ export function avRescaleQ(a, bq, cq) {
|
|
|
457
512
|
* avUsleep(1000000); // Sleep for 1 second
|
|
458
513
|
* avUsleep(16667); // Sleep for ~16.67ms (60fps frame time)
|
|
459
514
|
* ```
|
|
515
|
+
*
|
|
516
|
+
* @see [av_usleep](https://ffmpeg.org/doxygen/7.1/time_8c.html#a4eee9c65835652a808973f4bc1641a51) - FFmpeg Doxygen
|
|
460
517
|
*/
|
|
461
518
|
export function avUsleep(usec) {
|
|
462
519
|
bindings.avUsleep(usec);
|
|
@@ -481,6 +538,8 @@ export function avUsleep(usec) {
|
|
|
481
538
|
* const rescaled = avRescaleRnd(1000n, 90000n, 1000n, AV_ROUND_NEAR_INF);
|
|
482
539
|
* // Returns 90000n
|
|
483
540
|
* ```
|
|
541
|
+
*
|
|
542
|
+
* @see [av_rescale_rnd](https://ffmpeg.org/doxygen/7.1/group__lavu__math.html#ga82d40664213508918093822461cc597e) - FFmpeg Doxygen
|
|
484
543
|
*/
|
|
485
544
|
export function avRescaleRnd(a, b, c, rnd) {
|
|
486
545
|
return bindings.avRescaleRnd(a, b, c, rnd);
|
|
@@ -510,6 +569,7 @@ export function avRescaleRnd(a, b, c, rnd) {
|
|
|
510
569
|
* console.log(`Allocated ${data.length} buffers, ${size} bytes total`);
|
|
511
570
|
* ```
|
|
512
571
|
*
|
|
572
|
+
* @see [av_samples_alloc](https://ffmpeg.org/doxygen/7.1/group__lavu__sampmanip.html#ga4db4c77f928d32c7d8854732f50b8c04) - FFmpeg Doxygen
|
|
513
573
|
* @see {@link avSamplesGetBufferSize} To calculate size without allocating
|
|
514
574
|
*/
|
|
515
575
|
export function avSamplesAlloc(nbChannels, nbSamples, sampleFmt, align) {
|
|
@@ -544,6 +604,7 @@ export function avSamplesAlloc(nbChannels, nbSamples, sampleFmt, align) {
|
|
|
544
604
|
* console.log(`Need ${size} bytes, ${linesize} per channel`);
|
|
545
605
|
* ```
|
|
546
606
|
*
|
|
607
|
+
* @see [av_samples_get_buffer_size](https://ffmpeg.org/doxygen/7.1/group__lavu__sampfmts.html#gaa7368bc4e3a366b688e81938ed55eb06) - FFmpeg Doxygen
|
|
547
608
|
* @see {@link avSamplesAlloc} To allocate the buffer
|
|
548
609
|
*/
|
|
549
610
|
export function avSamplesGetBufferSize(nbChannels, nbSamples, sampleFmt, align) {
|
|
@@ -568,6 +629,8 @@ export function avSamplesGetBufferSize(nbChannels, nbSamples, sampleFmt, align)
|
|
|
568
629
|
* const stereo = { nbChannels: 2, order: 1, u: { mask: 3n } };
|
|
569
630
|
* const desc = avChannelLayoutDescribe(stereo); // Returns "stereo"
|
|
570
631
|
* ```
|
|
632
|
+
*
|
|
633
|
+
* @see [av_channel_layout_describe](https://ffmpeg.org/doxygen/7.1/group__lavu__audio__channels.html#gacc7d7d1a280248aafb8f9196c9d4e24f) - FFmpeg Doxygen
|
|
571
634
|
*/
|
|
572
635
|
export function avChannelLayoutDescribe(channelLayout) {
|
|
573
636
|
return bindings.avChannelLayoutDescribe(channelLayout);
|
|
@@ -590,6 +653,8 @@ export function avChannelLayoutDescribe(channelLayout) {
|
|
|
590
653
|
* console.log('SDP:\n' + sdp);
|
|
591
654
|
* }
|
|
592
655
|
* ```
|
|
656
|
+
*
|
|
657
|
+
* @see [av_sdp_create](https://ffmpeg.org/doxygen/7.1/group__lavf__misc.html#gaa2a7353a6bb0c8726797abd56b176af0) - FFmpeg Doxygen
|
|
593
658
|
*/
|
|
594
659
|
export function avSdpCreate(contexts) {
|
|
595
660
|
if (!Array.isArray(contexts) || contexts.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../src/lib/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAMzC
|
|
1
|
+
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../src/lib/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAMzC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAyB;IAC3D,OAAO,QAAQ,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAyB;IAC1D,OAAO,QAAQ,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAyB;IAC5D,OAAO,QAAQ,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAyB;IAC5D,OAAO,QAAQ,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAyB;IAC3D,OAAO,QAAQ,CA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BACd,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;IACH,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC;IAEtC,oDAAoD;IACpD,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,QAAQ,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;AAC9C,CAAC"}
|
package/install/ffmpeg.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Adapted from https://github.com/lovell/sharp/blob/main/lib/libvips.js
|
|
2
2
|
|
|
3
|
-
import detectLibc from 'detect-libc';
|
|
4
3
|
import { spawnSync } from 'node:child_process';
|
|
5
4
|
|
|
6
5
|
const spawnSyncOptions = {
|
|
@@ -16,16 +15,6 @@ export const log = (item) => {
|
|
|
16
15
|
}
|
|
17
16
|
};
|
|
18
17
|
|
|
19
|
-
export const runtimeLibc = () => (detectLibc.isNonGlibcLinuxSync() ? detectLibc.familySync() : '');
|
|
20
|
-
|
|
21
|
-
export const runtimePlatformArch = () => `${process.platform}${runtimeLibc()}-${process.arch}`;
|
|
22
|
-
|
|
23
|
-
export const buildPlatformArch = () => {
|
|
24
|
-
const { npm_config_arch, npm_config_platform, npm_config_libc } = process.env;
|
|
25
|
-
const libc = typeof npm_config_libc === 'string' ? npm_config_libc : runtimeLibc();
|
|
26
|
-
return `${npm_config_platform ?? process.platform}${libc}-${npm_config_arch ?? process.arch}`;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
18
|
export const spawnRebuild = () =>
|
|
30
19
|
spawnSync('node-gyp rebuild', {
|
|
31
20
|
...spawnSyncOptions,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-av",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "FFmpeg bindings for Node.js",
|
|
5
5
|
"author": "seydx (https://github.com/seydx/av)",
|
|
6
6
|
"type": "module",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"install-updates": "npm i --save",
|
|
47
47
|
"lint": "eslint .",
|
|
48
48
|
"lint:fix": "eslint --fix .",
|
|
49
|
-
"predocs": "typedoc && cpy README.md docs/
|
|
49
|
+
"predocs": "typedoc && cpy README.md docs/ --rename=index.md",
|
|
50
50
|
"release:patch": "node scripts/prepare-release.js patch",
|
|
51
51
|
"release:minor": "node scripts/prepare-release.js minor",
|
|
52
52
|
"release:major": "node scripts/prepare-release.js major",
|
|
@@ -54,32 +54,30 @@
|
|
|
54
54
|
"test:all": "npm run generate && npm run build:tests && npm run build:tsc && tsx --test test/*.test.ts",
|
|
55
55
|
"update": "updates --update ./"
|
|
56
56
|
},
|
|
57
|
-
"dependencies": {
|
|
58
|
-
"detect-libc": "^2.0.4"
|
|
59
|
-
},
|
|
60
57
|
"optionalDependencies": {
|
|
61
|
-
"@seydx/node-av-darwin-arm64": "^
|
|
62
|
-
"@seydx/node-av-darwin-x64": "^
|
|
63
|
-
"@seydx/node-av-linux-arm64": "^
|
|
64
|
-
"@seydx/node-av-linux-x64": "^
|
|
65
|
-
"@seydx/node-av-win32-arm64": "^
|
|
66
|
-
"@seydx/node-av-win32-x64": "^
|
|
58
|
+
"@seydx/node-av-darwin-arm64": "^2.0.0",
|
|
59
|
+
"@seydx/node-av-darwin-x64": "^2.0.0",
|
|
60
|
+
"@seydx/node-av-linux-arm64": "^2.0.0",
|
|
61
|
+
"@seydx/node-av-linux-x64": "^2.0.0",
|
|
62
|
+
"@seydx/node-av-win32-arm64": "^2.0.0",
|
|
63
|
+
"@seydx/node-av-win32-x64": "^2.0.0"
|
|
67
64
|
},
|
|
68
65
|
"devDependencies": {
|
|
66
|
+
"@camera.ui/ffmpeg": "^0.0.14",
|
|
69
67
|
"@stylistic/eslint-plugin": "^5.3.1",
|
|
70
68
|
"@types/debug": "^4.1.12",
|
|
71
|
-
"@types/node": "^24.3.
|
|
69
|
+
"@types/node": "^24.3.3",
|
|
72
70
|
"@types/node-abi": "^3.0.3",
|
|
73
71
|
"@types/pngjs": "^6.0.5",
|
|
74
72
|
"@types/semver": "^7.7.1",
|
|
75
73
|
"@types/unzipper": "^0.10.11",
|
|
76
|
-
"@typescript-eslint/parser": "^8.
|
|
74
|
+
"@typescript-eslint/parser": "^8.43.0",
|
|
77
75
|
"concurrently": "^9.2.1",
|
|
78
76
|
"cpy-cli": "^6.0.0",
|
|
79
77
|
"cross-env": "^10.0.0",
|
|
80
|
-
"eslint": "^9.
|
|
81
|
-
"eslint-plugin-jsdoc": "^
|
|
82
|
-
"globals": "^16.
|
|
78
|
+
"eslint": "^9.35.0",
|
|
79
|
+
"eslint-plugin-jsdoc": "^57.0.3",
|
|
80
|
+
"globals": "^16.4.0",
|
|
83
81
|
"node-addon-api": "^8.5.0",
|
|
84
82
|
"node-gyp": "^11.4.2",
|
|
85
83
|
"pngjs": "^7.0.0",
|
|
@@ -90,8 +88,8 @@
|
|
|
90
88
|
"typedoc-plugin-markdown": "^4.8.1",
|
|
91
89
|
"typedoc-vitepress-theme": "^1.1.2",
|
|
92
90
|
"typescript": "^5.9.2",
|
|
93
|
-
"typescript-eslint": "^8.
|
|
94
|
-
"updates": "^16.
|
|
91
|
+
"typescript-eslint": "^8.43.0",
|
|
92
|
+
"updates": "^16.7.1",
|
|
95
93
|
"vitepress": "^2.0.0-alpha.12"
|
|
96
94
|
},
|
|
97
95
|
"bugs": {
|
package/release_notes.md
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
## node-av Release v1.2.0
|
|
2
|
-
|
|
3
|
-
### 📦 Updated Packages
|
|
4
|
-
|
|
5
|
-
The following platform packages have been updated to v1.2.0:
|
|
6
|
-
- `@seydx/node-av-darwin-arm64@v1.2.0`
|
|
7
|
-
- `@seydx/node-av-darwin-x64@v1.2.0`
|
|
8
|
-
- `@seydx/node-av-linux-arm64@v1.2.0`
|
|
9
|
-
- `@seydx/node-av-linux-x64@v1.2.0`
|
|
10
|
-
- `@seydx/node-av-win32-arm64@v1.2.0`
|
|
11
|
-
- `@seydx/node-av-win32-x64@v1.2.0`
|
|
12
|
-
|
|
13
|
-
### 📝 Changes since v1.1.0
|
|
14
|
-
|
|
15
|
-
- chore: bump version to 1.2.0 (9c5835f)
|
|
16
|
-
- Fix vitepress base (6bcb224)
|
|
17
|
-
- Update vitepress config and npm doc scripts (e5eba4e)
|
|
18
|
-
- Update docs (fcb3dee)
|
|
19
|
-
- Fix docs build script (ae04f0e)
|
|
20
|
-
- Updater README (7d50fac)
|
|
21
|
-
- Fix docs, import/exports (c392470)
|
|
22
|
-
- Update deploy workflow (5200f6c)
|
|
23
|
-
- Update README and vitepress config (1f76e0f)
|
|
24
|
-
- Cleanup (a3afe3a)
|
|
25
|
-
- Cleanup (53407e8)
|
|
26
|
-
- Update build workflows (a4c1497)
|
|
27
|
-
- Update workflows (88dcb25)
|
|
28
|
-
- Update README and vitepress config (13acbb3)
|
|
29
|
-
- Update workflows (2560e87)
|
|
30
|
-
- Update .gitignore (b8ed1b3)
|
|
31
|
-
- Update docs (5212876)
|
|
32
|
-
- Update workflows (39c7bbe)
|
|
33
|
-
- Update vitepress config (689b49c)
|
|
34
|
-
- Fix docs (d43924a)
|
|
35
|
-
- Update README & CONTIRBUTION & INSTALLATION (2bd94f5)
|
|
36
|
-
- deps (aca0757)
|
|
37
|
-
- Add vitepress docs (1ffebe7)
|
|
38
|
-
- Update tests (3533b92)
|
|
39
|
-
- Update examples (e1e41c6)
|
|
40
|
-
- Refactor docs (dce1cf1)
|
|
41
|
-
- feat: add synchronous codec opening method to CodecContext (2161492)
|
|
42
|
-
- Buffixes, improvements, cleanup (febc998)
|
|
43
|
-
- refactor: HardwareContext (b1cfb4a)
|
|
44
|
-
- refactor: rename deviceName to deviceTypeName in HardwareFilterPresets for clarity (7c5ef9a)
|
|
45
|
-
- feat: add hardware validation and improve context creation in HardwareContext (a4023fe)
|
|
46
|
-
- refactor: update Encoder class to use Codec type and add pixel format support check (adfe8a9)
|
|
47
|
-
- fix: improve custom IO handling in MediaOutput class (dbd18e7)
|
|
48
|
-
- deps (0187080)
|