node-av 1.2.0 → 1.3.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.
Files changed (83) hide show
  1. package/README.md +0 -21
  2. package/dist/api/bitstream-filter.d.ts +3 -0
  3. package/dist/api/bitstream-filter.js +5 -2
  4. package/dist/api/bitstream-filter.js.map +1 -1
  5. package/dist/api/decoder.d.ts +5 -0
  6. package/dist/api/decoder.js +7 -2
  7. package/dist/api/decoder.js.map +1 -1
  8. package/dist/api/encoder.d.ts +11 -6
  9. package/dist/api/encoder.js +13 -8
  10. package/dist/api/encoder.js.map +1 -1
  11. package/dist/api/filter-presets.d.ts +1267 -15
  12. package/dist/api/filter-presets.js +1387 -17
  13. package/dist/api/filter-presets.js.map +1 -1
  14. package/dist/api/filter.d.ts +28 -0
  15. package/dist/api/filter.js +30 -2
  16. package/dist/api/filter.js.map +1 -1
  17. package/dist/api/hardware.d.ts +24 -2
  18. package/dist/api/hardware.js +65 -8
  19. package/dist/api/hardware.js.map +1 -1
  20. package/dist/api/io-stream.d.ts +6 -0
  21. package/dist/api/io-stream.js +6 -0
  22. package/dist/api/io-stream.js.map +1 -1
  23. package/dist/api/media-input.d.ts +1 -0
  24. package/dist/api/media-input.js.map +1 -1
  25. package/dist/api/media-output.d.ts +4 -0
  26. package/dist/api/media-output.js +4 -0
  27. package/dist/api/media-output.js.map +1 -1
  28. package/dist/api/pipeline.d.ts +193 -0
  29. package/dist/api/pipeline.js +17 -0
  30. package/dist/api/pipeline.js.map +1 -1
  31. package/dist/api/types.d.ts +5 -0
  32. package/dist/api/utilities/audio-sample.d.ts +0 -8
  33. package/dist/api/utilities/audio-sample.js +0 -8
  34. package/dist/api/utilities/audio-sample.js.map +1 -1
  35. package/dist/api/utilities/channel-layout.d.ts +0 -8
  36. package/dist/api/utilities/channel-layout.js +0 -8
  37. package/dist/api/utilities/channel-layout.js.map +1 -1
  38. package/dist/api/utilities/image.d.ts +0 -8
  39. package/dist/api/utilities/image.js +0 -8
  40. package/dist/api/utilities/image.js.map +1 -1
  41. package/dist/api/utilities/index.d.ts +3 -3
  42. package/dist/api/utilities/index.js +3 -3
  43. package/dist/api/utilities/index.js.map +1 -1
  44. package/dist/api/utilities/media-type.d.ts +1 -9
  45. package/dist/api/utilities/media-type.js +1 -9
  46. package/dist/api/utilities/media-type.js.map +1 -1
  47. package/dist/api/utilities/pixel-format.d.ts +1 -9
  48. package/dist/api/utilities/pixel-format.js +1 -9
  49. package/dist/api/utilities/pixel-format.js.map +1 -1
  50. package/dist/api/utilities/sample-format.d.ts +1 -9
  51. package/dist/api/utilities/sample-format.js +1 -9
  52. package/dist/api/utilities/sample-format.js.map +1 -1
  53. package/dist/api/utilities/streaming.d.ts +0 -8
  54. package/dist/api/utilities/streaming.js +0 -8
  55. package/dist/api/utilities/streaming.js.map +1 -1
  56. package/dist/api/utilities/timestamp.d.ts +0 -8
  57. package/dist/api/utilities/timestamp.js +0 -8
  58. package/dist/api/utilities/timestamp.js.map +1 -1
  59. package/dist/api/utils.js +2 -0
  60. package/dist/api/utils.js.map +1 -1
  61. package/dist/constants/constants.d.ts +1 -1
  62. package/dist/constants/constants.js +2 -0
  63. package/dist/constants/constants.js.map +1 -1
  64. package/dist/lib/binding.d.ts +1 -0
  65. package/dist/lib/binding.js +2 -0
  66. package/dist/lib/binding.js.map +1 -1
  67. package/dist/lib/codec.d.ts +4 -4
  68. package/dist/lib/codec.js +4 -4
  69. package/dist/lib/error.d.ts +1 -1
  70. package/dist/lib/error.js +1 -1
  71. package/dist/lib/index.d.ts +1 -1
  72. package/dist/lib/index.js +1 -1
  73. package/dist/lib/index.js.map +1 -1
  74. package/dist/lib/native-types.d.ts +1 -0
  75. package/dist/lib/option.d.ts +176 -0
  76. package/dist/lib/option.js +176 -0
  77. package/dist/lib/option.js.map +1 -1
  78. package/dist/lib/utilities.d.ts +64 -1
  79. package/dist/lib/utilities.js +65 -0
  80. package/dist/lib/utilities.js.map +1 -1
  81. package/install/ffmpeg.js +0 -11
  82. package/package.json +12 -14
  83. package/release_notes.md +24 -43
@@ -55,6 +55,12 @@ export declare abstract class FilterPresetBase {
55
55
  * @param options - Additional scaling options (e.g., flags for algorithm)
56
56
  * @returns Filter string or null if not supported
57
57
  *
58
+ * @example
59
+ * ```typescript
60
+ * presets.scale(1920, 1080) // Scale to Full HD
61
+ * presets.scale(640, 480, { flags: 'lanczos' }) // With specific algorithm
62
+ * ```
63
+ *
58
64
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#scale | FFmpeg scale filter}
59
65
  */
60
66
  scale(width: number, height: number, options?: Record<string, any>): string | null;
@@ -67,6 +73,12 @@ export declare abstract class FilterPresetBase {
67
73
  * @param y - Y coordinate of top-left corner (default: 0)
68
74
  * @returns Filter string or null if not supported
69
75
  *
76
+ * @example
77
+ * ```typescript
78
+ * presets.crop(640, 480, 100, 100) // Crop 640x480 area starting at (100,100)
79
+ * presets.crop(1280, 720) // Crop from top-left corner
80
+ * ```
81
+ *
70
82
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#crop | FFmpeg crop filter}
71
83
  */
72
84
  crop(width: number, height: number, x?: number, y?: number): string | null;
@@ -76,6 +88,12 @@ export declare abstract class FilterPresetBase {
76
88
  * @param fps - Target frames per second
77
89
  * @returns Filter string or null if not supported
78
90
  *
91
+ * @example
92
+ * ```typescript
93
+ * presets.fps(30) // Convert to 30 FPS
94
+ * presets.fps(23.976) // Film frame rate
95
+ * ```
96
+ *
79
97
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#fps | FFmpeg fps filter}
80
98
  */
81
99
  fps(fps: number): string | null;
@@ -104,6 +122,12 @@ export declare abstract class FilterPresetBase {
104
122
  * @param angle - Rotation angle in degrees
105
123
  * @returns Filter string or null if not supported
106
124
  *
125
+ * @example
126
+ * ```typescript
127
+ * presets.rotate(90) // Rotate 90 degrees clockwise
128
+ * presets.rotate(-45) // Rotate 45 degrees counter-clockwise
129
+ * ```
130
+ *
107
131
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#rotate | FFmpeg rotate filter}
108
132
  */
109
133
  rotate(angle: number): string | null;
@@ -112,6 +136,11 @@ export declare abstract class FilterPresetBase {
112
136
  *
113
137
  * @returns Filter string or null if not supported
114
138
  *
139
+ * @example
140
+ * ```typescript
141
+ * presets.hflip() // Mirror horizontally
142
+ * ```
143
+ *
115
144
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#hflip | FFmpeg hflip filter}
116
145
  */
117
146
  hflip(): string | null;
@@ -120,6 +149,11 @@ export declare abstract class FilterPresetBase {
120
149
  *
121
150
  * @returns Filter string or null if not supported
122
151
  *
152
+ * @example
153
+ * ```typescript
154
+ * presets.vflip() // Flip upside down
155
+ * ```
156
+ *
123
157
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#vflip | FFmpeg vflip filter}
124
158
  */
125
159
  vflip(): string | null;
@@ -131,6 +165,12 @@ export declare abstract class FilterPresetBase {
131
165
  * @param duration - Fade duration in seconds
132
166
  * @returns Filter string or null if not supported
133
167
  *
168
+ * @example
169
+ * ```typescript
170
+ * presets.fade('in', 0, 2) // 2-second fade in from start
171
+ * presets.fade('out', 10, 1) // 1-second fade out at 10 seconds
172
+ * ```
173
+ *
134
174
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#fade | FFmpeg fade filter}
135
175
  */
136
176
  fade(type: 'in' | 'out', start: number, duration: number): string | null;
@@ -160,6 +200,12 @@ export declare abstract class FilterPresetBase {
160
200
  * @param factor - Volume multiplication factor (1.0 = unchanged, 2.0 = double)
161
201
  * @returns Filter string or null if not supported
162
202
  *
203
+ * @example
204
+ * ```typescript
205
+ * presets.volume(0.5) // Reduce volume by 50%
206
+ * presets.volume(1.5) // Increase volume by 50%
207
+ * ```
208
+ *
163
209
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#volume | FFmpeg volume filter}
164
210
  */
165
211
  volume(factor: number): string | null;
@@ -186,6 +232,26 @@ export declare abstract class FilterPresetBase {
186
232
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#aformat | FFmpeg aformat filter}
187
233
  */
188
234
  aformat(sampleFormat: string | AVSampleFormat, sampleRate?: number, channelLayout?: string): string | null;
235
+ /**
236
+ * Creates an asetnsamples filter string to set the number of samples per frame.
237
+ * This is crucial for encoders like Opus that require specific frame sizes.
238
+ *
239
+ * @param samples - Number of samples per frame
240
+ * @param padding - Whether to pad or drop samples (default: true)
241
+ * @returns Filter string or null if not supported
242
+ *
243
+ * @example
244
+ * ```typescript
245
+ * // For Opus encoder (requires 960 samples)
246
+ * presets.asetnsamples(960);
247
+ *
248
+ * // Drop samples instead of padding
249
+ * presets.asetnsamples(1024, false);
250
+ * ```
251
+ *
252
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#asetnsamples | FFmpeg asetnsamples filter}
253
+ */
254
+ asetnsamples(samples: number, padding?: boolean): string | null;
189
255
  /**
190
256
  * Creates an atempo filter string to change audio playback speed.
191
257
  * Factor must be between 0.5 and 2.0. For larger changes, chain multiple atempo filters.
@@ -193,6 +259,12 @@ export declare abstract class FilterPresetBase {
193
259
  * @param factor - Tempo factor (0.5 = half speed, 2.0 = double speed)
194
260
  * @returns Filter string or null if not supported
195
261
  *
262
+ * @example
263
+ * ```typescript
264
+ * presets.atempo(1.5) // 1.5x speed
265
+ * presets.atempo(0.8) // Slow down to 80% speed
266
+ * ```
267
+ *
196
268
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#atempo | FFmpeg atempo filter}
197
269
  */
198
270
  atempo(factor: number): string | null;
@@ -204,6 +276,12 @@ export declare abstract class FilterPresetBase {
204
276
  * @param duration - Fade duration in seconds
205
277
  * @returns Filter string or null if not supported
206
278
  *
279
+ * @example
280
+ * ```typescript
281
+ * presets.afade('in', 0, 3) // 3-second audio fade in
282
+ * presets.afade('out', 20, 2) // 2-second fade out at 20s
283
+ * ```
284
+ *
207
285
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#afade | FFmpeg afade filter}
208
286
  */
209
287
  afade(type: 'in' | 'out', start: number, duration: number): string | null;
@@ -214,9 +292,303 @@ export declare abstract class FilterPresetBase {
214
292
  * @param duration - How to determine output duration (default: 'longest')
215
293
  * @returns Filter string or null if not supported
216
294
  *
295
+ * @example
296
+ * ```typescript
297
+ * presets.amix(3, 'longest') // Mix 3 audio streams
298
+ * presets.amix(2, 'first') // Mix 2 streams, use first's duration
299
+ * ```
300
+ *
217
301
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#amix | FFmpeg amix filter}
218
302
  */
219
303
  amix(inputs?: number, duration?: 'first' | 'longest' | 'shortest'): string | null;
304
+ /**
305
+ * Creates a pad filter string to add padding to video.
306
+ * Essential for aspect ratio adjustments and letterboxing.
307
+ *
308
+ * @param width - Output width (can use expressions like 'iw+100')
309
+ * @param height - Output height (can use expressions like 'ih+100')
310
+ * @param x - X position of input video (default: '(ow-iw)/2' for center)
311
+ * @param y - Y position of input video (default: '(oh-ih)/2' for center)
312
+ * @param color - Padding color (default: 'black')
313
+ * @returns Filter string or null if not supported
314
+ *
315
+ * @example
316
+ * ```typescript
317
+ * // Add black bars for 16:9 aspect ratio
318
+ * presets.pad('iw', 'iw*9/16');
319
+ *
320
+ * // Add 50px padding on all sides
321
+ * presets.pad('iw+100', 'ih+100');
322
+ * ```
323
+ *
324
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#pad | FFmpeg pad filter}
325
+ */
326
+ pad(width: string | number, height: string | number, x?: string, y?: string, color?: string): string | null;
327
+ /**
328
+ * Creates a trim filter string to cut a portion of the stream.
329
+ * Crucial for cutting segments from media.
330
+ *
331
+ * @param start - Start time in seconds
332
+ * @param end - End time in seconds (optional)
333
+ * @param duration - Duration in seconds (optional, alternative to end)
334
+ * @returns Filter string or null if not supported
335
+ *
336
+ * @example
337
+ * ```typescript
338
+ * presets.trim(10, 30) // Extract from 10s to 30s
339
+ * presets.trim(5, undefined, 10) // Extract 10s starting at 5s
340
+ * ```
341
+ *
342
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#trim | FFmpeg trim filter}
343
+ */
344
+ trim(start: number, end?: number, duration?: number): string | null;
345
+ /**
346
+ * Creates a setpts filter string to change presentation timestamps.
347
+ * Essential for speed changes and timestamp manipulation.
348
+ *
349
+ * @param expression - PTS expression (e.g., 'PTS*2' for half speed, 'PTS/2' for double speed)
350
+ * @returns Filter string or null if not supported
351
+ *
352
+ * @example
353
+ * ```typescript
354
+ * // Double speed
355
+ * presets.setpts('PTS/2');
356
+ *
357
+ * // Half speed
358
+ * presets.setpts('PTS*2');
359
+ *
360
+ * // Reset timestamps
361
+ * presets.setpts('PTS-STARTPTS');
362
+ * ```
363
+ *
364
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#setpts | FFmpeg setpts filter}
365
+ */
366
+ setpts(expression: string): string | null;
367
+ /**
368
+ * Creates an asetpts filter string for audio timestamp manipulation.
369
+ *
370
+ * @param expression - PTS expression
371
+ * @returns Filter string or null if not supported
372
+ *
373
+ * @example
374
+ * ```typescript
375
+ * presets.asetpts('PTS-STARTPTS') // Reset timestamps to start from 0
376
+ * ```
377
+ *
378
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#asetpts | FFmpeg asetpts filter}
379
+ */
380
+ asetpts(expression: string): string | null;
381
+ /**
382
+ * Creates a transpose filter string for rotation/flipping.
383
+ * More efficient than rotate for 90-degree rotations.
384
+ *
385
+ * @param mode - Transpose mode (0-3, or named constants)
386
+ * @returns Filter string or null if not supported
387
+ *
388
+ * @example
389
+ * ```typescript
390
+ * presets.transpose(1) // Rotate 90 degrees clockwise
391
+ * presets.transpose('cclock') // Rotate 90 degrees counter-clockwise
392
+ * ```
393
+ *
394
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#transpose | FFmpeg transpose filter}
395
+ */
396
+ transpose(mode: number | 'clock' | 'cclock' | 'clock_flip' | 'cclock_flip'): string | null;
397
+ /**
398
+ * Creates a setsar filter string to set sample aspect ratio.
399
+ * Important for correcting aspect ratio issues.
400
+ *
401
+ * @param ratio - Aspect ratio (e.g., '1:1', '16:9', or number)
402
+ * @returns Filter string or null if not supported
403
+ *
404
+ * @example
405
+ * ```typescript
406
+ * presets.setsar('1:1') // Square pixels
407
+ * presets.setsar(1.333) // 4:3 aspect ratio
408
+ * ```
409
+ *
410
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#setsar | FFmpeg setsar/setdar filter}
411
+ */
412
+ setsar(ratio: string | number): string | null;
413
+ /**
414
+ * Creates a setdar filter string to set display aspect ratio.
415
+ *
416
+ * @param ratio - Aspect ratio (e.g., '16:9', '4:3')
417
+ * @returns Filter string or null if not supported
418
+ *
419
+ * @example
420
+ * ```typescript
421
+ * presets.setdar('16:9') // Widescreen
422
+ * presets.setdar('4:3') // Traditional TV aspect
423
+ * ```
424
+ *
425
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#setsar | FFmpeg setsar/setdar filter}
426
+ */
427
+ setdar(ratio: string | number): string | null;
428
+ /**
429
+ * Creates an apad filter string to add audio padding.
430
+ * Useful for ensuring minimum audio duration.
431
+ *
432
+ * @param wholeDuration - Minimum duration in seconds (optional)
433
+ * @param padDuration - Amount of padding to add in seconds (optional)
434
+ * @returns Filter string or null if not supported
435
+ *
436
+ * @example
437
+ * ```typescript
438
+ * presets.apad(30) // Ensure at least 30 seconds total
439
+ * presets.apad(undefined, 5) // Add 5 seconds of padding
440
+ * ```
441
+ *
442
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#apad | FFmpeg apad filter}
443
+ */
444
+ apad(wholeDuration?: number, padDuration?: number): string | null;
445
+ /**
446
+ * Creates a deinterlace filter string.
447
+ * Essential for processing interlaced content.
448
+ *
449
+ * @param mode - Deinterlace mode (default: 'yadif')
450
+ * @returns Filter string or null if not supported
451
+ *
452
+ * @example
453
+ * ```typescript
454
+ * presets.deinterlace('yadif') // Standard deinterlacing
455
+ * presets.deinterlace('bwdif') // Bob Weaver deinterlacing
456
+ * ```
457
+ *
458
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#yadif | FFmpeg yadif filter}
459
+ */
460
+ deinterlace(mode?: 'yadif' | 'bwdif' | 'w3fdif'): string | null;
461
+ /**
462
+ * Creates a select filter string to select specific frames.
463
+ * Powerful for extracting keyframes, specific frame types, etc.
464
+ *
465
+ * @param expression - Selection expression
466
+ * @returns Filter string or null if not supported
467
+ *
468
+ * @example
469
+ * ```typescript
470
+ * presets.select('eq(pict_type,I)') // Select only keyframes
471
+ * presets.select('not(mod(n,10))') // Select every 10th frame
472
+ * ```
473
+ *
474
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#select | FFmpeg select filter}
475
+ */
476
+ select(expression: string): string | null;
477
+ /**
478
+ * Creates an aselect filter string for audio selection.
479
+ *
480
+ * @param expression - Selection expression
481
+ * @returns Filter string or null if not supported
482
+ *
483
+ * @example
484
+ * ```typescript
485
+ * presets.aselect('between(t,10,20)') // Select audio between 10-20 seconds
486
+ * ```
487
+ *
488
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#aselect | FFmpeg aselect filter}
489
+ */
490
+ aselect(expression: string): string | null;
491
+ /**
492
+ * Creates a concat filter string to concatenate multiple inputs.
493
+ * Essential for joining multiple video/audio segments.
494
+ *
495
+ * @param n - Number of input segments
496
+ * @param v - Number of output video streams (0 or 1)
497
+ * @param a - Number of output audio streams (0 or 1)
498
+ * @returns Filter string or null if not supported
499
+ *
500
+ * @example
501
+ * ```typescript
502
+ * presets.concat(3, 1, 1) // Join 3 segments with video and audio
503
+ * presets.concat(2, 1, 0) // Join 2 video-only segments
504
+ * ```
505
+ *
506
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#concat | FFmpeg concat filter}
507
+ */
508
+ concat(n: number, v?: number, a?: number): string | null;
509
+ /**
510
+ * Creates an amerge filter string to merge multiple audio streams into one.
511
+ * Different from amix - this creates multi-channel output.
512
+ *
513
+ * @param inputs - Number of input streams
514
+ * @returns Filter string or null if not supported
515
+ *
516
+ * @example
517
+ * ```typescript
518
+ * presets.amerge(2) // Merge 2 mono streams to stereo
519
+ * presets.amerge(6) // Merge 6 channels for 5.1 surround
520
+ * ```
521
+ *
522
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#amerge | FFmpeg amerge filter}
523
+ */
524
+ amerge(inputs?: number): string | null;
525
+ /**
526
+ * Creates a channelmap filter string to remap audio channels.
527
+ * Critical for audio channel manipulation.
528
+ *
529
+ * @param map - Channel mapping (e.g., '0-0|1-1' or 'FL-FR|FR-FL' to swap stereo)
530
+ * @returns Filter string or null if not supported
531
+ *
532
+ * @example
533
+ * ```typescript
534
+ * presets.channelmap('FL-FR|FR-FL') // Swap left and right channels
535
+ * presets.channelmap('0-0|0-1') // Duplicate mono to stereo
536
+ * ```
537
+ *
538
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#channelmap | FFmpeg channelmap filter}
539
+ */
540
+ channelmap(map: string): string | null;
541
+ /**
542
+ * Creates a channelsplit filter string to split audio channels.
543
+ *
544
+ * @param channelLayout - Channel layout to split (optional)
545
+ * @returns Filter string or null if not supported
546
+ *
547
+ * @example
548
+ * ```typescript
549
+ * presets.channelsplit('stereo') // Split stereo to 2 mono
550
+ * presets.channelsplit('5.1') // Split 5.1 to individual channels
551
+ * ```
552
+ *
553
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#channelsplit | FFmpeg channelsplit filter}
554
+ */
555
+ channelsplit(channelLayout?: string): string | null;
556
+ /**
557
+ * Creates a loudnorm filter string for loudness normalization.
558
+ * Essential for broadcast compliance and consistent audio levels.
559
+ *
560
+ * @param I - Integrated loudness target (default: -24 LUFS)
561
+ * @param TP - True peak (default: -2 dBTP)
562
+ * @param LRA - Loudness range (default: 7 LU)
563
+ * @returns Filter string or null if not supported
564
+ *
565
+ * @example
566
+ * ```typescript
567
+ * presets.loudnorm(-23, -1, 7) // EBU R128 broadcast standard
568
+ * presets.loudnorm(-16, -1.5, 11) // Streaming platforms standard
569
+ * ```
570
+ *
571
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#loudnorm | FFmpeg loudnorm filter}
572
+ */
573
+ loudnorm(I?: number, TP?: number, LRA?: number): string | null;
574
+ /**
575
+ * Creates a compand filter string for audio compression/expansion.
576
+ * Important for dynamic range control.
577
+ *
578
+ * @param attacks - Attack times
579
+ * @param decays - Decay times
580
+ * @param points - Transfer function points
581
+ * @param gain - Output gain
582
+ * @returns Filter string or null if not supported
583
+ *
584
+ * @example
585
+ * ```typescript
586
+ * presets.compand('0.3|0.3', '1|1', '-90/-60|-60/-40|-40/-30|-20/-20', 6)
587
+ * ```
588
+ *
589
+ * @see {@link https://ffmpeg.org/ffmpeg-filters.html#compand | FFmpeg compand filter}
590
+ */
591
+ compand(attacks: string, decays: string, points: string, gain?: number): string | null;
220
592
  }
221
593
  /**
222
594
  * Filter chain builder for composing multiple filters.
@@ -239,6 +611,11 @@ export declare class FilterChain {
239
611
  *
240
612
  * @param filter - Filter string to add (ignored if null/undefined)
241
613
  * @returns This instance for chaining
614
+ *
615
+ * @example
616
+ * ```typescript
617
+ * chain.add('scale=1920:1080')
618
+ * ```
242
619
  */
243
620
  add(filter: string | null | undefined): this;
244
621
  /**
@@ -246,6 +623,11 @@ export declare class FilterChain {
246
623
  *
247
624
  * @param filter - Custom filter string
248
625
  * @returns This instance for chaining
626
+ *
627
+ * @example
628
+ * ```typescript
629
+ * chain.custom('myfilter=param1:param2')
630
+ * ```
249
631
  */
250
632
  custom(filter: string): this;
251
633
  /**
@@ -253,12 +635,22 @@ export declare class FilterChain {
253
635
  *
254
636
  * @param separator - Separator between filters (default: ',')
255
637
  * @returns Combined filter string
638
+ *
639
+ * @example
640
+ * ```typescript
641
+ * const filterString = chain.build() // "scale=1920:1080,fps=30"
642
+ * ```
256
643
  */
257
644
  build(separator?: string): string;
258
645
  /**
259
646
  * Returns the filters as an array.
260
647
  *
261
648
  * @returns Array of filter strings
649
+ *
650
+ * @example
651
+ * ```typescript
652
+ * const filters = chain.toArray() // ["scale=1920:1080", "fps=30"]
653
+ * ```
262
654
  */
263
655
  toArray(): string[];
264
656
  }
@@ -290,8 +682,23 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
290
682
  * @param width - Target width
291
683
  * @param height - Target height
292
684
  * @param options - Additional scaling options
685
+ *
293
686
  * @returns This instance for chaining
294
687
  *
688
+ * @example
689
+ * ```typescript
690
+ * const chain = FilterPresets.chain()
691
+ * .scale(1920, 1080)
692
+ * .build();
693
+ * ```
694
+ *
695
+ * @example
696
+ * ```typescript
697
+ * const chain = FilterPresets.chain()
698
+ * .scale(1280, 720, { flags: 'lanczos' })
699
+ * .build();
700
+ * ```
701
+ *
295
702
  * @see {@link FilterPresetBase.scale}
296
703
  */
297
704
  scale(width: number, height: number, options?: Record<string, any>): this;
@@ -302,8 +709,23 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
302
709
  * @param height - Crop height
303
710
  * @param x - X position (default: 0)
304
711
  * @param y - Y position (default: 0)
712
+ *
305
713
  * @returns This instance for chaining
306
714
  *
715
+ * @example
716
+ * ```typescript
717
+ * const chain = FilterPresets.chain()
718
+ * .crop(640, 480)
719
+ * .build();
720
+ * ```
721
+ *
722
+ * @example
723
+ * ```typescript
724
+ * const chain = FilterPresets.chain()
725
+ * .crop(1920, 1080, 100, 50)
726
+ * .build();
727
+ * ```
728
+ *
307
729
  * @see {@link FilterPresetBase.crop}
308
730
  */
309
731
  crop(width: number, height: number, x?: number, y?: number): this;
@@ -311,17 +733,47 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
311
733
  * Adds an FPS filter to the chain.
312
734
  *
313
735
  * @param fps - Target frame rate
736
+ *
314
737
  * @returns This instance for chaining
315
738
  *
316
- * @see {@link FilterPresetBase.fps}
317
- */
318
- fps(fps: number): this;
319
- /**
320
- * Adds a format filter to the chain.
739
+ * @example
740
+ * ```typescript
741
+ * const chain = FilterPresets.chain()
742
+ * .fps(30)
743
+ * .build();
744
+ * ```
745
+ *
746
+ * @example
747
+ * ```typescript
748
+ * const chain = FilterPresets.chain()
749
+ * .fps(23.976)
750
+ * .build();
751
+ * ```
752
+ *
753
+ * @see {@link FilterPresetBase.fps}
754
+ */
755
+ fps(fps: number): this;
756
+ /**
757
+ * Adds a format filter to the chain.
321
758
  *
322
759
  * @param pixelFormat - Target pixel format(s)
760
+ *
323
761
  * @returns This instance for chaining
324
762
  *
763
+ * @example
764
+ * ```typescript
765
+ * const chain = FilterPresets.chain()
766
+ * .format('yuv420p')
767
+ * .build();
768
+ * ```
769
+ *
770
+ * @example
771
+ * ```typescript
772
+ * const chain = FilterPresets.chain()
773
+ * .format(AV_PIX_FMT_RGB24)
774
+ * .build();
775
+ * ```
776
+ *
325
777
  * @see {@link FilterPresetBase.format}
326
778
  */
327
779
  format(pixelFormat: string | AVPixelFormat | (string | AVPixelFormat)[]): this;
@@ -329,8 +781,23 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
329
781
  * Adds a rotate filter to the chain.
330
782
  *
331
783
  * @param angle - Rotation angle in degrees
784
+ *
332
785
  * @returns This instance for chaining
333
786
  *
787
+ * @example
788
+ * ```typescript
789
+ * const chain = FilterPresets.chain()
790
+ * .rotate(45)
791
+ * .build();
792
+ * ```
793
+ *
794
+ * @example
795
+ * ```typescript
796
+ * const chain = FilterPresets.chain()
797
+ * .rotate(-90)
798
+ * .build();
799
+ * ```
800
+ *
334
801
  * @see {@link FilterPresetBase.rotate}
335
802
  */
336
803
  rotate(angle: number): this;
@@ -339,6 +806,13 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
339
806
  *
340
807
  * @returns This instance for chaining
341
808
  *
809
+ * @example
810
+ * ```typescript
811
+ * const chain = FilterPresets.chain()
812
+ * .hflip()
813
+ * .build();
814
+ * ```
815
+ *
342
816
  * @see {@link FilterPresetBase.hflip}
343
817
  */
344
818
  hflip(): this;
@@ -347,6 +821,13 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
347
821
  *
348
822
  * @returns This instance for chaining
349
823
  *
824
+ * @example
825
+ * ```typescript
826
+ * const chain = FilterPresets.chain()
827
+ * .vflip()
828
+ * .build();
829
+ * ```
830
+ *
350
831
  * @see {@link FilterPresetBase.vflip}
351
832
  */
352
833
  vflip(): this;
@@ -356,8 +837,23 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
356
837
  * @param type - Fade type ('in' or 'out')
357
838
  * @param start - Start time in seconds
358
839
  * @param duration - Fade duration in seconds
840
+ *
359
841
  * @returns This instance for chaining
360
842
  *
843
+ * @example
844
+ * ```typescript
845
+ * const chain = FilterPresets.chain()
846
+ * .fade('in', 0, 2)
847
+ * .build();
848
+ * ```
849
+ *
850
+ * @example
851
+ * ```typescript
852
+ * const chain = FilterPresets.chain()
853
+ * .fade('out', 10, 1.5)
854
+ * .build();
855
+ * ```
856
+ *
361
857
  * @see {@link FilterPresetBase.fade}
362
858
  */
363
859
  fade(type: 'in' | 'out', start: number, duration: number): this;
@@ -367,8 +863,23 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
367
863
  * @param x - X position (default: 0)
368
864
  * @param y - Y position (default: 0)
369
865
  * @param options - Additional overlay options
866
+ *
370
867
  * @returns This instance for chaining
371
868
  *
869
+ * @example
870
+ * ```typescript
871
+ * const chain = FilterPresets.chain()
872
+ * .overlay(100, 50)
873
+ * .build();
874
+ * ```
875
+ *
876
+ * @example
877
+ * ```typescript
878
+ * const chain = FilterPresets.chain()
879
+ * .overlay(10, 10, { enable: 'between(t,5,10)' })
880
+ * .build();
881
+ * ```
882
+ *
372
883
  * @see {@link FilterPresetBase.overlay}
373
884
  */
374
885
  overlay(x?: number, y?: number, options?: Record<string, string>): this;
@@ -376,8 +887,23 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
376
887
  * Adds a volume filter to the chain.
377
888
  *
378
889
  * @param factor - Volume factor
890
+ *
379
891
  * @returns This instance for chaining
380
892
  *
893
+ * @example
894
+ * ```typescript
895
+ * const chain = FilterPresets.chain()
896
+ * .volume(0.5)
897
+ * .build();
898
+ * ```
899
+ *
900
+ * @example
901
+ * ```typescript
902
+ * const chain = FilterPresets.chain()
903
+ * .volume(2.0)
904
+ * .build();
905
+ * ```
906
+ *
381
907
  * @see {@link FilterPresetBase.volume}
382
908
  */
383
909
  volume(factor: number): this;
@@ -387,17 +913,72 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
387
913
  * @param sampleFormat - Target sample format
388
914
  * @param sampleRate - Target sample rate (optional)
389
915
  * @param channelLayout - Target channel layout (optional)
916
+ *
390
917
  * @returns This instance for chaining
391
918
  *
919
+ * @example
920
+ * ```typescript
921
+ * const chain = FilterPresets.chain()
922
+ * .aformat(AV_SAMPLE_FMT_FLT, 48000, 'stereo')
923
+ * .build();
924
+ * ```
925
+ *
926
+ * @example
927
+ * ```typescript
928
+ * const chain = FilterPresets.chain()
929
+ * .aformat('s16', 44100)
930
+ * .build();
931
+ * ```
932
+ *
392
933
  * @see {@link FilterPresetBase.aformat}
393
934
  */
394
935
  aformat(sampleFormat: string | AVSampleFormat, sampleRate?: number, channelLayout?: string): this;
936
+ /**
937
+ * Adds an asetnsamples filter to the chain.
938
+ *
939
+ * @param samples - Number of samples per frame
940
+ * @param padding - Whether to pad or drop samples (default: true)
941
+ *
942
+ * @returns This instance for chaining
943
+ *
944
+ * @example
945
+ * ```typescript
946
+ * const chain = FilterPresets.chain()
947
+ * .asetnsamples(960)
948
+ * .build();
949
+ * ```
950
+ *
951
+ * @example
952
+ * ```typescript
953
+ * const chain = FilterPresets.chain()
954
+ * .asetnsamples(1024, false)
955
+ * .build();
956
+ * ```
957
+ *
958
+ * @see {@link FilterPresetBase.asetnsamples}
959
+ */
960
+ asetnsamples(samples: number, padding?: boolean): this;
395
961
  /**
396
962
  * Adds an atempo filter to the chain.
397
963
  *
398
964
  * @param factor - Tempo factor (0.5 to 2.0)
965
+ *
399
966
  * @returns This instance for chaining
400
967
  *
968
+ * @example
969
+ * ```typescript
970
+ * const chain = FilterPresets.chain()
971
+ * .atempo(1.5)
972
+ * .build();
973
+ * ```
974
+ *
975
+ * @example
976
+ * ```typescript
977
+ * const chain = FilterPresets.chain()
978
+ * .atempo(0.8)
979
+ * .build();
980
+ * ```
981
+ *
401
982
  * @see {@link FilterPresetBase.atempo}
402
983
  */
403
984
  atempo(factor: number): this;
@@ -407,8 +988,23 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
407
988
  * @param type - Fade type ('in' or 'out')
408
989
  * @param start - Start time in seconds
409
990
  * @param duration - Fade duration in seconds
991
+ *
410
992
  * @returns This instance for chaining
411
993
  *
994
+ * @example
995
+ * ```typescript
996
+ * const chain = FilterPresets.chain()
997
+ * .afade('in', 0, 3)
998
+ * .build();
999
+ * ```
1000
+ *
1001
+ * @example
1002
+ * ```typescript
1003
+ * const chain = FilterPresets.chain()
1004
+ * .afade('out', 25, 2)
1005
+ * .build();
1006
+ * ```
1007
+ *
412
1008
  * @see {@link FilterPresetBase.afade}
413
1009
  */
414
1010
  afade(type: 'in' | 'out', start: number, duration: number): this;
@@ -417,27 +1013,309 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
417
1013
  *
418
1014
  * @param inputs - Number of inputs (default: 2)
419
1015
  * @param duration - Duration mode (default: 'longest')
1016
+ *
420
1017
  * @returns This instance for chaining
421
1018
  *
1019
+ * @example
1020
+ * ```typescript
1021
+ * const chain = FilterPresets.chain()
1022
+ * .amix(3, 'longest')
1023
+ * .build();
1024
+ * ```
1025
+ *
1026
+ * @example
1027
+ * ```typescript
1028
+ * const chain = FilterPresets.chain()
1029
+ * .amix(2, 'first')
1030
+ * .build();
1031
+ * ```
1032
+ *
422
1033
  * @see {@link FilterPresetBase.amix}
423
1034
  */
424
1035
  amix(inputs?: number, duration?: 'first' | 'longest' | 'shortest'): this;
1036
+ /**
1037
+ * Adds a pad filter to the chain.
1038
+ *
1039
+ * @param width - Target width
1040
+ * @param height - Target height
1041
+ * @param x - X position of input
1042
+ * @param y - Y position of input
1043
+ * @param color - Padding color
1044
+ *
1045
+ * @returns This instance for chaining
1046
+ *
1047
+ * @example
1048
+ * ```typescript
1049
+ * chain.pad('iw*2', 'ih*2') // Double the canvas size
1050
+ * ```
1051
+ *
1052
+ * @see {@link FilterPresetBase.pad}
1053
+ */
1054
+ pad(width: string | number, height: string | number, x?: string, y?: string, color?: string): this;
1055
+ /**
1056
+ * Adds a trim filter to the chain.
1057
+ *
1058
+ * @param start - Start time in seconds
1059
+ * @param end - End time in seconds
1060
+ * @param duration - Duration in seconds
1061
+ *
1062
+ * @returns This instance for chaining
1063
+ *
1064
+ * @example
1065
+ * ```typescript
1066
+ * chain.trim(10, 20) // Extract 10 seconds from t=10 to t=20
1067
+ * ```
1068
+ *
1069
+ * @see {@link FilterPresetBase.trim}
1070
+ */
1071
+ trim(start: number, end?: number, duration?: number): this;
1072
+ /**
1073
+ * Adds a setpts filter to the chain.
1074
+ *
1075
+ * @param expression - PTS expression
1076
+ *
1077
+ * @returns This instance for chaining
1078
+ *
1079
+ * @example
1080
+ * ```typescript
1081
+ * chain.setpts('PTS/2') // Double playback speed
1082
+ * ```
1083
+ *
1084
+ * @see {@link FilterPresetBase.setpts}
1085
+ */
1086
+ setpts(expression: string): this;
1087
+ /**
1088
+ * Adds an asetpts filter to the chain.
1089
+ *
1090
+ * @param expression - PTS expression
1091
+ *
1092
+ * @returns This instance for chaining
1093
+ *
1094
+ * @example
1095
+ * ```typescript
1096
+ * chain.asetpts('PTS-STARTPTS') // Reset audio timestamps
1097
+ * ```
1098
+ *
1099
+ * @see {@link FilterPresetBase.asetpts}
1100
+ */
1101
+ asetpts(expression: string): this;
1102
+ /**
1103
+ * Adds a setsar filter to the chain.
1104
+ *
1105
+ * @param ratio - Sample aspect ratio
1106
+ *
1107
+ * @returns This instance for chaining
1108
+ *
1109
+ * @example
1110
+ * ```typescript
1111
+ * chain.setsar('1:1') // Square pixels
1112
+ * ```
1113
+ *
1114
+ * @see {@link FilterPresetBase.setsar}
1115
+ */
1116
+ setsar(ratio: string | number): this;
1117
+ /**
1118
+ * Adds a setdar filter to the chain.
1119
+ *
1120
+ * @param ratio - Display aspect ratio
1121
+ *
1122
+ * @returns This instance for chaining
1123
+ *
1124
+ * @example
1125
+ * ```typescript
1126
+ * chain.setdar('16:9') // Set widescreen aspect
1127
+ * ```
1128
+ *
1129
+ * @see {@link FilterPresetBase.setdar}
1130
+ */
1131
+ setdar(ratio: string | number): this;
1132
+ /**
1133
+ * Adds an apad filter to the chain.
1134
+ *
1135
+ * @param wholeDuration - Minimum total duration
1136
+ * @param padDuration - Padding duration to add
1137
+ *
1138
+ * @returns This instance for chaining
1139
+ *
1140
+ * @example
1141
+ * ```typescript
1142
+ * chain.apad(10) // Ensure at least 10 seconds of audio
1143
+ * ```
1144
+ *
1145
+ * @see {@link FilterPresetBase.apad}
1146
+ */
1147
+ apad(wholeDuration?: number, padDuration?: number): this;
1148
+ /**
1149
+ * Adds a select filter to the chain.
1150
+ *
1151
+ * @param expression - Selection expression
1152
+ *
1153
+ * @returns This instance for chaining
1154
+ *
1155
+ * @example
1156
+ * ```typescript
1157
+ * chain.select('eq(pict_type,I)') // Select only I-frames
1158
+ * ```
1159
+ *
1160
+ * @see {@link FilterPresetBase.select}
1161
+ */
1162
+ select(expression: string): this;
1163
+ /**
1164
+ * Adds an aselect filter to the chain.
1165
+ *
1166
+ * @param expression - Selection expression
1167
+ *
1168
+ * @returns This instance for chaining
1169
+ *
1170
+ * @example
1171
+ * ```typescript
1172
+ * chain.aselect('between(t,10,20)') // Select audio between 10-20s
1173
+ * ```
1174
+ *
1175
+ * @see {@link FilterPresetBase.aselect}
1176
+ */
1177
+ aselect(expression: string): this;
1178
+ /**
1179
+ * Adds a concat filter to the chain.
1180
+ *
1181
+ * @param n - Number of input segments
1182
+ * @param v - Number of video streams
1183
+ * @param a - Number of audio streams
1184
+ *
1185
+ * @returns This instance for chaining
1186
+ *
1187
+ * @example
1188
+ * ```typescript
1189
+ * chain.concat(3, 1, 1) // Concatenate 3 segments with video and audio
1190
+ * ```
1191
+ *
1192
+ * @see {@link FilterPresetBase.concat}
1193
+ */
1194
+ concat(n: number, v?: number, a?: number): this;
1195
+ /**
1196
+ * Adds an amerge filter to the chain.
1197
+ *
1198
+ * @param inputs - Number of input streams
1199
+ *
1200
+ * @returns This instance for chaining
1201
+ *
1202
+ * @example
1203
+ * ```typescript
1204
+ * chain.amerge(2) // Merge 2 audio streams
1205
+ * ```
1206
+ *
1207
+ * @see {@link FilterPresetBase.amerge}
1208
+ */
1209
+ amerge(inputs?: number): this;
1210
+ /**
1211
+ * Adds a channelmap filter to the chain.
1212
+ *
1213
+ * @param map - Channel mapping string
1214
+ *
1215
+ * @returns This instance for chaining
1216
+ *
1217
+ * @example
1218
+ * ```typescript
1219
+ * chain.channelmap('FL-FR|FR-FL') // Swap stereo channels
1220
+ * ```
1221
+ *
1222
+ * @see {@link FilterPresetBase.channelmap}
1223
+ */
1224
+ channelmap(map: string): this;
1225
+ /**
1226
+ * Adds a channelsplit filter to the chain.
1227
+ *
1228
+ * @param channelLayout - Channel layout to split
1229
+ *
1230
+ * @returns This instance for chaining
1231
+ *
1232
+ * @example
1233
+ * ```typescript
1234
+ * chain.channelsplit('stereo') // Split stereo into two mono streams
1235
+ * ```
1236
+ *
1237
+ * @see {@link FilterPresetBase.channelsplit}
1238
+ */
1239
+ channelsplit(channelLayout?: string): this;
1240
+ /**
1241
+ * Adds a loudnorm filter to the chain.
1242
+ *
1243
+ * @param I - Integrated loudness target (LUFS)
1244
+ * @param TP - True peak (dBTP)
1245
+ * @param LRA - Loudness range (LU)
1246
+ *
1247
+ * @returns This instance for chaining
1248
+ *
1249
+ * @example
1250
+ * ```typescript
1251
+ * chain.loudnorm(-16, -1.5, 11) // Streaming loudness standard
1252
+ * ```
1253
+ *
1254
+ * @see {@link FilterPresetBase.loudnorm}
1255
+ */
1256
+ loudnorm(I?: number, TP?: number, LRA?: number): this;
1257
+ /**
1258
+ * Adds a compand filter to the chain.
1259
+ *
1260
+ * @param attacks - Attack times
1261
+ * @param decays - Decay times
1262
+ * @param points - Transfer function points
1263
+ * @param gain - Output gain
1264
+ *
1265
+ * @returns This instance for chaining
1266
+ *
1267
+ * @example
1268
+ * ```typescript
1269
+ * chain.compand('0.3|0.3', '1|1', '-90/-60|-60/-40|-40/-30|-20/-20', 6)
1270
+ * ```
1271
+ *
1272
+ * @see {@link FilterPresetBase.compand}
1273
+ */
1274
+ compand(attacks: string, decays: string, points: string, gain?: number): this;
425
1275
  /**
426
1276
  * Adds a transpose filter to the chain (hardware-specific).
427
1277
  * Only available for hardware presets that support transpose
428
1278
  *
429
- * @param dir - Transpose direction (default: 0)
1279
+ * @param mode - Transpose mode (number or string)
1280
+ *
430
1281
  * @returns This instance for chaining
431
1282
  *
1283
+ * @example
1284
+ * ```typescript
1285
+ * const chain = FilterPresets.chain()
1286
+ * .transpose('clock')
1287
+ * .build();
1288
+ * ```
1289
+ *
1290
+ * @example
1291
+ * ```typescript
1292
+ * const chain = FilterPresets.chain()
1293
+ * .transpose('cclock_flip')
1294
+ * .build();
1295
+ * ```
432
1296
  */
433
- transpose(dir?: number): this;
1297
+ transpose(mode?: number | 'clock' | 'cclock' | 'clock_flip' | 'cclock_flip'): this;
434
1298
  /**
435
1299
  * Adds a tonemap filter to the chain (hardware-specific).
436
1300
  * Only available for hardware presets that support tonemapping
437
1301
  *
438
1302
  * @param options - Tonemapping options
1303
+ *
439
1304
  * @returns This instance for chaining
440
1305
  *
1306
+ * @example
1307
+ * ```typescript
1308
+ * const chain = FilterPresets.chain()
1309
+ * .tonemap()
1310
+ * .build();
1311
+ * ```
1312
+ *
1313
+ * @example
1314
+ * ```typescript
1315
+ * const chain = FilterPresets.chain()
1316
+ * .tonemap({ tonemap: 'hable', desat: '0' })
1317
+ * .build();
1318
+ * ```
441
1319
  */
442
1320
  tonemap(options?: Record<string, string>): this;
443
1321
  /**
@@ -445,8 +1323,22 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
445
1323
  * Only available for hardware presets that support deinterlacing
446
1324
  *
447
1325
  * @param mode - Deinterlace mode (optional)
1326
+ *
448
1327
  * @returns This instance for chaining
449
1328
  *
1329
+ * @example
1330
+ * ```typescript
1331
+ * const chain = FilterPresets.chain()
1332
+ * .deinterlace()
1333
+ * .build();
1334
+ * ```
1335
+ *
1336
+ * @example
1337
+ * ```typescript
1338
+ * const chain = FilterPresets.chain()
1339
+ * .deinterlace('yadif')
1340
+ * .build();
1341
+ * ```
450
1342
  */
451
1343
  deinterlace(mode?: string): this;
452
1344
  /**
@@ -454,8 +1346,22 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
454
1346
  * Falls back to hflip/vflip if hardware flip not available
455
1347
  *
456
1348
  * @param direction - Flip direction ('h' or 'v')
1349
+ *
457
1350
  * @returns This instance for chaining
458
1351
  *
1352
+ * @example
1353
+ * ```typescript
1354
+ * const chain = FilterPresets.chain()
1355
+ * .flip('h')
1356
+ * .build();
1357
+ * ```
1358
+ *
1359
+ * @example
1360
+ * ```typescript
1361
+ * const chain = FilterPresets.chain()
1362
+ * .flip('v')
1363
+ * .build();
1364
+ * ```
459
1365
  */
460
1366
  flip(direction: 'h' | 'v'): this;
461
1367
  /**
@@ -464,8 +1370,22 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
464
1370
  *
465
1371
  * @param type - Blur type (default: 'avg')
466
1372
  * @param radius - Blur radius (optional)
1373
+ *
467
1374
  * @returns This instance for chaining
468
1375
  *
1376
+ * @example
1377
+ * ```typescript
1378
+ * const chain = FilterPresets.chain()
1379
+ * .blur('gaussian', 5)
1380
+ * .build();
1381
+ * ```
1382
+ *
1383
+ * @example
1384
+ * ```typescript
1385
+ * const chain = FilterPresets.chain()
1386
+ * .blur('box')
1387
+ * .build();
1388
+ * ```
469
1389
  */
470
1390
  blur(type?: 'avg' | 'gaussian' | 'box', radius?: number): this;
471
1391
  /**
@@ -473,8 +1393,22 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
473
1393
  * Only available for hardware presets that support sharpening
474
1394
  *
475
1395
  * @param amount - Sharpen amount (optional)
1396
+ *
476
1397
  * @returns This instance for chaining
477
1398
  *
1399
+ * @example
1400
+ * ```typescript
1401
+ * const chain = FilterPresets.chain()
1402
+ * .sharpen(1.5)
1403
+ * .build();
1404
+ * ```
1405
+ *
1406
+ * @example
1407
+ * ```typescript
1408
+ * const chain = FilterPresets.chain()
1409
+ * .sharpen()
1410
+ * .build();
1411
+ * ```
478
1412
  */
479
1413
  sharpen(amount?: number): this;
480
1414
  /**
@@ -483,27 +1417,72 @@ export declare abstract class ChainBuilderBase<T extends FilterPresetBase> exten
483
1417
  *
484
1418
  * @param type - Stack type ('h' for horizontal, 'v' for vertical, 'x' for grid)
485
1419
  * @param inputs - Number of inputs (default: 2)
1420
+ *
486
1421
  * @returns This instance for chaining
487
1422
  *
1423
+ * @example
1424
+ * ```typescript
1425
+ * const chain = FilterPresets.chain()
1426
+ * .stack('h', 2)
1427
+ * .build();
1428
+ * ```
1429
+ *
1430
+ * @example
1431
+ * ```typescript
1432
+ * const chain = FilterPresets.chain()
1433
+ * .stack('x', 4)
1434
+ * .build();
1435
+ * ```
488
1436
  */
489
1437
  stack(type: 'h' | 'v' | 'x', inputs?: number): this;
490
1438
  /**
491
1439
  * Adds a hwupload filter to upload frames to hardware.
492
1440
  *
493
1441
  * @returns This instance for chaining
1442
+ *
1443
+ * @example
1444
+ * ```typescript
1445
+ * const chain = FilterPresets.chain()
1446
+ * .hwupload()
1447
+ * .scale(1920, 1080)
1448
+ * .build();
1449
+ * ```
494
1450
  */
495
1451
  hwupload(): this;
496
1452
  /**
497
1453
  * Adds a hwdownload filter to download frames from hardware.
498
1454
  *
499
1455
  * @returns This instance for chaining
1456
+ *
1457
+ * @example
1458
+ * ```typescript
1459
+ * const chain = FilterPresets.chain()
1460
+ * .scale(1920, 1080)
1461
+ * .hwdownload()
1462
+ * .build();
1463
+ * ```
500
1464
  */
501
1465
  hwdownload(): this;
502
1466
  /**
503
1467
  * Adds a hwmap filter to map frames between hardware devices.
504
1468
  *
505
1469
  * @param derive - Device to derive from (optional)
1470
+ *
506
1471
  * @returns This instance for chaining
1472
+ *
1473
+ * @example
1474
+ * ```typescript
1475
+ * const chain = FilterPresets.chain()
1476
+ * .hwmap('cuda')
1477
+ * .build();
1478
+ * ```
1479
+ *
1480
+ * @example
1481
+ * ```typescript
1482
+ * const chain = FilterPresets.chain()
1483
+ * .hwmap()
1484
+ * .build();
1485
+ * ```
507
1486
  */
508
1487
  hwmap(derive?: string): this;
509
1488
  }
@@ -564,7 +1543,18 @@ export declare class FilterPresets extends FilterPresetBase {
564
1543
  * @param width - Target width
565
1544
  * @param height - Target height
566
1545
  * @param flags - Scaling algorithm flags (optional)
1546
+ *
567
1547
  * @returns Scale filter string
1548
+ *
1549
+ * @example
1550
+ * ```typescript
1551
+ * const filter = FilterPresets.scale(1920, 1080);
1552
+ * ```
1553
+ *
1554
+ * @example
1555
+ * ```typescript
1556
+ * const filter = FilterPresets.scale(1280, 720, 'lanczos');
1557
+ * ```
568
1558
  */
569
1559
  static scale(width: number, height: number, flags?: string): string;
570
1560
  /**
@@ -574,40 +1564,94 @@ export declare class FilterPresets extends FilterPresetBase {
574
1564
  * @param height - Crop height
575
1565
  * @param x - X position (default: 0)
576
1566
  * @param y - Y position (default: 0)
1567
+ *
577
1568
  * @returns Crop filter string
1569
+ *
1570
+ * @example
1571
+ * ```typescript
1572
+ * const filter = FilterPresets.crop(640, 480);
1573
+ * ```
1574
+ *
1575
+ * @example
1576
+ * ```typescript
1577
+ * const filter = FilterPresets.crop(1920, 1080, 100, 50);
1578
+ * ```
578
1579
  */
579
1580
  static crop(width: number, height: number, x?: number, y?: number): string;
580
1581
  /**
581
1582
  * Creates an FPS filter string.
582
1583
  *
583
1584
  * @param fps - Target frame rate
1585
+ *
584
1586
  * @returns FPS filter string
1587
+ *
1588
+ * @example
1589
+ * ```typescript
1590
+ * const filter = FilterPresets.fps(30);
1591
+ * ```
1592
+ *
1593
+ * @example
1594
+ * ```typescript
1595
+ * const filter = FilterPresets.fps(23.976);
1596
+ * ```
585
1597
  */
586
1598
  static fps(fps: number): string;
587
1599
  /**
588
1600
  * Creates a format filter string.
589
1601
  *
590
1602
  * @param pixelFormat - Target pixel format(s)
1603
+ *
591
1604
  * @returns Format filter string
1605
+ *
1606
+ * @example
1607
+ * ```typescript
1608
+ * const filter = FilterPresets.format('yuv420p');
1609
+ * ```
1610
+ *
1611
+ * @example
1612
+ * ```typescript
1613
+ * const filter = FilterPresets.format(AV_PIX_FMT_RGB24);
1614
+ * ```
592
1615
  */
593
1616
  static format(pixelFormat: string | AVPixelFormat | (string | AVPixelFormat)[]): string;
594
1617
  /**
595
1618
  * Creates a rotate filter string.
596
1619
  *
597
1620
  * @param angle - Rotation angle in degrees
1621
+ *
598
1622
  * @returns Rotate filter string
1623
+ *
1624
+ * @example
1625
+ * ```typescript
1626
+ * const filter = FilterPresets.rotate(45);
1627
+ * ```
1628
+ *
1629
+ * @example
1630
+ * ```typescript
1631
+ * const filter = FilterPresets.rotate(-90);
1632
+ * ```
599
1633
  */
600
1634
  static rotate(angle: number): string;
601
1635
  /**
602
1636
  * Creates a horizontal flip filter string.
603
1637
  *
604
1638
  * @returns Horizontal flip filter string
1639
+ *
1640
+ * @example
1641
+ * ```typescript
1642
+ * const filter = FilterPresets.hflip();
1643
+ * ```
605
1644
  */
606
1645
  static hflip(): string;
607
1646
  /**
608
1647
  * Creates a vertical flip filter string.
609
1648
  *
610
1649
  * @returns Vertical flip filter string
1650
+ *
1651
+ * @example
1652
+ * ```typescript
1653
+ * const filter = FilterPresets.vflip();
1654
+ * ```
611
1655
  */
612
1656
  static vflip(): string;
613
1657
  /**
@@ -616,7 +1660,18 @@ export declare class FilterPresets extends FilterPresetBase {
616
1660
  * @param type - Fade type ('in' or 'out')
617
1661
  * @param start - Start time in seconds
618
1662
  * @param duration - Fade duration in seconds
1663
+ *
619
1664
  * @returns Fade filter string
1665
+ *
1666
+ * @example
1667
+ * ```typescript
1668
+ * const filter = FilterPresets.fade('in', 0, 2);
1669
+ * ```
1670
+ *
1671
+ * @example
1672
+ * ```typescript
1673
+ * const filter = FilterPresets.fade('out', 10, 1.5);
1674
+ * ```
620
1675
  */
621
1676
  static fade(type: 'in' | 'out', start: number, duration: number): string;
622
1677
  /**
@@ -624,14 +1679,36 @@ export declare class FilterPresets extends FilterPresetBase {
624
1679
  *
625
1680
  * @param x - X position (default: 0)
626
1681
  * @param y - Y position (default: 0)
1682
+ *
627
1683
  * @returns Overlay filter string
1684
+ *
1685
+ * @example
1686
+ * ```typescript
1687
+ * const filter = FilterPresets.overlay(100, 50);
1688
+ * ```
1689
+ *
1690
+ * @example
1691
+ * ```typescript
1692
+ * const filter = FilterPresets.overlay();
1693
+ * ```
628
1694
  */
629
1695
  static overlay(x?: number, y?: number): string;
630
1696
  /**
631
1697
  * Creates a volume filter string.
632
1698
  *
633
1699
  * @param factor - Volume multiplication factor
1700
+ *
634
1701
  * @returns Volume filter string
1702
+ *
1703
+ * @example
1704
+ * ```typescript
1705
+ * const filter = FilterPresets.volume(0.5);
1706
+ * ```
1707
+ *
1708
+ * @example
1709
+ * ```typescript
1710
+ * const filter = FilterPresets.volume(2.0);
1711
+ * ```
635
1712
  */
636
1713
  static volume(factor: number): string;
637
1714
  /**
@@ -640,14 +1717,55 @@ export declare class FilterPresets extends FilterPresetBase {
640
1717
  * @param sampleFormat - Target sample format
641
1718
  * @param sampleRate - Target sample rate (optional)
642
1719
  * @param channelLayout - Target channel layout (optional)
1720
+ *
643
1721
  * @returns Audio format filter string
1722
+ *
1723
+ * @example
1724
+ * ```typescript
1725
+ * const filter = FilterPresets.aformat(AV_SAMPLE_FMT_FLT, 48000, 'stereo');
1726
+ * ```
1727
+ *
1728
+ * @example
1729
+ * ```typescript
1730
+ * const filter = FilterPresets.aformat('s16', 44100);
1731
+ * ```
644
1732
  */
645
1733
  static aformat(sampleFormat: string | AVSampleFormat, sampleRate?: number, channelLayout?: string): string;
1734
+ /**
1735
+ * Creates an asetnsamples filter string.
1736
+ *
1737
+ * @param samples - Number of samples per frame
1738
+ * @param padding - Whether to pad or drop samples (default: true)
1739
+ *
1740
+ * @returns Asetnsamples filter string
1741
+ *
1742
+ * @example
1743
+ * ```typescript
1744
+ * const filter = FilterPresets.asetnsamples(960);
1745
+ * ```
1746
+ *
1747
+ * @example
1748
+ * ```typescript
1749
+ * const filter = FilterPresets.asetnsamples(1024, false);
1750
+ * ```
1751
+ */
1752
+ static asetnsamples(samples: number, padding?: boolean): string;
646
1753
  /**
647
1754
  * Creates an atempo filter string.
648
1755
  *
649
1756
  * @param factor - Tempo factor (0.5 to 2.0)
1757
+ *
650
1758
  * @returns Atempo filter string
1759
+ *
1760
+ * @example
1761
+ * ```typescript
1762
+ * const filter = FilterPresets.atempo(1.5);
1763
+ * ```
1764
+ *
1765
+ * @example
1766
+ * ```typescript
1767
+ * const filter = FilterPresets.atempo(0.8);
1768
+ * ```
651
1769
  */
652
1770
  static atempo(factor: number): string;
653
1771
  /**
@@ -656,7 +1774,18 @@ export declare class FilterPresets extends FilterPresetBase {
656
1774
  * @param type - Fade type ('in' or 'out')
657
1775
  * @param start - Start time in seconds
658
1776
  * @param duration - Fade duration in seconds
1777
+ *
659
1778
  * @returns Audio fade filter string
1779
+ *
1780
+ * @example
1781
+ * ```typescript
1782
+ * const filter = FilterPresets.afade('in', 0, 3);
1783
+ * ```
1784
+ *
1785
+ * @example
1786
+ * ```typescript
1787
+ * const filter = FilterPresets.afade('out', 25, 2);
1788
+ * ```
660
1789
  */
661
1790
  static afade(type: 'in' | 'out', start: number, duration: number): string;
662
1791
  /**
@@ -664,7 +1793,18 @@ export declare class FilterPresets extends FilterPresetBase {
664
1793
  *
665
1794
  * @param inputs - Number of inputs (default: 2)
666
1795
  * @param duration - Duration mode (default: 'longest')
1796
+ *
667
1797
  * @returns Amix filter string
1798
+ *
1799
+ * @example
1800
+ * ```typescript
1801
+ * const filter = FilterPresets.amix(3, 'longest');
1802
+ * ```
1803
+ *
1804
+ * @example
1805
+ * ```typescript
1806
+ * const filter = FilterPresets.amix(2, 'first');
1807
+ * ```
668
1808
  */
669
1809
  static amix(inputs?: number, duration?: 'first' | 'longest' | 'shortest'): string;
670
1810
  }
@@ -676,7 +1816,7 @@ export declare class FilterPresets extends FilterPresetBase {
676
1816
  * @example
677
1817
  * ```typescript
678
1818
  * // Create hardware presets for CUDA
679
- * const hw = new HardwareFilterPresets(AV_HWDEVICE_TYPE_CUDA, 'cuda');
1819
+ * const hw = new HardwareFilterPresets(AV_HWDEVICE_TYPE_CUDA);
680
1820
  *
681
1821
  * // Check capabilities
682
1822
  * if (hw.support.scale) {
@@ -698,9 +1838,9 @@ export declare class HardwareFilterPresets extends FilterPresetBase {
698
1838
  readonly support: HardwareFilterSupport;
699
1839
  /**
700
1840
  * @param deviceType - Hardware device type enum
701
- * @param deviceTypeName - Hardware device type name (e.g., 'cuda', 'vaapi')
1841
+ * @param deviceTypeName - Optional hardware device type name (e.g., 'cuda', 'vaapi')
702
1842
  */
703
- constructor(deviceType: AVHWDeviceType, deviceTypeName: string);
1843
+ constructor(deviceType: AVHWDeviceType, deviceTypeName?: string);
704
1844
  /**
705
1845
  * Checks if a filter is hardware-accelerated.
706
1846
  *
@@ -743,8 +1883,18 @@ export declare class HardwareFilterPresets extends FilterPresetBase {
743
1883
  * @param width - Target width
744
1884
  * @param height - Target height
745
1885
  * @param options - Hardware-specific scaling options
1886
+ *
746
1887
  * @returns Hardware scale filter string or null if not supported
747
1888
  *
1889
+ * @example
1890
+ * ```typescript
1891
+ * const filter = hwPresets.scale(1920, 1080);
1892
+ * ```
1893
+ *
1894
+ * @example
1895
+ * ```typescript
1896
+ * const filter = hwPresets.scale(1280, 720, { npp: true });
1897
+ * ```
748
1898
  *
749
1899
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#scale_005fcuda | FFmpeg scale_cuda filter}
750
1900
  */
@@ -755,8 +1905,19 @@ export declare class HardwareFilterPresets extends FilterPresetBase {
755
1905
  * @param x - X position (default: 0)
756
1906
  * @param y - Y position (default: 0)
757
1907
  * @param options - Hardware-specific overlay options
1908
+ *
758
1909
  * @returns Hardware overlay filter string or null if not supported
759
1910
  *
1911
+ * @example
1912
+ * ```typescript
1913
+ * const filter = hwPresets.overlay(100, 50);
1914
+ * ```
1915
+ *
1916
+ * @example
1917
+ * ```typescript
1918
+ * const filter = hwPresets.overlay(0, 0, { eof_action: 'pass' });
1919
+ * ```
1920
+ *
760
1921
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#overlay_005fcuda | FFmpeg overlay_cuda filter}
761
1922
  */
762
1923
  overlay(x?: number, y?: number, options?: Record<string, string>): string | null;
@@ -765,22 +1926,42 @@ export declare class HardwareFilterPresets extends FilterPresetBase {
765
1926
  *
766
1927
  * Direction values:
767
1928
  * - 0: 90 degrees counter-clockwise and vertical flip
768
- * - 1: 90 degrees clockwise
769
- * - 2: 90 degrees counter-clockwise
770
- * - 3: 90 degrees clockwise and vertical flip
1929
+ * - 1 / 'clock': 90 degrees clockwise
1930
+ * - 2 / 'cclock': 90 degrees counter-clockwise
1931
+ * - 3 / 'clock_flip': 90 degrees clockwise and vertical flip
1932
+ *
1933
+ * @param mode - Transpose mode (number or string)
771
1934
  *
772
- * @param dir - Transpose direction (default: 0)
773
1935
  * @returns Hardware transpose filter string or null if not supported
774
1936
  *
1937
+ * @example
1938
+ * ```typescript
1939
+ * const filter = hwPresets.transpose('clock');
1940
+ * ```
1941
+ *
1942
+ * @example
1943
+ * ```typescript
1944
+ * const filter = hwPresets.transpose(2);
1945
+ * ```
775
1946
  */
776
- transpose(dir?: number): string | null;
1947
+ transpose(mode: number | 'clock' | 'cclock' | 'clock_flip' | 'cclock_flip'): string | null;
777
1948
  /**
778
1949
  * Creates a hardware-accelerated tonemap filter.
779
1950
  * Used for HDR to SDR conversion with hardware acceleration.
780
1951
  *
781
1952
  * @param options - Tonemapping options (algorithm, parameters)
1953
+ *
782
1954
  * @returns Hardware tonemap filter string or null if not supported
783
1955
  *
1956
+ * @example
1957
+ * ```typescript
1958
+ * const filter = hwPresets.tonemap();
1959
+ * ```
1960
+ *
1961
+ * @example
1962
+ * ```typescript
1963
+ * const filter = hwPresets.tonemap({ tonemap: 'hable', desat: '0' });
1964
+ * ```
784
1965
  */
785
1966
  tonemap(options?: Record<string, string>): string | null;
786
1967
  /**
@@ -794,8 +1975,18 @@ export declare class HardwareFilterPresets extends FilterPresetBase {
794
1975
  * - VideoToolbox: yadif_videotoolbox
795
1976
  *
796
1977
  * @param mode - Deinterlacing mode (optional)
1978
+ *
797
1979
  * @returns Hardware deinterlace filter string or null if not supported
798
1980
  *
1981
+ * @example
1982
+ * ```typescript
1983
+ * const filter = hwPresets.deinterlace();
1984
+ * ```
1985
+ *
1986
+ * @example
1987
+ * ```typescript
1988
+ * const filter = hwPresets.deinterlace('send_field');
1989
+ * ```
799
1990
  */
800
1991
  deinterlace(mode?: string): string | null;
801
1992
  /**
@@ -803,8 +1994,18 @@ export declare class HardwareFilterPresets extends FilterPresetBase {
803
1994
  * Currently only Vulkan supports hardware flip filters.
804
1995
  *
805
1996
  * @param direction - Flip direction ('h' for horizontal, 'v' for vertical)
1997
+ *
806
1998
  * @returns Hardware flip filter string or null if not supported
807
1999
  *
2000
+ * @example
2001
+ * ```typescript
2002
+ * const filter = hwPresets.flip('h');
2003
+ * ```
2004
+ *
2005
+ * @example
2006
+ * ```typescript
2007
+ * const filter = hwPresets.flip('v');
2008
+ * ```
808
2009
  */
809
2010
  flip(direction: 'h' | 'v'): string | null;
810
2011
  /**
@@ -817,8 +2018,18 @@ export declare class HardwareFilterPresets extends FilterPresetBase {
817
2018
  *
818
2019
  * @param type - Blur type ('avg', 'gaussian', or 'box', default: 'avg')
819
2020
  * @param radius - Blur radius (optional)
2021
+ *
820
2022
  * @returns Hardware blur filter string or null if not supported
821
2023
  *
2024
+ * @example
2025
+ * ```typescript
2026
+ * const filter = hwPresets.blur('gaussian', 5);
2027
+ * ```
2028
+ *
2029
+ * @example
2030
+ * ```typescript
2031
+ * const filter = hwPresets.blur('avg');
2032
+ * ```
822
2033
  */
823
2034
  blur(type?: 'avg' | 'gaussian' | 'box', radius?: number): string | null;
824
2035
  /**
@@ -830,8 +2041,18 @@ export declare class HardwareFilterPresets extends FilterPresetBase {
830
2041
  * - CUDA: sharpen_npp (NPP-based)
831
2042
  *
832
2043
  * @param amount - Sharpening amount (optional)
2044
+ *
833
2045
  * @returns Hardware sharpen filter string or null if not supported
834
2046
  *
2047
+ * @example
2048
+ * ```typescript
2049
+ * const filter = hwPresets.sharpen(1.5);
2050
+ * ```
2051
+ *
2052
+ * @example
2053
+ * ```typescript
2054
+ * const filter = hwPresets.sharpen();
2055
+ * ```
835
2056
  */
836
2057
  sharpen(amount?: number): string | null;
837
2058
  /**
@@ -840,8 +2061,18 @@ export declare class HardwareFilterPresets extends FilterPresetBase {
840
2061
  *
841
2062
  * @param type - Stack type ('h' for horizontal, 'v' for vertical, 'x' for grid)
842
2063
  * @param inputs - Number of inputs to stack (default: 2)
2064
+ *
843
2065
  * @returns Hardware stack filter string or null if not supported
844
2066
  *
2067
+ * @example
2068
+ * ```typescript
2069
+ * const filter = hwPresets.stack('h', 2);
2070
+ * ```
2071
+ *
2072
+ * @example
2073
+ * ```typescript
2074
+ * const filter = hwPresets.stack('x', 4);
2075
+ * ```
845
2076
  */
846
2077
  stack(type: 'h' | 'v' | 'x', inputs?: number): string | null;
847
2078
  /**
@@ -850,6 +2081,11 @@ export declare class HardwareFilterPresets extends FilterPresetBase {
850
2081
  *
851
2082
  * @returns Hardware upload filter string
852
2083
  *
2084
+ * @example
2085
+ * ```typescript
2086
+ * const filter = hwPresets.hwupload();
2087
+ * ```
2088
+ *
853
2089
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#hwupload | FFmpeg hwupload filter}
854
2090
  */
855
2091
  hwupload(): string | null;
@@ -858,6 +2094,11 @@ export declare class HardwareFilterPresets extends FilterPresetBase {
858
2094
  *
859
2095
  * @returns Hardware download filter string
860
2096
  *
2097
+ * @example
2098
+ * ```typescript
2099
+ * const filter = hwPresets.hwdownload();
2100
+ * ```
2101
+ *
861
2102
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#hwdownload | FFmpeg hwdownload filter}
862
2103
  */
863
2104
  hwdownload(): string | null;
@@ -865,8 +2106,19 @@ export declare class HardwareFilterPresets extends FilterPresetBase {
865
2106
  * Creates a hwmap filter to map frames between hardware devices.
866
2107
  *
867
2108
  * @param derive - Device to derive from (optional)
2109
+ *
868
2110
  * @returns Hardware map filter string
869
2111
  *
2112
+ * @example
2113
+ * ```typescript
2114
+ * const filter = hwPresets.hwmap('cuda');
2115
+ * ```
2116
+ *
2117
+ * @example
2118
+ * ```typescript
2119
+ * const filter = hwPresets.hwmap();
2120
+ * ```
2121
+ *
870
2122
  * @see {@link https://ffmpeg.org/ffmpeg-filters.html#hwmap | FFmpeg hwmap filter}
871
2123
  */
872
2124
  hwmap(derive?: string): string | null;