node-av 1.1.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 (166) hide show
  1. package/README.md +51 -59
  2. package/dist/api/bitstream-filter.d.ts +183 -123
  3. package/dist/api/bitstream-filter.js +185 -127
  4. package/dist/api/bitstream-filter.js.map +1 -1
  5. package/dist/api/decoder.d.ts +282 -130
  6. package/dist/api/decoder.js +290 -142
  7. package/dist/api/decoder.js.map +1 -1
  8. package/dist/api/encoder.d.ts +249 -160
  9. package/dist/api/encoder.js +276 -207
  10. package/dist/api/encoder.js.map +1 -1
  11. package/dist/api/filter-presets.d.ts +1944 -96
  12. package/dist/api/filter-presets.js +2059 -105
  13. package/dist/api/filter-presets.js.map +1 -1
  14. package/dist/api/filter.d.ts +264 -200
  15. package/dist/api/filter.js +269 -231
  16. package/dist/api/filter.js.map +1 -1
  17. package/dist/api/hardware.d.ts +246 -117
  18. package/dist/api/hardware.js +440 -217
  19. package/dist/api/hardware.js.map +1 -1
  20. package/dist/api/index.d.ts +3 -3
  21. package/dist/api/index.js +1 -1
  22. package/dist/api/index.js.map +1 -1
  23. package/dist/api/io-stream.d.ts +65 -55
  24. package/dist/api/io-stream.js +43 -40
  25. package/dist/api/io-stream.js.map +1 -1
  26. package/dist/api/media-input.d.ts +242 -139
  27. package/dist/api/media-input.js +205 -103
  28. package/dist/api/media-input.js.map +1 -1
  29. package/dist/api/media-output.d.ts +208 -126
  30. package/dist/api/media-output.js +212 -126
  31. package/dist/api/media-output.js.map +1 -1
  32. package/dist/api/pipeline.d.ts +361 -38
  33. package/dist/api/pipeline.js +255 -14
  34. package/dist/api/pipeline.js.map +1 -1
  35. package/dist/api/types.d.ts +26 -187
  36. package/dist/api/utilities/audio-sample.d.ts +0 -8
  37. package/dist/api/utilities/audio-sample.js +0 -8
  38. package/dist/api/utilities/audio-sample.js.map +1 -1
  39. package/dist/api/utilities/channel-layout.d.ts +0 -8
  40. package/dist/api/utilities/channel-layout.js +0 -8
  41. package/dist/api/utilities/channel-layout.js.map +1 -1
  42. package/dist/api/utilities/image.d.ts +0 -8
  43. package/dist/api/utilities/image.js +0 -8
  44. package/dist/api/utilities/image.js.map +1 -1
  45. package/dist/api/utilities/index.d.ts +3 -3
  46. package/dist/api/utilities/index.js +3 -3
  47. package/dist/api/utilities/index.js.map +1 -1
  48. package/dist/api/utilities/media-type.d.ts +1 -9
  49. package/dist/api/utilities/media-type.js +1 -9
  50. package/dist/api/utilities/media-type.js.map +1 -1
  51. package/dist/api/utilities/pixel-format.d.ts +1 -9
  52. package/dist/api/utilities/pixel-format.js +1 -9
  53. package/dist/api/utilities/pixel-format.js.map +1 -1
  54. package/dist/api/utilities/sample-format.d.ts +1 -9
  55. package/dist/api/utilities/sample-format.js +1 -9
  56. package/dist/api/utilities/sample-format.js.map +1 -1
  57. package/dist/api/utilities/streaming.d.ts +0 -8
  58. package/dist/api/utilities/streaming.js +0 -8
  59. package/dist/api/utilities/streaming.js.map +1 -1
  60. package/dist/api/utilities/timestamp.d.ts +0 -8
  61. package/dist/api/utilities/timestamp.js +0 -8
  62. package/dist/api/utilities/timestamp.js.map +1 -1
  63. package/dist/api/utils.d.ts +1 -2
  64. package/dist/api/utils.js +11 -0
  65. package/dist/api/utils.js.map +1 -1
  66. package/dist/constants/constants.d.ts +1 -1
  67. package/dist/constants/constants.js +2 -0
  68. package/dist/constants/constants.js.map +1 -1
  69. package/dist/lib/audio-fifo.d.ts +127 -170
  70. package/dist/lib/audio-fifo.js +130 -173
  71. package/dist/lib/audio-fifo.js.map +1 -1
  72. package/dist/lib/binding.d.ts +1 -0
  73. package/dist/lib/binding.js +7 -0
  74. package/dist/lib/binding.js.map +1 -1
  75. package/dist/lib/bitstream-filter-context.d.ts +139 -184
  76. package/dist/lib/bitstream-filter-context.js +139 -188
  77. package/dist/lib/bitstream-filter-context.js.map +1 -1
  78. package/dist/lib/bitstream-filter.d.ts +68 -54
  79. package/dist/lib/bitstream-filter.js +68 -54
  80. package/dist/lib/bitstream-filter.js.map +1 -1
  81. package/dist/lib/codec-context.d.ts +316 -380
  82. package/dist/lib/codec-context.js +316 -381
  83. package/dist/lib/codec-context.js.map +1 -1
  84. package/dist/lib/codec-parameters.d.ts +160 -170
  85. package/dist/lib/codec-parameters.js +162 -172
  86. package/dist/lib/codec-parameters.js.map +1 -1
  87. package/dist/lib/codec-parser.d.ts +91 -104
  88. package/dist/lib/codec-parser.js +92 -103
  89. package/dist/lib/codec-parser.js.map +1 -1
  90. package/dist/lib/codec.d.ts +266 -283
  91. package/dist/lib/codec.js +270 -287
  92. package/dist/lib/codec.js.map +1 -1
  93. package/dist/lib/dictionary.d.ts +149 -203
  94. package/dist/lib/dictionary.js +158 -212
  95. package/dist/lib/dictionary.js.map +1 -1
  96. package/dist/lib/error.d.ts +96 -130
  97. package/dist/lib/error.js +98 -128
  98. package/dist/lib/error.js.map +1 -1
  99. package/dist/lib/filter-context.d.ts +284 -218
  100. package/dist/lib/filter-context.js +290 -227
  101. package/dist/lib/filter-context.js.map +1 -1
  102. package/dist/lib/filter-graph.d.ts +251 -292
  103. package/dist/lib/filter-graph.js +253 -294
  104. package/dist/lib/filter-graph.js.map +1 -1
  105. package/dist/lib/filter-inout.d.ts +87 -95
  106. package/dist/lib/filter-inout.js +87 -95
  107. package/dist/lib/filter-inout.js.map +1 -1
  108. package/dist/lib/filter.d.ts +93 -111
  109. package/dist/lib/filter.js +93 -111
  110. package/dist/lib/filter.js.map +1 -1
  111. package/dist/lib/format-context.d.ts +320 -428
  112. package/dist/lib/format-context.js +313 -385
  113. package/dist/lib/format-context.js.map +1 -1
  114. package/dist/lib/frame.d.ts +262 -405
  115. package/dist/lib/frame.js +263 -408
  116. package/dist/lib/frame.js.map +1 -1
  117. package/dist/lib/hardware-device-context.d.ts +149 -203
  118. package/dist/lib/hardware-device-context.js +149 -203
  119. package/dist/lib/hardware-device-context.js.map +1 -1
  120. package/dist/lib/hardware-frames-context.d.ts +170 -180
  121. package/dist/lib/hardware-frames-context.js +171 -181
  122. package/dist/lib/hardware-frames-context.js.map +1 -1
  123. package/dist/lib/index.d.ts +3 -2
  124. package/dist/lib/index.js +3 -3
  125. package/dist/lib/index.js.map +1 -1
  126. package/dist/lib/input-format.d.ts +89 -117
  127. package/dist/lib/input-format.js +89 -117
  128. package/dist/lib/input-format.js.map +1 -1
  129. package/dist/lib/io-context.d.ts +209 -241
  130. package/dist/lib/io-context.js +220 -252
  131. package/dist/lib/io-context.js.map +1 -1
  132. package/dist/lib/log.d.ts +85 -119
  133. package/dist/lib/log.js +85 -122
  134. package/dist/lib/log.js.map +1 -1
  135. package/dist/lib/native-types.d.ts +118 -106
  136. package/dist/lib/native-types.js +0 -7
  137. package/dist/lib/native-types.js.map +1 -1
  138. package/dist/lib/option.d.ts +437 -218
  139. package/dist/lib/option.js +462 -226
  140. package/dist/lib/option.js.map +1 -1
  141. package/dist/lib/output-format.d.ts +77 -101
  142. package/dist/lib/output-format.js +77 -101
  143. package/dist/lib/output-format.js.map +1 -1
  144. package/dist/lib/packet.d.ts +172 -240
  145. package/dist/lib/packet.js +172 -241
  146. package/dist/lib/packet.js.map +1 -1
  147. package/dist/lib/rational.d.ts +0 -2
  148. package/dist/lib/rational.js +0 -2
  149. package/dist/lib/rational.js.map +1 -1
  150. package/dist/lib/software-resample-context.d.ts +241 -325
  151. package/dist/lib/software-resample-context.js +242 -326
  152. package/dist/lib/software-resample-context.js.map +1 -1
  153. package/dist/lib/software-scale-context.d.ts +129 -173
  154. package/dist/lib/software-scale-context.js +131 -175
  155. package/dist/lib/software-scale-context.js.map +1 -1
  156. package/dist/lib/stream.d.ts +87 -197
  157. package/dist/lib/stream.js +87 -197
  158. package/dist/lib/stream.js.map +1 -1
  159. package/dist/lib/utilities.d.ts +435 -181
  160. package/dist/lib/utilities.js +438 -182
  161. package/dist/lib/utilities.js.map +1 -1
  162. package/install/check.js +0 -1
  163. package/install/ffmpeg.js +0 -11
  164. package/package.json +25 -18
  165. package/release_notes.md +24 -59
  166. package/CHANGELOG.md +0 -8
@@ -1,11 +1,12 @@
1
1
  import type { AVCodecID } from '../constants/constants.js';
2
2
  import type { NativeBitStreamFilter, NativeWrapper } from './native-types.js';
3
3
  /**
4
- * Bitstream filter definition.
4
+ * Bitstream filter descriptor.
5
5
  *
6
- * Represents a bitstream filter for manipulating encoded data without decoding.
7
- * Allows modification of codec-specific headers, packet metadata, and bitstream syntax.
8
- * This is an immutable descriptor - actual filtering happens via BitStreamFilterContext.
6
+ * Provides access to bitstream filter properties and codec compatibility information.
7
+ * Bitstream filters are used to modify or analyze compressed bitstreams without
8
+ * full decoding/encoding. Common uses include H.264/HEVC parameter set extraction,
9
+ * VP9 superframe splitting, and adding/removing codec-specific headers.
9
10
  *
10
11
  * Direct mapping to FFmpeg's AVBitStreamFilter.
11
12
  *
@@ -13,111 +14,124 @@ import type { NativeBitStreamFilter, NativeWrapper } from './native-types.js';
13
14
  * ```typescript
14
15
  * import { BitStreamFilter } from 'node-av';
15
16
  *
16
- * // Find a specific bitstream filter
17
- * const h264Mp4ToAnnexB = BitStreamFilter.getByName('h264_mp4toannexb');
18
- * if (!h264Mp4ToAnnexB) throw new Error('h264_mp4toannexb filter not found');
19
- *
20
- * console.log(`Filter: ${h264Mp4ToAnnexB.name}`);
21
- * console.log(`Supported codecs: ${h264Mp4ToAnnexB.codecIds}`);
17
+ * // Get a specific bitstream filter
18
+ * const h264Filter = BitStreamFilter.getByName('h264_mp4toannexb');
19
+ * if (h264Filter) {
20
+ * console.log(`Filter: ${h264Filter.name}`);
21
+ * console.log(`Supported codecs: ${h264Filter.codecIds}`);
22
+ * }
22
23
  *
23
24
  * // List all available bitstream filters
24
25
  * const filters = BitStreamFilter.iterate();
25
26
  * for (const filter of filters) {
26
- * console.log(`Found filter: ${filter.name}`);
27
+ * console.log(`- ${filter.name}`);
27
28
  * }
28
29
  * ```
30
+ *
31
+ * @see [AVBitStreamFilter](https://ffmpeg.org/doxygen/trunk/structAVBitStreamFilter.html) - FFmpeg Doxygen
29
32
  */
30
33
  export declare class BitStreamFilter implements NativeWrapper<NativeBitStreamFilter> {
31
34
  private native;
32
35
  /**
33
- * Create a BitStreamFilter wrapper.
34
- *
35
- * Usually not called directly - use static methods instead.
36
- * No FFmpeg resources are allocated.
37
- *
38
- * @param native - Native BitStreamFilter object from bindings
36
+ * @param native The native bitstream filter instance
39
37
  * @internal
40
38
  */
41
39
  constructor(native: NativeBitStreamFilter);
42
40
  /**
43
- * Find a bitstream filter by name.
41
+ * Get a bitstream filter by name.
44
42
  *
45
- * Searches for a registered bitstream filter with the given name.
46
- * Returns null if no filter with that name exists.
43
+ * Retrieves a specific bitstream filter descriptor by its name.
44
+ * Common filter names include 'h264_mp4toannexb', 'hevc_mp4toannexb',
45
+ * 'extract_extradata', 'vp9_superframe', etc.
47
46
  *
48
- * Calls av_bsf_get_by_name() internally.
47
+ * Direct mapping to av_bsf_get_by_name().
49
48
  *
50
- * @param name - Name of the bitstream filter (e.g., 'h264_mp4toannexb')
51
- * @returns BitStreamFilter if found, null otherwise
49
+ * @param name - Name of the bitstream filter
50
+ * @returns BitStreamFilter instance if found, null otherwise
52
51
  *
53
52
  * @example
54
53
  * ```typescript
55
- * const filter = BitStreamFilter.getByName('h264_mp4toannexb');
56
- * if (filter) {
57
- * console.log(`Found filter: ${filter.name}`);
54
+ * // Get H.264 stream format converter
55
+ * const h264Filter = BitStreamFilter.getByName('h264_mp4toannexb');
56
+ * if (!h264Filter) {
57
+ * throw new Error('H.264 bitstream filter not available');
58
58
  * }
59
+ *
60
+ * // Get HEVC metadata extractor
61
+ * const hevcFilter = BitStreamFilter.getByName('hevc_metadata');
59
62
  * ```
63
+ *
64
+ * @see {@link iterate} To list all available filters
65
+ * @see {@link BitStreamFilterContext.alloc} To use the filter
60
66
  */
61
67
  static getByName(name: string): BitStreamFilter | null;
62
68
  /**
63
- * Get all available bitstream filters.
69
+ * Iterate over all available bitstream filters.
64
70
  *
65
- * Returns an array of all registered bitstream filters.
66
- * Useful for discovery and debugging.
71
+ * Returns an array of all registered bitstream filters in FFmpeg.
72
+ * Useful for discovering available filters or building filter lists.
67
73
  *
68
- * Calls av_bsf_iterate() internally.
74
+ * Direct mapping to av_bsf_iterate().
69
75
  *
70
76
  * @returns Array of all available bitstream filters
71
77
  *
72
78
  * @example
73
79
  * ```typescript
80
+ * import { BitStreamFilter } from 'node-av';
81
+ * import { AV_CODEC_ID_H264 } from 'node-av/constants';
82
+ *
83
+ * // List all available filters
74
84
  * const filters = BitStreamFilter.iterate();
75
- * for (const filter of filters) {
76
- * console.log(`${filter.name}: ${filter.codecIds?.join(', ') || 'all codecs'}`);
85
+ * console.log(`Found ${filters.length} bitstream filters`);
86
+ *
87
+ * // Find filters that support H.264
88
+ * const h264Filters = filters.filter(f =>
89
+ * f.codecIds?.includes(AV_CODEC_ID_H264)
90
+ * );
91
+ * console.log('H.264 compatible filters:');
92
+ * for (const filter of h264Filters) {
93
+ * console.log(`- ${filter.name}`);
77
94
  * }
78
95
  * ```
96
+ *
97
+ * @see {@link getByName} To get a specific filter
79
98
  */
80
99
  static iterate(): BitStreamFilter[];
81
100
  /**
82
- * Filter name.
101
+ * Name of the bitstream filter.
83
102
  *
84
- * Short name used to identify the filter.
85
- * This is the name used with getByName().
103
+ * Human-readable name identifying the filter (e.g., 'h264_mp4toannexb').
86
104
  *
87
- * Maps to AVBitStreamFilter->name.
88
- *
89
- * @example
90
- * ```typescript
91
- * const filter = BitStreamFilter.getByName('h264_mp4toannexb');
92
- * console.log(filter.name); // 'h264_mp4toannexb'
93
- * ```
105
+ * Direct mapping to AVBitStreamFilter->name.
94
106
  */
95
107
  get name(): string | null;
96
108
  /**
97
- * Supported codec IDs.
109
+ * List of supported codec IDs.
98
110
  *
99
- * List of codec IDs this filter can process.
100
- * If null, the filter works with any codec.
111
+ * Array of codec IDs that this filter can process.
112
+ * If null, the filter supports all codecs.
101
113
  *
102
- * Maps to AVBitStreamFilter->codec_ids.
114
+ * Direct mapping to AVBitStreamFilter->codec_ids.
103
115
  *
104
116
  * @example
105
117
  * ```typescript
106
- * import { AV_CODEC_ID_H264 } from 'node-av/constants';
107
- *
108
- * const filter = BitStreamFilter.getByName('h264_mp4toannexb');
109
- * if (filter.codecIds?.includes(AV_CODEC_ID_H264)) {
110
- * console.log('Filter supports H.264');
118
+ * import { AV_CODEC_ID_H264, AV_CODEC_ID_HEVC } from 'node-av/constants';
119
+ *
120
+ * const filter = BitStreamFilter.getByName('extract_extradata');
121
+ * if (filter?.codecIds) {
122
+ * const supportsH264 = filter.codecIds.includes(AV_CODEC_ID_H264);
123
+ * const supportsHEVC = filter.codecIds.includes(AV_CODEC_ID_HEVC);
124
+ * console.log(`H.264 support: ${supportsH264}`);
125
+ * console.log(`HEVC support: ${supportsHEVC}`);
111
126
  * }
112
127
  * ```
113
128
  */
114
129
  get codecIds(): AVCodecID[] | null;
115
130
  /**
116
- * Get the underlying native object.
131
+ * Get the underlying native BitStreamFilter object.
117
132
  *
118
- * For advanced use cases that need direct access to the native bindings.
133
+ * @returns The native BitStreamFilter binding object
119
134
  *
120
- * @returns Native BitStreamFilter object
121
135
  * @internal
122
136
  */
123
137
  getNative(): NativeBitStreamFilter;
@@ -1,10 +1,11 @@
1
1
  import { bindings } from './binding.js';
2
2
  /**
3
- * Bitstream filter definition.
3
+ * Bitstream filter descriptor.
4
4
  *
5
- * Represents a bitstream filter for manipulating encoded data without decoding.
6
- * Allows modification of codec-specific headers, packet metadata, and bitstream syntax.
7
- * This is an immutable descriptor - actual filtering happens via BitStreamFilterContext.
5
+ * Provides access to bitstream filter properties and codec compatibility information.
6
+ * Bitstream filters are used to modify or analyze compressed bitstreams without
7
+ * full decoding/encoding. Common uses include H.264/HEVC parameter set extraction,
8
+ * VP9 superframe splitting, and adding/removing codec-specific headers.
8
9
  *
9
10
  * Direct mapping to FFmpeg's AVBitStreamFilter.
10
11
  *
@@ -12,111 +13,125 @@ import { bindings } from './binding.js';
12
13
  * ```typescript
13
14
  * import { BitStreamFilter } from 'node-av';
14
15
  *
15
- * // Find a specific bitstream filter
16
- * const h264Mp4ToAnnexB = BitStreamFilter.getByName('h264_mp4toannexb');
17
- * if (!h264Mp4ToAnnexB) throw new Error('h264_mp4toannexb filter not found');
18
- *
19
- * console.log(`Filter: ${h264Mp4ToAnnexB.name}`);
20
- * console.log(`Supported codecs: ${h264Mp4ToAnnexB.codecIds}`);
16
+ * // Get a specific bitstream filter
17
+ * const h264Filter = BitStreamFilter.getByName('h264_mp4toannexb');
18
+ * if (h264Filter) {
19
+ * console.log(`Filter: ${h264Filter.name}`);
20
+ * console.log(`Supported codecs: ${h264Filter.codecIds}`);
21
+ * }
21
22
  *
22
23
  * // List all available bitstream filters
23
24
  * const filters = BitStreamFilter.iterate();
24
25
  * for (const filter of filters) {
25
- * console.log(`Found filter: ${filter.name}`);
26
+ * console.log(`- ${filter.name}`);
26
27
  * }
27
28
  * ```
29
+ *
30
+ * @see [AVBitStreamFilter](https://ffmpeg.org/doxygen/trunk/structAVBitStreamFilter.html) - FFmpeg Doxygen
28
31
  */
29
32
  export class BitStreamFilter {
30
33
  native;
31
34
  /**
32
- * Create a BitStreamFilter wrapper.
33
- *
34
- * Usually not called directly - use static methods instead.
35
- * No FFmpeg resources are allocated.
36
- *
37
- * @param native - Native BitStreamFilter object from bindings
35
+ * @param native The native bitstream filter instance
38
36
  * @internal
39
37
  */
40
38
  constructor(native) {
41
39
  this.native = native;
42
40
  }
43
41
  /**
44
- * Find a bitstream filter by name.
42
+ * Get a bitstream filter by name.
45
43
  *
46
- * Searches for a registered bitstream filter with the given name.
47
- * Returns null if no filter with that name exists.
44
+ * Retrieves a specific bitstream filter descriptor by its name.
45
+ * Common filter names include 'h264_mp4toannexb', 'hevc_mp4toannexb',
46
+ * 'extract_extradata', 'vp9_superframe', etc.
48
47
  *
49
- * Calls av_bsf_get_by_name() internally.
48
+ * Direct mapping to av_bsf_get_by_name().
50
49
  *
51
- * @param name - Name of the bitstream filter (e.g., 'h264_mp4toannexb')
52
- * @returns BitStreamFilter if found, null otherwise
50
+ * @param name - Name of the bitstream filter
51
+ * @returns BitStreamFilter instance if found, null otherwise
53
52
  *
54
53
  * @example
55
54
  * ```typescript
56
- * const filter = BitStreamFilter.getByName('h264_mp4toannexb');
57
- * if (filter) {
58
- * console.log(`Found filter: ${filter.name}`);
55
+ * // Get H.264 stream format converter
56
+ * const h264Filter = BitStreamFilter.getByName('h264_mp4toannexb');
57
+ * if (!h264Filter) {
58
+ * throw new Error('H.264 bitstream filter not available');
59
59
  * }
60
+ *
61
+ * // Get HEVC metadata extractor
62
+ * const hevcFilter = BitStreamFilter.getByName('hevc_metadata');
60
63
  * ```
64
+ *
65
+ * @see {@link iterate} To list all available filters
66
+ * @see {@link BitStreamFilterContext.alloc} To use the filter
61
67
  */
62
68
  static getByName(name) {
63
69
  const native = bindings.BitStreamFilter.getByName(name);
64
70
  return native ? new BitStreamFilter(native) : null;
65
71
  }
66
72
  /**
67
- * Get all available bitstream filters.
73
+ * Iterate over all available bitstream filters.
68
74
  *
69
- * Returns an array of all registered bitstream filters.
70
- * Useful for discovery and debugging.
75
+ * Returns an array of all registered bitstream filters in FFmpeg.
76
+ * Useful for discovering available filters or building filter lists.
71
77
  *
72
- * Calls av_bsf_iterate() internally.
78
+ * Direct mapping to av_bsf_iterate().
73
79
  *
74
80
  * @returns Array of all available bitstream filters
75
81
  *
76
82
  * @example
77
83
  * ```typescript
84
+ * import { BitStreamFilter } from 'node-av';
85
+ * import { AV_CODEC_ID_H264 } from 'node-av/constants';
86
+ *
87
+ * // List all available filters
78
88
  * const filters = BitStreamFilter.iterate();
79
- * for (const filter of filters) {
80
- * console.log(`${filter.name}: ${filter.codecIds?.join(', ') || 'all codecs'}`);
89
+ * console.log(`Found ${filters.length} bitstream filters`);
90
+ *
91
+ * // Find filters that support H.264
92
+ * const h264Filters = filters.filter(f =>
93
+ * f.codecIds?.includes(AV_CODEC_ID_H264)
94
+ * );
95
+ * console.log('H.264 compatible filters:');
96
+ * for (const filter of h264Filters) {
97
+ * console.log(`- ${filter.name}`);
81
98
  * }
82
99
  * ```
100
+ *
101
+ * @see {@link getByName} To get a specific filter
83
102
  */
84
103
  static iterate() {
85
104
  const natives = bindings.BitStreamFilter.iterate();
86
105
  return natives.map((native) => new BitStreamFilter(native));
87
106
  }
88
107
  /**
89
- * Filter name.
108
+ * Name of the bitstream filter.
90
109
  *
91
- * Short name used to identify the filter.
92
- * This is the name used with getByName().
110
+ * Human-readable name identifying the filter (e.g., 'h264_mp4toannexb').
93
111
  *
94
- * Maps to AVBitStreamFilter->name.
95
- *
96
- * @example
97
- * ```typescript
98
- * const filter = BitStreamFilter.getByName('h264_mp4toannexb');
99
- * console.log(filter.name); // 'h264_mp4toannexb'
100
- * ```
112
+ * Direct mapping to AVBitStreamFilter->name.
101
113
  */
102
114
  get name() {
103
115
  return this.native.name;
104
116
  }
105
117
  /**
106
- * Supported codec IDs.
118
+ * List of supported codec IDs.
107
119
  *
108
- * List of codec IDs this filter can process.
109
- * If null, the filter works with any codec.
120
+ * Array of codec IDs that this filter can process.
121
+ * If null, the filter supports all codecs.
110
122
  *
111
- * Maps to AVBitStreamFilter->codec_ids.
123
+ * Direct mapping to AVBitStreamFilter->codec_ids.
112
124
  *
113
125
  * @example
114
126
  * ```typescript
115
- * import { AV_CODEC_ID_H264 } from 'node-av/constants';
116
- *
117
- * const filter = BitStreamFilter.getByName('h264_mp4toannexb');
118
- * if (filter.codecIds?.includes(AV_CODEC_ID_H264)) {
119
- * console.log('Filter supports H.264');
127
+ * import { AV_CODEC_ID_H264, AV_CODEC_ID_HEVC } from 'node-av/constants';
128
+ *
129
+ * const filter = BitStreamFilter.getByName('extract_extradata');
130
+ * if (filter?.codecIds) {
131
+ * const supportsH264 = filter.codecIds.includes(AV_CODEC_ID_H264);
132
+ * const supportsHEVC = filter.codecIds.includes(AV_CODEC_ID_HEVC);
133
+ * console.log(`H.264 support: ${supportsH264}`);
134
+ * console.log(`HEVC support: ${supportsHEVC}`);
120
135
  * }
121
136
  * ```
122
137
  */
@@ -124,11 +139,10 @@ export class BitStreamFilter {
124
139
  return this.native.codecIds;
125
140
  }
126
141
  /**
127
- * Get the underlying native object.
142
+ * Get the underlying native BitStreamFilter object.
128
143
  *
129
- * For advanced use cases that need direct access to the native bindings.
144
+ * @returns The native BitStreamFilter binding object
130
145
  *
131
- * @returns Native BitStreamFilter object
132
146
  * @internal
133
147
  */
134
148
  getNative() {
@@ -1 +1 @@
1
- {"version":3,"file":"bitstream-filter.js","sourceRoot":"","sources":["../../src/lib/bitstream-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAKxC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,OAAO,eAAe;IAClB,MAAM,CAAwB;IAEtC;;;;;;;;OAQG;IACH,YAAY,MAA6B;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,SAAS,CAAC,IAAY;QAC3B,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACxD,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACrD,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,OAAO;QACZ,MAAM,OAAO,GAAG,QAAQ,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;QACnD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAA6B,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,QAA8B,CAAC;IACpD,CAAC;IAED;;;;;;;OAOG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
1
+ {"version":3,"file":"bitstream-filter.js","sourceRoot":"","sources":["../../src/lib/bitstream-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAKxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,OAAO,eAAe;IAClB,MAAM,CAAwB;IAEtC;;;OAGG;IACH,YAAY,MAA6B;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,CAAC,SAAS,CAAC,IAAY;QAC3B,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACxD,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACrD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,MAAM,CAAC,OAAO;QACZ,MAAM,OAAO,GAAG,QAAQ,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;QACnD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAA6B,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;OAMG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,QAA8B,CAAC;IACpD,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}