@camera.ui/common 0.0.37 → 0.0.39
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/dist/camera/codec-hardware.d.ts +162 -43
- package/dist/camera/codec-hardware.js +612 -348
- package/dist/camera/codec-hardware.js.map +1 -1
- package/dist/camera/ffmpeg-process.js +1 -1
- package/dist/camera/ffmpeg-process.js.map +1 -1
- package/dist/camera/ffmpeg.d.ts +19 -2
- package/dist/camera/ffmpeg.js +56 -29
- package/dist/camera/ffmpeg.js.map +1 -1
- package/dist/camera/utils.d.ts +16 -9
- package/dist/camera/utils.js +316 -90
- package/dist/camera/utils.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/logger/index.d.ts +5 -4
- package/dist/logger/index.js +45 -12
- package/dist/logger/index.js.map +1 -1
- package/dist/logger/test.d.ts +1 -0
- package/dist/logger/test.js +103 -0
- package/dist/logger/test.js.map +1 -0
- package/dist/net/index.js +4 -4
- package/dist/net/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/reactive.d.ts +11 -0
- package/dist/utils/reactive.js +32 -0
- package/dist/utils/reactive.js.map +1 -0
- package/dist/utils/utils.js +1 -0
- package/dist/utils/utils.js.map +1 -1
- package/package.json +16 -22
- package/dist/nats/index.d.ts +0 -3
- package/dist/nats/index.js +0 -4
- package/dist/nats/index.js.map +0 -1
- package/dist/nats/messageQueue.d.ts +0 -48
- package/dist/nats/messageQueue.js +0 -141
- package/dist/nats/messageQueue.js.map +0 -1
- package/dist/nats/nats.d.ts +0 -30
- package/dist/nats/nats.js +0 -85
- package/dist/nats/nats.js.map +0 -1
- package/dist/nats/packer.d.ts +0 -2
- package/dist/nats/packer.js +0 -17
- package/dist/nats/packer.js.map +0 -1
|
@@ -1,59 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a hardware-accelerated video codec
|
|
3
|
+
*/
|
|
1
4
|
export interface HWVideoCodec {
|
|
5
|
+
/** User-friendly name of the codec */
|
|
2
6
|
name: string;
|
|
7
|
+
/** FFmpeg codec name */
|
|
3
8
|
codecName: string;
|
|
9
|
+
/** Type of codec (software or hardware) */
|
|
10
|
+
type: 'software' | 'hardware';
|
|
4
11
|
}
|
|
12
|
+
/** Array of string arguments for FFmpeg */
|
|
5
13
|
export type HWArgs = string[];
|
|
6
|
-
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
path?: string;
|
|
10
|
-
}
|
|
14
|
+
/** FFmpeg version information */
|
|
11
15
|
export interface HWFFmpegVersion {
|
|
12
16
|
major: number;
|
|
13
17
|
minor: number;
|
|
14
18
|
patch: number;
|
|
15
19
|
}
|
|
16
|
-
|
|
20
|
+
/** Hardware acceleration methods supported by FFmpeg */
|
|
21
|
+
export type HwAccelMethod = 'auto' | 'cuda' | 'vaapi' | 'videotoolbox' | 'qsv' | 'rkmpp' | 'v4l2m2m' | 'opencl' | 'vulkan' | 'amf' | 'jetson';
|
|
22
|
+
/**
|
|
23
|
+
* Class to intelligently select the best VAAPI device
|
|
24
|
+
*/
|
|
25
|
+
export declare class VaapiDeviceSelector {
|
|
26
|
+
private _selectedGpu;
|
|
27
|
+
/**
|
|
28
|
+
* Get the best available VAAPI device
|
|
29
|
+
* @returns Path to the VAAPI device
|
|
30
|
+
*/
|
|
31
|
+
getSelectedGpu(): Promise<string>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Class to handle hardware-accelerated video encoding with FFmpeg
|
|
35
|
+
*/
|
|
17
36
|
export declare class FFMpegHardware {
|
|
18
|
-
static
|
|
19
|
-
static
|
|
20
|
-
static
|
|
21
|
-
static
|
|
22
|
-
static
|
|
23
|
-
static
|
|
24
|
-
static
|
|
25
|
-
static
|
|
26
|
-
static VideoCodecJetson264: HWVideoCodec;
|
|
27
|
-
static VideoCodecV4L2M2M264: HWVideoCodec;
|
|
28
|
-
static VideoCodecVulkan264: HWVideoCodec;
|
|
29
|
-
static
|
|
30
|
-
static
|
|
31
|
-
static
|
|
32
|
-
static
|
|
33
|
-
static
|
|
34
|
-
static
|
|
35
|
-
static
|
|
36
|
-
static
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
static readonly VideoCodecLibx264: HWVideoCodec;
|
|
38
|
+
static readonly VideoCodecNvenc264: HWVideoCodec;
|
|
39
|
+
static readonly VideoCodecQsv264: HWVideoCodec;
|
|
40
|
+
static readonly VideoCodecVaapi264: HWVideoCodec;
|
|
41
|
+
static readonly VideoCodecAmf264: HWVideoCodec;
|
|
42
|
+
static readonly VideoCodecToolbox264: HWVideoCodec;
|
|
43
|
+
static readonly VideoCodecOmx264: HWVideoCodec;
|
|
44
|
+
static readonly VideoCodecRkmpp264: HWVideoCodec;
|
|
45
|
+
static readonly VideoCodecJetson264: HWVideoCodec;
|
|
46
|
+
static readonly VideoCodecV4L2M2M264: HWVideoCodec;
|
|
47
|
+
static readonly VideoCodecVulkan264: HWVideoCodec;
|
|
48
|
+
static readonly VideoCodecOpenCL264: HWVideoCodec;
|
|
49
|
+
static readonly VideoCodecLibx265: HWVideoCodec;
|
|
50
|
+
static readonly VideoCodecNvenc265: HWVideoCodec;
|
|
51
|
+
static readonly VideoCodecQsv265: HWVideoCodec;
|
|
52
|
+
static readonly VideoCodecVaapi265: HWVideoCodec;
|
|
53
|
+
static readonly VideoCodecAmf265: HWVideoCodec;
|
|
54
|
+
static readonly VideoCodecToolbox265: HWVideoCodec;
|
|
55
|
+
static readonly VideoCodecOmx265: HWVideoCodec;
|
|
56
|
+
static readonly VideoCodecRkmpp265: HWVideoCodec;
|
|
57
|
+
static readonly VideoCodecJetson265: HWVideoCodec;
|
|
58
|
+
static readonly VideoCodecV4L2M2M265: HWVideoCodec;
|
|
59
|
+
static readonly VideoCodecVulkan265: HWVideoCodec;
|
|
60
|
+
static readonly VideoCodecOpenCL265: HWVideoCodec;
|
|
61
|
+
/** List of supported hardware codecs on the current system */
|
|
62
|
+
supportedCodecs: HWVideoCodec[];
|
|
39
63
|
private scalerRegex;
|
|
40
64
|
private _ffmpegPath;
|
|
41
|
-
private
|
|
42
|
-
|
|
65
|
+
private _userAgent;
|
|
66
|
+
private _vaapiDeviceSelector;
|
|
67
|
+
private _ffmpegVersion;
|
|
68
|
+
/** Get all supported H.264 codecs */
|
|
43
69
|
static get H264Codecs(): HWVideoCodec[];
|
|
70
|
+
/** Get all supported H.265 codecs */
|
|
44
71
|
static get H265Codecs(): HWVideoCodec[];
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Create a new FFMpegHardware instance
|
|
74
|
+
* @param _ffmpegPath Path to the FFmpeg executable
|
|
75
|
+
* @param userAgent Custom user agent for FFmpeg requests
|
|
76
|
+
*/
|
|
77
|
+
constructor(_ffmpegPath?: string, userAgent?: string);
|
|
78
|
+
/**
|
|
79
|
+
* Get FFmpeg version information
|
|
80
|
+
* @returns Version object with major, minor, and patch numbers
|
|
81
|
+
*/
|
|
82
|
+
getFFmpegVersion(): Promise<HWFFmpegVersion>;
|
|
83
|
+
/**
|
|
84
|
+
* Filter codecs based on current system architecture and OS
|
|
85
|
+
* @returns Filtered array of codecs that are likely to work on this system
|
|
86
|
+
*/
|
|
87
|
+
getSystemCompatibleCodecs(): HWVideoCodec[];
|
|
88
|
+
/**
|
|
89
|
+
* Initialize hardware acceleration support by testing specific codecs
|
|
90
|
+
* @param codecs List of codecs to test
|
|
91
|
+
*/
|
|
92
|
+
detectSupportedCodecsFromList(codecs: HWVideoCodec[]): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Initialize hardware acceleration support by testing available codecs
|
|
95
|
+
*/
|
|
96
|
+
detectSupportedCodecs(): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Create platform-specific probe arguments for testing codec support
|
|
99
|
+
* @param codec Codec to test
|
|
100
|
+
* @returns FFmpeg arguments for testing
|
|
101
|
+
*/
|
|
102
|
+
private createPlatformSpecificProbeArgs;
|
|
103
|
+
/**
|
|
104
|
+
* Set up hardware device initialization arguments
|
|
105
|
+
* @param args Existing FFmpeg arguments
|
|
106
|
+
* @param codec Target codec to set up
|
|
107
|
+
* @returns Updated arguments array
|
|
108
|
+
*/
|
|
109
|
+
setupHardwareDevice(args: HWArgs, codec: HWVideoCodec): Promise<HWArgs>;
|
|
110
|
+
/**
|
|
111
|
+
* Add codec-specific encoding parameters
|
|
112
|
+
* @param codec Target codec
|
|
113
|
+
* @returns Array of FFmpeg arguments for the codec
|
|
114
|
+
*/
|
|
115
|
+
getCodecSpecificArgs(codec: HWVideoCodec): HWArgs;
|
|
116
|
+
/**
|
|
117
|
+
* Create complete hardware filter chain for scaling and processing
|
|
118
|
+
* @param codec Target codec
|
|
119
|
+
* @param requestedWidth Desired output width
|
|
120
|
+
* @param requestedHeight Desired output height
|
|
121
|
+
* @param keepOnHardware Whether to keep processing on hardware
|
|
122
|
+
* @param pixelFormat Optional specific pixel format for output
|
|
123
|
+
* @returns Complete filter string or null
|
|
124
|
+
*/
|
|
125
|
+
createHardwareFilter(codec: HWVideoCodec, requestedWidth?: number, requestedHeight?: number, keepOnHardware?: boolean, pixelFormat?: string): string | null;
|
|
126
|
+
/**
|
|
127
|
+
* Create filter chain for software encoders
|
|
128
|
+
* @param requestedWidth Desired output width
|
|
129
|
+
* @param requestedHeight Desired output height
|
|
130
|
+
* @param pixelFormat Optional specific pixel format for output
|
|
131
|
+
* @returns Filter string for software encoding
|
|
132
|
+
*/
|
|
133
|
+
createSoftwareFilter(requestedWidth?: number, requestedHeight?: number, pixelFormat?: string): string;
|
|
134
|
+
/**
|
|
135
|
+
* Get initial filter setup for hardware pipeline
|
|
136
|
+
* @param codec Target codec
|
|
137
|
+
* @param keepOnHardware Whether to keep processing on hardware (true) or use hybrid pipeline (false)
|
|
138
|
+
* @returns Initial filter string
|
|
139
|
+
*/
|
|
140
|
+
createInitialFilter(codec: HWVideoCodec, keepOnHardware?: boolean): string;
|
|
141
|
+
/**
|
|
142
|
+
* Apply hardware-specific scaling template
|
|
143
|
+
* @param currentFilter Current filter string
|
|
144
|
+
* @param codec Target codec
|
|
145
|
+
* @param width Target width
|
|
146
|
+
* @param height Target height
|
|
147
|
+
* @returns Updated filter string with hardware-specific scaling
|
|
148
|
+
*/
|
|
149
|
+
applyScalingFilter(currentFilter: string, codec: HWVideoCodec, width: number, height: number): string;
|
|
150
|
+
/**
|
|
151
|
+
* Add final filters to bring data back to CPU if needed and handle format conversion
|
|
152
|
+
* @param currentFilter Current filter string
|
|
153
|
+
* @param codec Target codec
|
|
154
|
+
* @param keepOnHardware Whether to keep processing on hardware
|
|
155
|
+
* @param pixelFormat Optional specific pixel format for output
|
|
156
|
+
* @returns Final filter chain
|
|
157
|
+
*/
|
|
158
|
+
finalizePipeline(currentFilter: string, codec: HWVideoCodec, keepOnHardware: boolean, pixelFormat?: string): string;
|
|
159
|
+
/**
|
|
160
|
+
* Determine the hardware acceleration method used by a codec
|
|
161
|
+
* @param codec Target codec
|
|
162
|
+
* @returns Hardware acceleration method
|
|
163
|
+
*/
|
|
164
|
+
getHardwareMethod(codec: HWVideoCodec): HwAccelMethod;
|
|
165
|
+
/**
|
|
166
|
+
* Execute FFmpeg with given arguments
|
|
167
|
+
* @param args FFmpeg arguments
|
|
168
|
+
* @returns Promise that resolves when FFmpeg completes successfully
|
|
169
|
+
*/
|
|
170
|
+
private runFFmpeg;
|
|
171
|
+
/**
|
|
172
|
+
* Calculate output dimensions
|
|
173
|
+
* @param targetWidth Desired output width
|
|
174
|
+
* @param targetHeight Desired output height
|
|
175
|
+
* @returns [width, height] tuple with even dimensions
|
|
176
|
+
*/
|
|
177
|
+
private calculateOutputDimensions;
|
|
59
178
|
}
|