@revizly/node-av 5.2.2-beta.1
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/BUILD_LINUX.md +61 -0
- package/LICENSE.md +22 -0
- package/README.md +662 -0
- package/build_mac_local.sh +69 -0
- package/dist/api/audio-frame-buffer.d.ts +205 -0
- package/dist/api/audio-frame-buffer.js +287 -0
- package/dist/api/audio-frame-buffer.js.map +1 -0
- package/dist/api/bitstream-filter.d.ts +820 -0
- package/dist/api/bitstream-filter.js +1242 -0
- package/dist/api/bitstream-filter.js.map +1 -0
- package/dist/api/constants.d.ts +44 -0
- package/dist/api/constants.js +45 -0
- package/dist/api/constants.js.map +1 -0
- package/dist/api/data/test_av1.ivf +0 -0
- package/dist/api/data/test_h264.h264 +0 -0
- package/dist/api/data/test_hevc.h265 +0 -0
- package/dist/api/data/test_mjpeg.mjpeg +0 -0
- package/dist/api/data/test_vp8.ivf +0 -0
- package/dist/api/data/test_vp9.ivf +0 -0
- package/dist/api/decoder.d.ts +1088 -0
- package/dist/api/decoder.js +1775 -0
- package/dist/api/decoder.js.map +1 -0
- package/dist/api/demuxer.d.ts +1219 -0
- package/dist/api/demuxer.js +2081 -0
- package/dist/api/demuxer.js.map +1 -0
- package/dist/api/device.d.ts +586 -0
- package/dist/api/device.js +961 -0
- package/dist/api/device.js.map +1 -0
- package/dist/api/encoder.d.ts +1132 -0
- package/dist/api/encoder.js +1988 -0
- package/dist/api/encoder.js.map +1 -0
- package/dist/api/filter-complex.d.ts +821 -0
- package/dist/api/filter-complex.js +1604 -0
- package/dist/api/filter-complex.js.map +1 -0
- package/dist/api/filter-presets.d.ts +1286 -0
- package/dist/api/filter-presets.js +2152 -0
- package/dist/api/filter-presets.js.map +1 -0
- package/dist/api/filter.d.ts +1234 -0
- package/dist/api/filter.js +1976 -0
- package/dist/api/filter.js.map +1 -0
- package/dist/api/fmp4-stream.d.ts +426 -0
- package/dist/api/fmp4-stream.js +739 -0
- package/dist/api/fmp4-stream.js.map +1 -0
- package/dist/api/hardware.d.ts +651 -0
- package/dist/api/hardware.js +1260 -0
- package/dist/api/hardware.js.map +1 -0
- package/dist/api/index.d.ts +17 -0
- package/dist/api/index.js +32 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/io-stream.d.ts +307 -0
- package/dist/api/io-stream.js +282 -0
- package/dist/api/io-stream.js.map +1 -0
- package/dist/api/muxer.d.ts +957 -0
- package/dist/api/muxer.js +2002 -0
- package/dist/api/muxer.js.map +1 -0
- package/dist/api/pipeline.d.ts +607 -0
- package/dist/api/pipeline.js +1145 -0
- package/dist/api/pipeline.js.map +1 -0
- package/dist/api/utilities/async-queue.d.ts +120 -0
- package/dist/api/utilities/async-queue.js +211 -0
- package/dist/api/utilities/async-queue.js.map +1 -0
- package/dist/api/utilities/audio-sample.d.ts +117 -0
- package/dist/api/utilities/audio-sample.js +112 -0
- package/dist/api/utilities/audio-sample.js.map +1 -0
- package/dist/api/utilities/channel-layout.d.ts +76 -0
- package/dist/api/utilities/channel-layout.js +80 -0
- package/dist/api/utilities/channel-layout.js.map +1 -0
- package/dist/api/utilities/electron-shared-texture.d.ts +328 -0
- package/dist/api/utilities/electron-shared-texture.js +503 -0
- package/dist/api/utilities/electron-shared-texture.js.map +1 -0
- package/dist/api/utilities/image.d.ts +207 -0
- package/dist/api/utilities/image.js +213 -0
- package/dist/api/utilities/image.js.map +1 -0
- package/dist/api/utilities/index.d.ts +12 -0
- package/dist/api/utilities/index.js +25 -0
- package/dist/api/utilities/index.js.map +1 -0
- package/dist/api/utilities/media-type.d.ts +49 -0
- package/dist/api/utilities/media-type.js +53 -0
- package/dist/api/utilities/media-type.js.map +1 -0
- package/dist/api/utilities/pixel-format.d.ts +89 -0
- package/dist/api/utilities/pixel-format.js +97 -0
- package/dist/api/utilities/pixel-format.js.map +1 -0
- package/dist/api/utilities/sample-format.d.ts +129 -0
- package/dist/api/utilities/sample-format.js +141 -0
- package/dist/api/utilities/sample-format.js.map +1 -0
- package/dist/api/utilities/scheduler.d.ts +138 -0
- package/dist/api/utilities/scheduler.js +98 -0
- package/dist/api/utilities/scheduler.js.map +1 -0
- package/dist/api/utilities/streaming.d.ts +186 -0
- package/dist/api/utilities/streaming.js +309 -0
- package/dist/api/utilities/streaming.js.map +1 -0
- package/dist/api/utilities/timestamp.d.ts +193 -0
- package/dist/api/utilities/timestamp.js +206 -0
- package/dist/api/utilities/timestamp.js.map +1 -0
- package/dist/api/utilities/whisper-model.d.ts +310 -0
- package/dist/api/utilities/whisper-model.js +528 -0
- package/dist/api/utilities/whisper-model.js.map +1 -0
- package/dist/api/utils.d.ts +19 -0
- package/dist/api/utils.js +39 -0
- package/dist/api/utils.js.map +1 -0
- package/dist/api/whisper.d.ts +324 -0
- package/dist/api/whisper.js +362 -0
- package/dist/api/whisper.js.map +1 -0
- package/dist/constants/channel-layouts.d.ts +53 -0
- package/dist/constants/channel-layouts.js +57 -0
- package/dist/constants/channel-layouts.js.map +1 -0
- package/dist/constants/constants.d.ts +2325 -0
- package/dist/constants/constants.js +1887 -0
- package/dist/constants/constants.js.map +1 -0
- package/dist/constants/decoders.d.ts +633 -0
- package/dist/constants/decoders.js +641 -0
- package/dist/constants/decoders.js.map +1 -0
- package/dist/constants/encoders.d.ts +295 -0
- package/dist/constants/encoders.js +308 -0
- package/dist/constants/encoders.js.map +1 -0
- package/dist/constants/hardware.d.ts +26 -0
- package/dist/constants/hardware.js +27 -0
- package/dist/constants/hardware.js.map +1 -0
- package/dist/constants/index.d.ts +5 -0
- package/dist/constants/index.js +6 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/ffmpeg/index.d.ts +99 -0
- package/dist/ffmpeg/index.js +115 -0
- package/dist/ffmpeg/index.js.map +1 -0
- package/dist/ffmpeg/utils.d.ts +31 -0
- package/dist/ffmpeg/utils.js +68 -0
- package/dist/ffmpeg/utils.js.map +1 -0
- package/dist/ffmpeg/version.d.ts +6 -0
- package/dist/ffmpeg/version.js +7 -0
- package/dist/ffmpeg/version.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/audio-fifo.d.ts +399 -0
- package/dist/lib/audio-fifo.js +431 -0
- package/dist/lib/audio-fifo.js.map +1 -0
- package/dist/lib/binding.d.ts +228 -0
- package/dist/lib/binding.js +60 -0
- package/dist/lib/binding.js.map +1 -0
- package/dist/lib/bitstream-filter-context.d.ts +379 -0
- package/dist/lib/bitstream-filter-context.js +441 -0
- package/dist/lib/bitstream-filter-context.js.map +1 -0
- package/dist/lib/bitstream-filter.d.ts +140 -0
- package/dist/lib/bitstream-filter.js +154 -0
- package/dist/lib/bitstream-filter.js.map +1 -0
- package/dist/lib/codec-context.d.ts +1071 -0
- package/dist/lib/codec-context.js +1354 -0
- package/dist/lib/codec-context.js.map +1 -0
- package/dist/lib/codec-parameters.d.ts +616 -0
- package/dist/lib/codec-parameters.js +761 -0
- package/dist/lib/codec-parameters.js.map +1 -0
- package/dist/lib/codec-parser.d.ts +201 -0
- package/dist/lib/codec-parser.js +213 -0
- package/dist/lib/codec-parser.js.map +1 -0
- package/dist/lib/codec.d.ts +586 -0
- package/dist/lib/codec.js +713 -0
- package/dist/lib/codec.js.map +1 -0
- package/dist/lib/device.d.ts +291 -0
- package/dist/lib/device.js +324 -0
- package/dist/lib/device.js.map +1 -0
- package/dist/lib/dictionary.d.ts +333 -0
- package/dist/lib/dictionary.js +372 -0
- package/dist/lib/dictionary.js.map +1 -0
- package/dist/lib/error.d.ts +242 -0
- package/dist/lib/error.js +303 -0
- package/dist/lib/error.js.map +1 -0
- package/dist/lib/fifo.d.ts +416 -0
- package/dist/lib/fifo.js +453 -0
- package/dist/lib/fifo.js.map +1 -0
- package/dist/lib/filter-context.d.ts +712 -0
- package/dist/lib/filter-context.js +789 -0
- package/dist/lib/filter-context.js.map +1 -0
- package/dist/lib/filter-graph-segment.d.ts +160 -0
- package/dist/lib/filter-graph-segment.js +171 -0
- package/dist/lib/filter-graph-segment.js.map +1 -0
- package/dist/lib/filter-graph.d.ts +641 -0
- package/dist/lib/filter-graph.js +704 -0
- package/dist/lib/filter-graph.js.map +1 -0
- package/dist/lib/filter-inout.d.ts +198 -0
- package/dist/lib/filter-inout.js +257 -0
- package/dist/lib/filter-inout.js.map +1 -0
- package/dist/lib/filter.d.ts +243 -0
- package/dist/lib/filter.js +272 -0
- package/dist/lib/filter.js.map +1 -0
- package/dist/lib/format-context.d.ts +1254 -0
- package/dist/lib/format-context.js +1379 -0
- package/dist/lib/format-context.js.map +1 -0
- package/dist/lib/frame-utils.d.ts +116 -0
- package/dist/lib/frame-utils.js +98 -0
- package/dist/lib/frame-utils.js.map +1 -0
- package/dist/lib/frame.d.ts +1222 -0
- package/dist/lib/frame.js +1435 -0
- package/dist/lib/frame.js.map +1 -0
- package/dist/lib/hardware-device-context.d.ts +362 -0
- package/dist/lib/hardware-device-context.js +383 -0
- package/dist/lib/hardware-device-context.js.map +1 -0
- package/dist/lib/hardware-frames-context.d.ts +419 -0
- package/dist/lib/hardware-frames-context.js +477 -0
- package/dist/lib/hardware-frames-context.js.map +1 -0
- package/dist/lib/index.d.ts +35 -0
- package/dist/lib/index.js +60 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/input-format.d.ts +249 -0
- package/dist/lib/input-format.js +306 -0
- package/dist/lib/input-format.js.map +1 -0
- package/dist/lib/io-context.d.ts +696 -0
- package/dist/lib/io-context.js +769 -0
- package/dist/lib/io-context.js.map +1 -0
- package/dist/lib/log.d.ts +174 -0
- package/dist/lib/log.js +184 -0
- package/dist/lib/log.js.map +1 -0
- package/dist/lib/native-types.d.ts +946 -0
- package/dist/lib/native-types.js +2 -0
- package/dist/lib/native-types.js.map +1 -0
- package/dist/lib/option.d.ts +927 -0
- package/dist/lib/option.js +1583 -0
- package/dist/lib/option.js.map +1 -0
- package/dist/lib/output-format.d.ts +180 -0
- package/dist/lib/output-format.js +213 -0
- package/dist/lib/output-format.js.map +1 -0
- package/dist/lib/packet.d.ts +501 -0
- package/dist/lib/packet.js +590 -0
- package/dist/lib/packet.js.map +1 -0
- package/dist/lib/rational.d.ts +251 -0
- package/dist/lib/rational.js +278 -0
- package/dist/lib/rational.js.map +1 -0
- package/dist/lib/software-resample-context.d.ts +552 -0
- package/dist/lib/software-resample-context.js +592 -0
- package/dist/lib/software-resample-context.js.map +1 -0
- package/dist/lib/software-scale-context.d.ts +344 -0
- package/dist/lib/software-scale-context.js +366 -0
- package/dist/lib/software-scale-context.js.map +1 -0
- package/dist/lib/stream.d.ts +379 -0
- package/dist/lib/stream.js +526 -0
- package/dist/lib/stream.js.map +1 -0
- package/dist/lib/sync-queue.d.ts +179 -0
- package/dist/lib/sync-queue.js +197 -0
- package/dist/lib/sync-queue.js.map +1 -0
- package/dist/lib/types.d.ts +34 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utilities.d.ts +1127 -0
- package/dist/lib/utilities.js +1225 -0
- package/dist/lib/utilities.js.map +1 -0
- package/dist/utils/electron.d.ts +49 -0
- package/dist/utils/electron.js +63 -0
- package/dist/utils/electron.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -0
- package/install/check.js +121 -0
- package/install/ffmpeg.js +66 -0
- package/jellyfin-ffmpeg.patch +181 -0
- package/package.json +129 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import { CodecParameters } from './codec-parameters.js';
|
|
2
|
+
import { CodecParser } from './codec-parser.js';
|
|
3
|
+
import { Dictionary } from './dictionary.js';
|
|
4
|
+
import { Rational } from './rational.js';
|
|
5
|
+
import type { AVDiscard, AVDisposition, AVStreamEventFlag } from '../constants/constants.js';
|
|
6
|
+
import type { NativeStream, NativeWrapper } from './native-types.js';
|
|
7
|
+
import type { Packet } from './packet.js';
|
|
8
|
+
/**
|
|
9
|
+
* Media stream within a format context.
|
|
10
|
+
*
|
|
11
|
+
* Represents a single stream (video, audio, subtitle, etc.) within a media container.
|
|
12
|
+
* Contains stream-specific information including codec parameters, timing information,
|
|
13
|
+
* metadata, and disposition flags. Each stream in a file has a unique index and may
|
|
14
|
+
* contain packets of compressed data.
|
|
15
|
+
*
|
|
16
|
+
* Direct mapping to FFmpeg's AVStream.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import { FormatContext, FFmpegError } from 'node-av';
|
|
21
|
+
* import { AVMEDIA_TYPE_VIDEO, AVMEDIA_TYPE_AUDIO } from 'node-av/constants';
|
|
22
|
+
*
|
|
23
|
+
* // Access streams from format context
|
|
24
|
+
* const formatContext = new FormatContext();
|
|
25
|
+
* await formatContext.openInput('video.mp4');
|
|
26
|
+
*
|
|
27
|
+
* // Iterate through streams
|
|
28
|
+
* for (let i = 0; i < formatContext.nbStreams; i++) {
|
|
29
|
+
* const stream = formatContext.streams[i];
|
|
30
|
+
* const codecpar = stream.codecpar;
|
|
31
|
+
*
|
|
32
|
+
* if (codecpar.codecType === AVMEDIA_TYPE_VIDEO) {
|
|
33
|
+
* console.log(`Video stream ${stream.index}:`);
|
|
34
|
+
* console.log(` Codec: ${codecpar.codecId}`);
|
|
35
|
+
* console.log(` Resolution: ${codecpar.width}x${codecpar.height}`);
|
|
36
|
+
* console.log(` Frame rate: ${stream.avgFrameRate.num}/${stream.avgFrameRate.den}`);
|
|
37
|
+
* } else if (codecpar.codecType === AVMEDIA_TYPE_AUDIO) {
|
|
38
|
+
* console.log(`Audio stream ${stream.index}:`);
|
|
39
|
+
* console.log(` Sample rate: ${codecpar.sampleRate} Hz`);
|
|
40
|
+
* console.log(` Channels: ${codecpar.channels}`);
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @see [AVStream](https://ffmpeg.org/doxygen/trunk/structAVStream.html) - FFmpeg Doxygen
|
|
46
|
+
* @see {@link FormatContext} For container operations
|
|
47
|
+
* @see {@link CodecParameters} For codec configuration
|
|
48
|
+
*/
|
|
49
|
+
export declare class Stream implements NativeWrapper<NativeStream> {
|
|
50
|
+
private native;
|
|
51
|
+
private _metadata?;
|
|
52
|
+
private _codecpar?;
|
|
53
|
+
private _parser?;
|
|
54
|
+
/**
|
|
55
|
+
* @param native - The native stream instance
|
|
56
|
+
*
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
constructor(native: NativeStream);
|
|
60
|
+
/**
|
|
61
|
+
* Stream index.
|
|
62
|
+
*
|
|
63
|
+
* Zero-based index of this stream in the format context.
|
|
64
|
+
* Used to identify packets belonging to this stream.
|
|
65
|
+
*
|
|
66
|
+
* Direct mapping to AVStream->index.
|
|
67
|
+
*/
|
|
68
|
+
get index(): number;
|
|
69
|
+
/**
|
|
70
|
+
* Stream ID.
|
|
71
|
+
*
|
|
72
|
+
* Format-specific stream identifier.
|
|
73
|
+
* May be used by some formats for internal stream identification.
|
|
74
|
+
*
|
|
75
|
+
* Direct mapping to AVStream->id.
|
|
76
|
+
*/
|
|
77
|
+
get id(): number;
|
|
78
|
+
set id(value: number);
|
|
79
|
+
/**
|
|
80
|
+
* Codec parameters.
|
|
81
|
+
*
|
|
82
|
+
* Contains essential codec configuration for this stream.
|
|
83
|
+
* Used to initialize decoders and describe stream properties.
|
|
84
|
+
*
|
|
85
|
+
* Direct mapping to AVStream->codecpar.
|
|
86
|
+
*/
|
|
87
|
+
get codecpar(): CodecParameters;
|
|
88
|
+
set codecpar(value: CodecParameters);
|
|
89
|
+
/**
|
|
90
|
+
* Stream time base.
|
|
91
|
+
*
|
|
92
|
+
* Unit of time for timestamps in this stream.
|
|
93
|
+
* All timestamps (PTS/DTS) are in units of this time base.
|
|
94
|
+
*
|
|
95
|
+
* Direct mapping to AVStream->time_base.
|
|
96
|
+
*/
|
|
97
|
+
get timeBase(): Rational;
|
|
98
|
+
set timeBase(value: Rational);
|
|
99
|
+
/**
|
|
100
|
+
* Start time.
|
|
101
|
+
*
|
|
102
|
+
* First timestamp of the stream in stream time base units.
|
|
103
|
+
* AV_NOPTS_VALUE if unknown.
|
|
104
|
+
*
|
|
105
|
+
* Direct mapping to AVStream->start_time.
|
|
106
|
+
*/
|
|
107
|
+
get startTime(): bigint;
|
|
108
|
+
set startTime(value: bigint);
|
|
109
|
+
/**
|
|
110
|
+
* Stream duration.
|
|
111
|
+
*
|
|
112
|
+
* Total duration in stream time base units.
|
|
113
|
+
* AV_NOPTS_VALUE if unknown.
|
|
114
|
+
*
|
|
115
|
+
* Direct mapping to AVStream->duration.
|
|
116
|
+
*/
|
|
117
|
+
get duration(): bigint;
|
|
118
|
+
set duration(value: bigint);
|
|
119
|
+
/**
|
|
120
|
+
* Number of frames.
|
|
121
|
+
*
|
|
122
|
+
* Total number of frames in this stream.
|
|
123
|
+
* 0 if unknown.
|
|
124
|
+
*
|
|
125
|
+
* Direct mapping to AVStream->nb_frames.
|
|
126
|
+
*/
|
|
127
|
+
get nbFrames(): bigint;
|
|
128
|
+
set nbFrames(value: bigint);
|
|
129
|
+
/**
|
|
130
|
+
* Stream disposition flags.
|
|
131
|
+
*
|
|
132
|
+
* Combination of AV_DISPOSITION_* flags indicating stream properties
|
|
133
|
+
* (e.g., default, forced subtitles, visual impaired, etc.).
|
|
134
|
+
*
|
|
135
|
+
* Direct mapping to AVStream->disposition.
|
|
136
|
+
*/
|
|
137
|
+
get disposition(): AVDisposition;
|
|
138
|
+
set disposition(value: AVDisposition);
|
|
139
|
+
/**
|
|
140
|
+
* Discard setting.
|
|
141
|
+
*
|
|
142
|
+
* Indicates which packets can be discarded during demuxing.
|
|
143
|
+
* Used to skip non-essential packets for performance.
|
|
144
|
+
*
|
|
145
|
+
* Direct mapping to AVStream->discard.
|
|
146
|
+
*/
|
|
147
|
+
get discard(): AVDiscard;
|
|
148
|
+
set discard(value: AVDiscard);
|
|
149
|
+
/**
|
|
150
|
+
* Sample aspect ratio.
|
|
151
|
+
*
|
|
152
|
+
* Pixel aspect ratio for video streams.
|
|
153
|
+
* 0/1 if unknown or not applicable.
|
|
154
|
+
*
|
|
155
|
+
* Direct mapping to AVStream->sample_aspect_ratio.
|
|
156
|
+
*/
|
|
157
|
+
get sampleAspectRatio(): Rational;
|
|
158
|
+
set sampleAspectRatio(value: Rational);
|
|
159
|
+
/**
|
|
160
|
+
* Average frame rate.
|
|
161
|
+
*
|
|
162
|
+
* Average framerate of the stream.
|
|
163
|
+
* 0/1 if unknown or variable frame rate.
|
|
164
|
+
*
|
|
165
|
+
* Direct mapping to AVStream->avg_frame_rate.
|
|
166
|
+
*/
|
|
167
|
+
get avgFrameRate(): Rational;
|
|
168
|
+
set avgFrameRate(value: Rational);
|
|
169
|
+
/**
|
|
170
|
+
* Real frame rate.
|
|
171
|
+
*
|
|
172
|
+
* Real base frame rate of the stream.
|
|
173
|
+
* This is the lowest common multiple of all frame rates in the stream.
|
|
174
|
+
*
|
|
175
|
+
* Direct mapping to AVStream->r_frame_rate.
|
|
176
|
+
*/
|
|
177
|
+
get rFrameRate(): Rational;
|
|
178
|
+
set rFrameRate(value: Rational);
|
|
179
|
+
/**
|
|
180
|
+
* Number of bits for PTS wrap-around detection.
|
|
181
|
+
*
|
|
182
|
+
* Used for timestamp wrap-around correction in formats with limited timestamp bits.
|
|
183
|
+
* Common values: 33 (MPEG-TS), 31 (DVB), 64 (no wrapping).
|
|
184
|
+
*
|
|
185
|
+
* Direct mapping to AVStream->pts_wrap_bits.
|
|
186
|
+
*/
|
|
187
|
+
get ptsWrapBits(): number;
|
|
188
|
+
set ptsWrapBits(value: number);
|
|
189
|
+
/**
|
|
190
|
+
* Stream metadata.
|
|
191
|
+
*
|
|
192
|
+
* Dictionary containing stream-specific metadata
|
|
193
|
+
* (e.g., language, title, encoder settings).
|
|
194
|
+
*
|
|
195
|
+
* Direct mapping to AVStream->metadata.
|
|
196
|
+
*/
|
|
197
|
+
get metadata(): Dictionary | null;
|
|
198
|
+
set metadata(value: Dictionary | null);
|
|
199
|
+
/**
|
|
200
|
+
* Attached picture.
|
|
201
|
+
*
|
|
202
|
+
* For streams with AV_DISPOSITION_ATTACHED_PIC set,
|
|
203
|
+
* contains the attached picture (e.g., album art).
|
|
204
|
+
*
|
|
205
|
+
* Direct mapping to AVStream->attached_pic.
|
|
206
|
+
*/
|
|
207
|
+
get attachedPic(): Packet | null;
|
|
208
|
+
/**
|
|
209
|
+
* Event flags.
|
|
210
|
+
*
|
|
211
|
+
* Flags indicating events that happened to the stream.
|
|
212
|
+
* Used for signaling format changes.
|
|
213
|
+
*
|
|
214
|
+
* Direct mapping to AVStream->event_flags.
|
|
215
|
+
*/
|
|
216
|
+
get eventFlags(): AVStreamEventFlag;
|
|
217
|
+
set eventFlags(value: AVStreamEventFlag);
|
|
218
|
+
/**
|
|
219
|
+
* Get the codec parser attached to this stream.
|
|
220
|
+
*
|
|
221
|
+
* Returns the parser context if the stream has an active parser, null otherwise.
|
|
222
|
+
* Parsers are automatically created by FFmpeg for certain formats and codecs.
|
|
223
|
+
* Useful for accessing parser state like repeat_pict for interlaced video.
|
|
224
|
+
*
|
|
225
|
+
* Direct mapping to av_stream_get_parser().
|
|
226
|
+
*
|
|
227
|
+
* @returns Parser context or null if no parser attached
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```typescript
|
|
231
|
+
* const parser = stream.parser;
|
|
232
|
+
* if (parser) {
|
|
233
|
+
* const fields = 1 + parser.repeatPict;
|
|
234
|
+
* console.log(`Frame uses ${fields} fields`);
|
|
235
|
+
* }
|
|
236
|
+
* ```
|
|
237
|
+
*
|
|
238
|
+
* @see {@link CodecParser} For parser details
|
|
239
|
+
*/
|
|
240
|
+
get parser(): CodecParser | null;
|
|
241
|
+
/**
|
|
242
|
+
* Set stream event flags.
|
|
243
|
+
*
|
|
244
|
+
* Sets one or more event flags using bitwise OR. Allows setting multiple flags
|
|
245
|
+
* without manually performing bitwise operations.
|
|
246
|
+
*
|
|
247
|
+
* @param flags - One or more event flag values to set
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* ```typescript
|
|
251
|
+
* import { AVSTREAM_EVENT_FLAG_METADATA_UPDATED, AVSTREAM_EVENT_FLAG_NEW_PACKETS } from 'node-av/constants';
|
|
252
|
+
*
|
|
253
|
+
* // Set multiple event flags at once
|
|
254
|
+
* stream.setEventFlags(AVSTREAM_EVENT_FLAG_METADATA_UPDATED, AVSTREAM_EVENT_FLAG_NEW_PACKETS);
|
|
255
|
+
* ```
|
|
256
|
+
*
|
|
257
|
+
* @see {@link clearEventFlags} To unset event flags
|
|
258
|
+
* @see {@link hasEventFlags} To check event flags
|
|
259
|
+
* @see {@link eventFlags} For direct event flag access
|
|
260
|
+
*/
|
|
261
|
+
setEventFlags(...flags: AVStreamEventFlag[]): void;
|
|
262
|
+
/**
|
|
263
|
+
* Clear stream event flags.
|
|
264
|
+
*
|
|
265
|
+
* Clears one or more event flags using bitwise AND NOT. Allows clearing multiple
|
|
266
|
+
* flags without manually performing bitwise operations.
|
|
267
|
+
*
|
|
268
|
+
* @param flags - One or more event flag values to clear
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```typescript
|
|
272
|
+
* import { AVSTREAM_EVENT_FLAG_METADATA_UPDATED } from 'node-av/constants';
|
|
273
|
+
*
|
|
274
|
+
* // Clear specific event flag
|
|
275
|
+
* stream.clearEventFlags(AVSTREAM_EVENT_FLAG_METADATA_UPDATED);
|
|
276
|
+
* ```
|
|
277
|
+
*
|
|
278
|
+
* @see {@link setEventFlags} To set event flags
|
|
279
|
+
* @see {@link hasEventFlags} To check event flags
|
|
280
|
+
* @see {@link eventFlags} For direct event flag access
|
|
281
|
+
*/
|
|
282
|
+
clearEventFlags(...flags: AVStreamEventFlag[]): void;
|
|
283
|
+
/**
|
|
284
|
+
* Check if stream has specific event flags.
|
|
285
|
+
*
|
|
286
|
+
* Tests whether all specified event flags are set using bitwise AND.
|
|
287
|
+
*
|
|
288
|
+
* @param flags - One or more event flag values to check
|
|
289
|
+
*
|
|
290
|
+
* @returns true if all specified event flags are set, false otherwise
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* ```typescript
|
|
294
|
+
* import { AVSTREAM_EVENT_FLAG_METADATA_UPDATED } from 'node-av/constants';
|
|
295
|
+
*
|
|
296
|
+
* if (stream.hasEventFlags(AVSTREAM_EVENT_FLAG_METADATA_UPDATED)) {
|
|
297
|
+
* console.log('Stream metadata was updated');
|
|
298
|
+
* }
|
|
299
|
+
* ```
|
|
300
|
+
*
|
|
301
|
+
* @see {@link setEventFlags} To set event flags
|
|
302
|
+
* @see {@link clearEventFlags} To unset event flags
|
|
303
|
+
* @see {@link eventFlags} For direct event flag access
|
|
304
|
+
*/
|
|
305
|
+
hasEventFlags(...flags: AVStreamEventFlag[]): boolean;
|
|
306
|
+
/**
|
|
307
|
+
* Set stream disposition flags.
|
|
308
|
+
*
|
|
309
|
+
* Sets one or more disposition flags using bitwise OR. Allows setting multiple flags
|
|
310
|
+
* without manually performing bitwise operations.
|
|
311
|
+
*
|
|
312
|
+
* @param flags - One or more disposition flag values to set
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* ```typescript
|
|
316
|
+
* import { AV_DISPOSITION_DEFAULT, AV_DISPOSITION_FORCED } from 'node-av/constants';
|
|
317
|
+
*
|
|
318
|
+
* // Set multiple disposition flags at once
|
|
319
|
+
* stream.setDisposition(AV_DISPOSITION_DEFAULT, AV_DISPOSITION_FORCED);
|
|
320
|
+
* ```
|
|
321
|
+
*
|
|
322
|
+
* @see {@link clearDisposition} To unset disposition flags
|
|
323
|
+
* @see {@link hasDisposition} To check disposition flags
|
|
324
|
+
* @see {@link disposition} For direct disposition flag access
|
|
325
|
+
*/
|
|
326
|
+
setDisposition(...flags: AVDisposition[]): void;
|
|
327
|
+
/**
|
|
328
|
+
* Clear stream disposition flags.
|
|
329
|
+
*
|
|
330
|
+
* Clears one or more disposition flags using bitwise AND NOT. Allows clearing multiple
|
|
331
|
+
* flags without manually performing bitwise operations.
|
|
332
|
+
*
|
|
333
|
+
* @param flags - One or more disposition flag values to clear
|
|
334
|
+
*
|
|
335
|
+
* @example
|
|
336
|
+
* ```typescript
|
|
337
|
+
* import { AV_DISPOSITION_FORCED } from 'node-av/constants';
|
|
338
|
+
*
|
|
339
|
+
* // Clear specific disposition flag
|
|
340
|
+
* stream.clearDisposition(AV_DISPOSITION_FORCED);
|
|
341
|
+
* ```
|
|
342
|
+
*
|
|
343
|
+
* @see {@link setDisposition} To set disposition flags
|
|
344
|
+
* @see {@link hasDisposition} To check disposition flags
|
|
345
|
+
* @see {@link disposition} For direct disposition flag access
|
|
346
|
+
*/
|
|
347
|
+
clearDisposition(...flags: AVDisposition[]): void;
|
|
348
|
+
/**
|
|
349
|
+
* Check if stream has specific disposition flags.
|
|
350
|
+
*
|
|
351
|
+
* Tests whether all specified disposition flags are set using bitwise AND.
|
|
352
|
+
*
|
|
353
|
+
* @param flags - One or more disposition flag values to check
|
|
354
|
+
*
|
|
355
|
+
* @returns true if all specified disposition flags are set, false otherwise
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```typescript
|
|
359
|
+
* import { AV_DISPOSITION_DEFAULT } from 'node-av/constants';
|
|
360
|
+
*
|
|
361
|
+
* if (stream.hasDisposition(AV_DISPOSITION_DEFAULT)) {
|
|
362
|
+
* console.log('Stream is marked as default');
|
|
363
|
+
* }
|
|
364
|
+
* ```
|
|
365
|
+
*
|
|
366
|
+
* @see {@link setDisposition} To set disposition flags
|
|
367
|
+
* @see {@link clearDisposition} To unset disposition flags
|
|
368
|
+
* @see {@link disposition} For direct disposition flag access
|
|
369
|
+
*/
|
|
370
|
+
hasDisposition(...flags: AVDisposition[]): boolean;
|
|
371
|
+
/**
|
|
372
|
+
* Get the underlying native Stream object.
|
|
373
|
+
*
|
|
374
|
+
* @returns The native Stream binding object
|
|
375
|
+
*
|
|
376
|
+
* @internal
|
|
377
|
+
*/
|
|
378
|
+
getNative(): NativeStream;
|
|
379
|
+
}
|