@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 @@
|
|
|
1
|
+
{"version":3,"file":"io-context.js","sourceRoot":"","sources":["../../src/lib/io-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,MAAM,OAAO,SAAU,SAAQ,YAA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AC5B,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,SAAS;QACP,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IAC1B,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,KAAK,CAAC,IAAI,CAAC,MAAc;QACvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,MAAc;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC;QACd,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAChC,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QACzB,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;IAC3C,CAAC;CACF"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import type { AVLogLevel } from '../constants/constants.js';
|
|
2
|
+
/**
|
|
3
|
+
* Log callback options for performance tuning.
|
|
4
|
+
*/
|
|
5
|
+
export interface LogOptions {
|
|
6
|
+
maxLevel?: AVLogLevel;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* FFmpeg logging control and configuration.
|
|
10
|
+
*
|
|
11
|
+
* Provides control over FFmpeg's internal logging system.
|
|
12
|
+
* Allows setting log levels, custom callbacks, and formatting options.
|
|
13
|
+
* Essential for debugging, monitoring, and error tracking in FFmpeg operations.
|
|
14
|
+
*
|
|
15
|
+
* Direct mapping to FFmpeg's logging API.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { Log } from 'node-av';
|
|
20
|
+
* import { AV_LOG_ERROR, AV_LOG_WARNING, AV_LOG_INFO, AV_LOG_DEBUG } from 'node-av/constants';
|
|
21
|
+
*
|
|
22
|
+
* // Set log level
|
|
23
|
+
* Log.setLevel(AV_LOG_WARNING); // Only show warnings and errors
|
|
24
|
+
*
|
|
25
|
+
* // Get current log level
|
|
26
|
+
* const level = Log.getLevel();
|
|
27
|
+
* console.log(`Current log level: ${level}`);
|
|
28
|
+
*
|
|
29
|
+
* // Custom log callback
|
|
30
|
+
* Log.setCallback((level, message) => {
|
|
31
|
+
* if (level <= AV_LOG_ERROR) {
|
|
32
|
+
* console.error(`FFmpeg Error: ${message}`);
|
|
33
|
+
* } else if (level <= AV_LOG_WARNING) {
|
|
34
|
+
* console.warn(`FFmpeg Warning: ${message}`);
|
|
35
|
+
* } else {
|
|
36
|
+
* console.log(`FFmpeg: ${message}`);
|
|
37
|
+
* }
|
|
38
|
+
* }, {
|
|
39
|
+
* printPrefix: true,
|
|
40
|
+
* skipRepeated: true
|
|
41
|
+
* });
|
|
42
|
+
*
|
|
43
|
+
* // Log a custom message
|
|
44
|
+
* Log.log(AV_LOG_INFO, 'Custom log message');
|
|
45
|
+
*
|
|
46
|
+
* // Reset to default callback
|
|
47
|
+
* Log.resetCallback();
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @see [av_log](https://ffmpeg.org/doxygen/trunk/group__lavu__log.html) - FFmpeg Doxygen
|
|
51
|
+
*/
|
|
52
|
+
export declare class Log {
|
|
53
|
+
/**
|
|
54
|
+
* Set global log level.
|
|
55
|
+
*
|
|
56
|
+
* Sets the minimum log level for FFmpeg messages.
|
|
57
|
+
* Messages below this level will be suppressed.
|
|
58
|
+
*
|
|
59
|
+
* Direct mapping to av_log_set_level().
|
|
60
|
+
*
|
|
61
|
+
* @param level - Minimum log level to display
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* import { AV_LOG_QUIET, AV_LOG_ERROR, AV_LOG_WARNING, AV_LOG_INFO } from 'node-av/constants';
|
|
66
|
+
*
|
|
67
|
+
* Log.setLevel(AV_LOG_QUIET); // Disable all logging
|
|
68
|
+
* Log.setLevel(AV_LOG_ERROR); // Only errors
|
|
69
|
+
* Log.setLevel(AV_LOG_WARNING); // Errors and warnings
|
|
70
|
+
* Log.setLevel(AV_LOG_INFO); // Errors, warnings, and info
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
static setLevel(level: AVLogLevel): void;
|
|
74
|
+
/**
|
|
75
|
+
* Get current log level.
|
|
76
|
+
*
|
|
77
|
+
* Returns the current minimum log level setting.
|
|
78
|
+
*
|
|
79
|
+
* Direct mapping to av_log_get_level().
|
|
80
|
+
*
|
|
81
|
+
* @returns Current log level
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* const level = Log.getLevel();
|
|
86
|
+
* if (level <= AV_LOG_WARNING) {
|
|
87
|
+
* console.log('Logging warnings and above');
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* @see {@link setLevel} To change log level
|
|
92
|
+
*/
|
|
93
|
+
static getLevel(): AVLogLevel;
|
|
94
|
+
/**
|
|
95
|
+
* Log a message.
|
|
96
|
+
*
|
|
97
|
+
* Sends a log message through FFmpeg's logging system.
|
|
98
|
+
* The message will be processed according to current settings.
|
|
99
|
+
*
|
|
100
|
+
* Direct mapping to av_log().
|
|
101
|
+
*
|
|
102
|
+
* @param level - Log level for this message
|
|
103
|
+
*
|
|
104
|
+
* @param message - Message to log
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* import { AV_LOG_ERROR, AV_LOG_WARNING, AV_LOG_INFO } from 'node-av/constants';
|
|
109
|
+
*
|
|
110
|
+
* Log.log(AV_LOG_ERROR, 'Critical error occurred');
|
|
111
|
+
* Log.log(AV_LOG_WARNING, 'Non-fatal warning');
|
|
112
|
+
* Log.log(AV_LOG_INFO, 'Processing started');
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
static log(level: AVLogLevel, message: string): void;
|
|
116
|
+
/**
|
|
117
|
+
* Set custom log callback.
|
|
118
|
+
*
|
|
119
|
+
* Installs a custom callback to handle FFmpeg log messages.
|
|
120
|
+
* Allows redirecting logs to custom handlers or loggers.
|
|
121
|
+
*
|
|
122
|
+
* Direct mapping to av_log_set_callback().
|
|
123
|
+
*
|
|
124
|
+
* @param callback - Function to handle log messages, or null to remove
|
|
125
|
+
*
|
|
126
|
+
* @param options - Additional logging options
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* import { AV_LOG_ERROR, AV_LOG_WARNING } from 'node-av/constants';
|
|
131
|
+
*
|
|
132
|
+
* // Set custom callback with options
|
|
133
|
+
* Log.setCallback((level, message) => {
|
|
134
|
+
* const timestamp = new Date().toISOString();
|
|
135
|
+
*
|
|
136
|
+
* if (level <= AV_LOG_ERROR) {
|
|
137
|
+
* console.error(`[${timestamp}] ERROR: ${message}`);
|
|
138
|
+
* } else if (level <= AV_LOG_WARNING) {
|
|
139
|
+
* console.warn(`[${timestamp}] WARN: ${message}`);
|
|
140
|
+
* } else {
|
|
141
|
+
* console.log(`[${timestamp}] INFO: ${message}`);
|
|
142
|
+
* }
|
|
143
|
+
* }, {
|
|
144
|
+
* printPrefix: true, // Include context prefix
|
|
145
|
+
* skipRepeated: true, // Skip repeated messages
|
|
146
|
+
* level: AV_LOG_WARNING // Filter level
|
|
147
|
+
* });
|
|
148
|
+
*
|
|
149
|
+
* // Remove custom callback
|
|
150
|
+
* Log.setCallback(null);
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* @see {@link resetCallback} To restore default
|
|
154
|
+
*/
|
|
155
|
+
static setCallback(callback: ((level: AVLogLevel, message: string) => void) | null, options?: LogOptions): void;
|
|
156
|
+
/**
|
|
157
|
+
* Reset to default log callback.
|
|
158
|
+
*
|
|
159
|
+
* Restores the default FFmpeg logging behavior.
|
|
160
|
+
* Removes any custom callback previously set.
|
|
161
|
+
*
|
|
162
|
+
* Direct mapping to av_log_set_callback() with default handler.
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```typescript
|
|
166
|
+
* // After using custom callback
|
|
167
|
+
* Log.resetCallback();
|
|
168
|
+
* // Now using default FFmpeg logging
|
|
169
|
+
* ```
|
|
170
|
+
*
|
|
171
|
+
* @see {@link setCallback} To set custom callback
|
|
172
|
+
*/
|
|
173
|
+
static resetCallback(): void;
|
|
174
|
+
}
|
package/dist/lib/log.js
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { bindings } from './binding.js';
|
|
2
|
+
/**
|
|
3
|
+
* FFmpeg logging control and configuration.
|
|
4
|
+
*
|
|
5
|
+
* Provides control over FFmpeg's internal logging system.
|
|
6
|
+
* Allows setting log levels, custom callbacks, and formatting options.
|
|
7
|
+
* Essential for debugging, monitoring, and error tracking in FFmpeg operations.
|
|
8
|
+
*
|
|
9
|
+
* Direct mapping to FFmpeg's logging API.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { Log } from 'node-av';
|
|
14
|
+
* import { AV_LOG_ERROR, AV_LOG_WARNING, AV_LOG_INFO, AV_LOG_DEBUG } from 'node-av/constants';
|
|
15
|
+
*
|
|
16
|
+
* // Set log level
|
|
17
|
+
* Log.setLevel(AV_LOG_WARNING); // Only show warnings and errors
|
|
18
|
+
*
|
|
19
|
+
* // Get current log level
|
|
20
|
+
* const level = Log.getLevel();
|
|
21
|
+
* console.log(`Current log level: ${level}`);
|
|
22
|
+
*
|
|
23
|
+
* // Custom log callback
|
|
24
|
+
* Log.setCallback((level, message) => {
|
|
25
|
+
* if (level <= AV_LOG_ERROR) {
|
|
26
|
+
* console.error(`FFmpeg Error: ${message}`);
|
|
27
|
+
* } else if (level <= AV_LOG_WARNING) {
|
|
28
|
+
* console.warn(`FFmpeg Warning: ${message}`);
|
|
29
|
+
* } else {
|
|
30
|
+
* console.log(`FFmpeg: ${message}`);
|
|
31
|
+
* }
|
|
32
|
+
* }, {
|
|
33
|
+
* printPrefix: true,
|
|
34
|
+
* skipRepeated: true
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* // Log a custom message
|
|
38
|
+
* Log.log(AV_LOG_INFO, 'Custom log message');
|
|
39
|
+
*
|
|
40
|
+
* // Reset to default callback
|
|
41
|
+
* Log.resetCallback();
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @see [av_log](https://ffmpeg.org/doxygen/trunk/group__lavu__log.html) - FFmpeg Doxygen
|
|
45
|
+
*/
|
|
46
|
+
export class Log {
|
|
47
|
+
/**
|
|
48
|
+
* Set global log level.
|
|
49
|
+
*
|
|
50
|
+
* Sets the minimum log level for FFmpeg messages.
|
|
51
|
+
* Messages below this level will be suppressed.
|
|
52
|
+
*
|
|
53
|
+
* Direct mapping to av_log_set_level().
|
|
54
|
+
*
|
|
55
|
+
* @param level - Minimum log level to display
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* import { AV_LOG_QUIET, AV_LOG_ERROR, AV_LOG_WARNING, AV_LOG_INFO } from 'node-av/constants';
|
|
60
|
+
*
|
|
61
|
+
* Log.setLevel(AV_LOG_QUIET); // Disable all logging
|
|
62
|
+
* Log.setLevel(AV_LOG_ERROR); // Only errors
|
|
63
|
+
* Log.setLevel(AV_LOG_WARNING); // Errors and warnings
|
|
64
|
+
* Log.setLevel(AV_LOG_INFO); // Errors, warnings, and info
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
static setLevel(level) {
|
|
68
|
+
bindings.Log.setLevel(level);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get current log level.
|
|
72
|
+
*
|
|
73
|
+
* Returns the current minimum log level setting.
|
|
74
|
+
*
|
|
75
|
+
* Direct mapping to av_log_get_level().
|
|
76
|
+
*
|
|
77
|
+
* @returns Current log level
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const level = Log.getLevel();
|
|
82
|
+
* if (level <= AV_LOG_WARNING) {
|
|
83
|
+
* console.log('Logging warnings and above');
|
|
84
|
+
* }
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @see {@link setLevel} To change log level
|
|
88
|
+
*/
|
|
89
|
+
static getLevel() {
|
|
90
|
+
return bindings.Log.getLevel();
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Log a message.
|
|
94
|
+
*
|
|
95
|
+
* Sends a log message through FFmpeg's logging system.
|
|
96
|
+
* The message will be processed according to current settings.
|
|
97
|
+
*
|
|
98
|
+
* Direct mapping to av_log().
|
|
99
|
+
*
|
|
100
|
+
* @param level - Log level for this message
|
|
101
|
+
*
|
|
102
|
+
* @param message - Message to log
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* import { AV_LOG_ERROR, AV_LOG_WARNING, AV_LOG_INFO } from 'node-av/constants';
|
|
107
|
+
*
|
|
108
|
+
* Log.log(AV_LOG_ERROR, 'Critical error occurred');
|
|
109
|
+
* Log.log(AV_LOG_WARNING, 'Non-fatal warning');
|
|
110
|
+
* Log.log(AV_LOG_INFO, 'Processing started');
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
static log(level, message) {
|
|
114
|
+
bindings.Log.log(level, message);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Set custom log callback.
|
|
118
|
+
*
|
|
119
|
+
* Installs a custom callback to handle FFmpeg log messages.
|
|
120
|
+
* Allows redirecting logs to custom handlers or loggers.
|
|
121
|
+
*
|
|
122
|
+
* Direct mapping to av_log_set_callback().
|
|
123
|
+
*
|
|
124
|
+
* @param callback - Function to handle log messages, or null to remove
|
|
125
|
+
*
|
|
126
|
+
* @param options - Additional logging options
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* import { AV_LOG_ERROR, AV_LOG_WARNING } from 'node-av/constants';
|
|
131
|
+
*
|
|
132
|
+
* // Set custom callback with options
|
|
133
|
+
* Log.setCallback((level, message) => {
|
|
134
|
+
* const timestamp = new Date().toISOString();
|
|
135
|
+
*
|
|
136
|
+
* if (level <= AV_LOG_ERROR) {
|
|
137
|
+
* console.error(`[${timestamp}] ERROR: ${message}`);
|
|
138
|
+
* } else if (level <= AV_LOG_WARNING) {
|
|
139
|
+
* console.warn(`[${timestamp}] WARN: ${message}`);
|
|
140
|
+
* } else {
|
|
141
|
+
* console.log(`[${timestamp}] INFO: ${message}`);
|
|
142
|
+
* }
|
|
143
|
+
* }, {
|
|
144
|
+
* printPrefix: true, // Include context prefix
|
|
145
|
+
* skipRepeated: true, // Skip repeated messages
|
|
146
|
+
* level: AV_LOG_WARNING // Filter level
|
|
147
|
+
* });
|
|
148
|
+
*
|
|
149
|
+
* // Remove custom callback
|
|
150
|
+
* Log.setCallback(null);
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* @see {@link resetCallback} To restore default
|
|
154
|
+
*/
|
|
155
|
+
static setCallback(callback, options) {
|
|
156
|
+
if (callback === null) {
|
|
157
|
+
bindings.Log.setCallback(null);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
bindings.Log.setCallback(callback, options);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Reset to default log callback.
|
|
165
|
+
*
|
|
166
|
+
* Restores the default FFmpeg logging behavior.
|
|
167
|
+
* Removes any custom callback previously set.
|
|
168
|
+
*
|
|
169
|
+
* Direct mapping to av_log_set_callback() with default handler.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* // After using custom callback
|
|
174
|
+
* Log.resetCallback();
|
|
175
|
+
* // Now using default FFmpeg logging
|
|
176
|
+
* ```
|
|
177
|
+
*
|
|
178
|
+
* @see {@link setCallback} To set custom callback
|
|
179
|
+
*/
|
|
180
|
+
static resetCallback() {
|
|
181
|
+
bindings.Log.resetCallback();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/lib/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAWxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,OAAO,GAAG;IACd;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAiB;QAC/B,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,QAAQ;QACb,OAAO,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACjC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,GAAG,CAAC,KAAiB,EAAE,OAAe;QAC3C,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,MAAM,CAAC,WAAW,CAAC,QAA+D,EAAE,OAAoB;QACtG,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,aAAa;QAClB,QAAQ,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAC/B,CAAC;CACF"}
|