node-av 5.0.4 → 5.2.0-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/BENCHMARK.md +113 -0
- package/README.md +42 -0
- package/dist/api/bitstream-filter.d.ts +190 -74
- package/dist/api/bitstream-filter.js +276 -222
- package/dist/api/bitstream-filter.js.map +1 -1
- package/dist/api/decoder.d.ts +23 -29
- package/dist/api/decoder.js +37 -47
- package/dist/api/decoder.js.map +1 -1
- package/dist/api/encoder.d.ts +4 -4
- package/dist/api/encoder.js +16 -20
- package/dist/api/encoder.js.map +1 -1
- package/dist/api/filter-complex.js +7 -3
- package/dist/api/filter-complex.js.map +1 -1
- package/dist/api/filter.d.ts +4 -4
- package/dist/api/filter.js +18 -16
- package/dist/api/filter.js.map +1 -1
- package/dist/api/hardware.d.ts +17 -0
- package/dist/api/hardware.js +70 -23
- package/dist/api/hardware.js.map +1 -1
- package/dist/api/muxer.js +8 -4
- package/dist/api/muxer.js.map +1 -1
- package/dist/api/rtp-stream.js +0 -6
- package/dist/api/rtp-stream.js.map +1 -1
- package/dist/api/types.d.ts +29 -9
- package/dist/constants/constants.d.ts +6 -3
- package/dist/constants/constants.js +5 -5
- package/dist/constants/constants.js.map +1 -1
- package/dist/lib/codec-context.d.ts +5 -3
- package/dist/lib/codec-context.js +2 -0
- package/dist/lib/codec-context.js.map +1 -1
- package/dist/lib/native-types.d.ts +2 -2
- package/package.json +18 -13
- package/binding.gyp +0 -166
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
import type { AVBufferSrcFlag, AVChromaLocation, AVCodecCap, AVCodecFlag, AVCodecFlag2, AVCodecID, AVCodecProp, AVColorPrimaries, AVColorRange, AVColorSpace, AVColorTransferCharacteristic, AVDictFlag, AVDiscard, AVDisposition, AVFifoFlag, AVFilterCmdFlag, AVFilterConstants, AVFilterFlag, AVFormatFlag, AVFrameSideDataType, AVHWDeviceType, AVHWFrameTransferDirection, AVIOFlag, AVMediaType, AVOptionFlag, AVOptionType, AVPacketFlag, AVPacketSideDataType, AVPictureType, AVPixelFormat, AVProfile, AVSampleFormat, AVSeekFlag, AVSeekWhence, AVStreamEventFlag, SwsFlags } from '../constants/index.js';
|
|
10
|
+
import type { AVBufferSrcFlag, AVChromaLocation, AVCodecCap, AVCodecFlag, AVCodecFlag2, AVCodecID, AVCodecProp, AVColorPrimaries, AVColorRange, AVColorSpace, AVColorTransferCharacteristic, AVDictFlag, AVDiscard, AVDisposition, AVFifoFlag, AVFilterCmdFlag, AVFilterConstants, AVFilterFlag, AVFormatFlag, AVFrameSideDataType, AVHWDeviceType, AVHWFrameTransferDirection, AVIOFlag, AVMediaType, AVOptionFlag, AVOptionType, AVPacketFlag, AVPacketSideDataType, AVPictureType, AVPixelFormat, AVProfile, AVSampleFormat, AVSeekFlag, AVSeekWhence, AVStreamEventFlag, AVThreadType, SwsFlags } from '../constants/index.js';
|
|
11
11
|
import type { ChannelLayout, CodecProfile, FilterPad, ImageOptions, IRational, RTSPStreamInfo } from './types.js';
|
|
12
12
|
/**
|
|
13
13
|
* Native AVPacket binding interface
|
|
@@ -164,7 +164,7 @@ export interface NativeCodecContext extends Disposable {
|
|
|
164
164
|
profile: AVProfile;
|
|
165
165
|
level: number;
|
|
166
166
|
threadCount: number;
|
|
167
|
-
threadType:
|
|
167
|
+
threadType: AVThreadType;
|
|
168
168
|
width: number;
|
|
169
169
|
height: number;
|
|
170
170
|
gopSize: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-av",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.2.0-beta.1",
|
|
4
4
|
"description": "FFmpeg bindings for Node.js",
|
|
5
5
|
"author": "seydx (https://github.com/seydx/node-av)",
|
|
6
6
|
"type": "module",
|
|
@@ -34,7 +34,9 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
|
+
"benchmark": "tsx benchmarks/index.ts",
|
|
37
38
|
"build": "npm run generate && npm run build:tests && npm run build:examples && npm run build:tsc && npm run build:native",
|
|
39
|
+
"build:benchmarks": "tsc -p tsconfig.benchmarks.json",
|
|
38
40
|
"build:examples": "tsc -p tsconfig.examples.json",
|
|
39
41
|
"build:native": "node-gyp rebuild && cpy --flat build/Release/node-av.node binary/",
|
|
40
42
|
"build:tests": "tsc -p tsconfig.tests.json",
|
|
@@ -43,7 +45,7 @@
|
|
|
43
45
|
"docs:dev": "npm run predocs && vitepress dev docs --port 5173",
|
|
44
46
|
"docs:build": "npm run predocs && rimraf docs/.vitepress/dist && vitepress build docs && cpy --flat docs/logo.png docs/.vitepress/dist",
|
|
45
47
|
"docs:preview": "npm run predocs && vitepress preview docs --port 5174",
|
|
46
|
-
"format": "prettier --write src/ --write test/ --write scripts/ --write examples/ --ignore-unknown --no-error-on-unmatched-pattern",
|
|
48
|
+
"format": "prettier --write src/ --write test/ --write scripts/ --write examples/ --write benchmarks/ --ignore-unknown --no-error-on-unmatched-pattern",
|
|
47
49
|
"generate": "npm run patch:ffmpeg && npm run generate:ffmpeg-version && npm run generate:constants && npm run generate:encoders && npm run generate:decoders && npm run generate:hardware && npm run generate:layouts",
|
|
48
50
|
"generate:ffmpeg-version": "node scripts/generate-ffmpeg-version.js",
|
|
49
51
|
"generate:constants": "cross-env FFMPEG_DEV_PATH=externals/jellyfin-ffmpeg node scripts/generate-constants.js && prettier --write src/constants/constants.ts",
|
|
@@ -61,23 +63,26 @@
|
|
|
61
63
|
"release:patch": "npm run build:tsc && node scripts/prepare-release.js patch",
|
|
62
64
|
"release:minor": "npm run build:tsc && node scripts/prepare-release.js minor",
|
|
63
65
|
"release:major": "npm run build:tsc && node scripts/prepare-release.js major",
|
|
66
|
+
"release:beta:patch": "npm run build:tsc && node scripts/prepare-release.js beta-patch",
|
|
67
|
+
"release:beta:minor": "npm run build:tsc && node scripts/prepare-release.js beta-minor",
|
|
68
|
+
"release:beta:major": "npm run build:tsc && node scripts/prepare-release.js beta-major",
|
|
64
69
|
"test": "tsx --test test/*.test.ts",
|
|
65
70
|
"test:all": "npm run build:tests && npm run build:tsc && tsx --test test/*.test.ts",
|
|
66
71
|
"update": "updates --update ./"
|
|
67
72
|
},
|
|
68
73
|
"dependencies": {
|
|
69
74
|
"unzipper": "^0.12.3",
|
|
70
|
-
"werift": "^0.22.
|
|
75
|
+
"werift": "^0.22.4"
|
|
71
76
|
},
|
|
72
77
|
"optionalDependencies": {
|
|
73
|
-
"@seydx/node-av-darwin-arm64": "^5.0.
|
|
74
|
-
"@seydx/node-av-darwin-x64": "^5.0.
|
|
75
|
-
"@seydx/node-av-linux-arm64": "^5.0.
|
|
76
|
-
"@seydx/node-av-linux-x64": "^5.0.
|
|
77
|
-
"@seydx/node-av-win32-arm64-mingw": "^5.0.
|
|
78
|
-
"@seydx/node-av-win32-arm64-msvc": "^5.0.
|
|
79
|
-
"@seydx/node-av-win32-x64-mingw": "^5.0.
|
|
80
|
-
"@seydx/node-av-win32-x64-msvc": "^5.0.
|
|
78
|
+
"@seydx/node-av-darwin-arm64": "^5.2.0-beta.1",
|
|
79
|
+
"@seydx/node-av-darwin-x64": "^5.2.0-beta.1",
|
|
80
|
+
"@seydx/node-av-linux-arm64": "^5.2.0-beta.1",
|
|
81
|
+
"@seydx/node-av-linux-x64": "^5.2.0-beta.1",
|
|
82
|
+
"@seydx/node-av-win32-arm64-mingw": "^5.2.0-beta.1",
|
|
83
|
+
"@seydx/node-av-win32-arm64-msvc": "^5.2.0-beta.1",
|
|
84
|
+
"@seydx/node-av-win32-x64-mingw": "^5.2.0-beta.1",
|
|
85
|
+
"@seydx/node-av-win32-x64-msvc": "^5.2.0-beta.1"
|
|
81
86
|
},
|
|
82
87
|
"devDependencies": {
|
|
83
88
|
"@stylistic/eslint-plugin": "^5.7.1",
|
|
@@ -92,9 +97,9 @@
|
|
|
92
97
|
"cross-env": "^10.1.0",
|
|
93
98
|
"eslint": "^9.39.2",
|
|
94
99
|
"eslint-plugin-jsdoc": "^62.4.1",
|
|
95
|
-
"globals": "^17.
|
|
100
|
+
"globals": "^17.2.0",
|
|
96
101
|
"node-addon-api": "^8.5.0",
|
|
97
|
-
"node-gyp": "^12.
|
|
102
|
+
"node-gyp": "^12.2.0",
|
|
98
103
|
"prettier": "^3.8.1",
|
|
99
104
|
"rimraf": "^6.1.2",
|
|
100
105
|
"sharp": "^0.34.5",
|
package/binding.gyp
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"targets": [
|
|
3
|
-
{
|
|
4
|
-
"target_name": "node-av",
|
|
5
|
-
"sources": [
|
|
6
|
-
"src/bindings/index.cc",
|
|
7
|
-
"src/bindings/packet.cc",
|
|
8
|
-
"src/bindings/frame.cc",
|
|
9
|
-
"src/bindings/frame_async.cc",
|
|
10
|
-
"src/bindings/frame_sync.cc",
|
|
11
|
-
"src/bindings/codec.cc",
|
|
12
|
-
"src/bindings/codec_context.cc",
|
|
13
|
-
"src/bindings/codec_context_async.cc",
|
|
14
|
-
"src/bindings/codec_context_sync.cc",
|
|
15
|
-
"src/bindings/codec_parameters.cc",
|
|
16
|
-
"src/bindings/codec_parser.cc",
|
|
17
|
-
"src/bindings/format_context.cc",
|
|
18
|
-
"src/bindings/format_context_async.cc",
|
|
19
|
-
"src/bindings/format_context_sync.cc",
|
|
20
|
-
"src/bindings/stream.cc",
|
|
21
|
-
"src/bindings/dictionary.cc",
|
|
22
|
-
"src/bindings/input_format.cc",
|
|
23
|
-
"src/bindings/input_format_async.cc",
|
|
24
|
-
"src/bindings/input_format_sync.cc",
|
|
25
|
-
"src/bindings/output_format.cc",
|
|
26
|
-
"src/bindings/io_context.cc",
|
|
27
|
-
"src/bindings/io_context_async.cc",
|
|
28
|
-
"src/bindings/io_context_sync.cc",
|
|
29
|
-
"src/bindings/error.cc",
|
|
30
|
-
"src/bindings/software_scale_context.cc",
|
|
31
|
-
"src/bindings/software_scale_context_async.cc",
|
|
32
|
-
"src/bindings/software_scale_context_sync.cc",
|
|
33
|
-
"src/bindings/software_resample_context.cc",
|
|
34
|
-
"src/bindings/software_resample_context_async.cc",
|
|
35
|
-
"src/bindings/software_resample_context_sync.cc",
|
|
36
|
-
"src/bindings/filter.cc",
|
|
37
|
-
"src/bindings/filter_context.cc",
|
|
38
|
-
"src/bindings/filter_context_async.cc",
|
|
39
|
-
"src/bindings/filter_context_sync.cc",
|
|
40
|
-
"src/bindings/filter_graph.cc",
|
|
41
|
-
"src/bindings/filter_graph_async.cc",
|
|
42
|
-
"src/bindings/filter_graph_sync.cc",
|
|
43
|
-
"src/bindings/filter_graph_segment.cc",
|
|
44
|
-
"src/bindings/filter_inout.cc",
|
|
45
|
-
"src/bindings/hardware_device_context.cc",
|
|
46
|
-
"src/bindings/hardware_frames_context.cc",
|
|
47
|
-
"src/bindings/hardware_frames_context_async.cc",
|
|
48
|
-
"src/bindings/hardware_frames_context_sync.cc",
|
|
49
|
-
"src/bindings/log.cc",
|
|
50
|
-
"src/bindings/utilities.cc",
|
|
51
|
-
"src/bindings/audio_fifo.cc",
|
|
52
|
-
"src/bindings/audio_fifo_async.cc",
|
|
53
|
-
"src/bindings/audio_fifo_sync.cc",
|
|
54
|
-
"src/bindings/fifo.cc",
|
|
55
|
-
"src/bindings/fifo_async.cc",
|
|
56
|
-
"src/bindings/fifo_sync.cc",
|
|
57
|
-
"src/bindings/frame_utils.cc",
|
|
58
|
-
"src/bindings/bitstream_filter.cc",
|
|
59
|
-
"src/bindings/bitstream_filter_context.cc",
|
|
60
|
-
"src/bindings/bitstream_filter_context_async.cc",
|
|
61
|
-
"src/bindings/bitstream_filter_context_sync.cc",
|
|
62
|
-
"src/bindings/option.cc",
|
|
63
|
-
"src/bindings/sync_queue.cc",
|
|
64
|
-
"externals/jellyfin-ffmpeg/fftools/sync_queue.c",
|
|
65
|
-
],
|
|
66
|
-
"include_dirs": [
|
|
67
|
-
"<!@(node -p \"require('node-addon-api').include\")",
|
|
68
|
-
"/opt/ffbuild/prefix/include",
|
|
69
|
-
"<(module_root_dir)/externals/jellyfin-ffmpeg",
|
|
70
|
-
"<(module_root_dir)/externals/jellyfin-ffmpeg/libavcodec",
|
|
71
|
-
],
|
|
72
|
-
"library_dirs": ["/opt/ffbuild/prefix/lib"],
|
|
73
|
-
"dependencies": ["<!(node -p \"require('node-addon-api').gyp\")"],
|
|
74
|
-
"cflags!": ["-fno-exceptions"],
|
|
75
|
-
"cflags_cc!": ["-fno-exceptions"],
|
|
76
|
-
"defines": ["NAPI_DISABLE_CPP_EXCEPTIONS"],
|
|
77
|
-
"libraries": [
|
|
78
|
-
"-Wl,-force_load,/opt/ffbuild/prefix/lib/libavformat.a",
|
|
79
|
-
"-Wl,-force_load,/opt/ffbuild/prefix/lib/libavcodec.a",
|
|
80
|
-
"-Wl,-force_load,/opt/ffbuild/prefix/lib/libavfilter.a",
|
|
81
|
-
"-Wl,-force_load,/opt/ffbuild/prefix/lib/libavutil.a",
|
|
82
|
-
"-Wl,-force_load,/opt/ffbuild/prefix/lib/libswscale.a",
|
|
83
|
-
"-Wl,-force_load,/opt/ffbuild/prefix/lib/libswresample.a",
|
|
84
|
-
"-Wl,-force_load,/opt/ffbuild/prefix/lib/libavdevice.a",
|
|
85
|
-
"-L/opt/ffbuild/prefix/lib",
|
|
86
|
-
"/opt/ffbuild/prefix/lib/libx264.a",
|
|
87
|
-
"/opt/ffbuild/prefix/lib/libx265.a",
|
|
88
|
-
"/opt/ffbuild/prefix/lib/libvpx.a",
|
|
89
|
-
"/opt/ffbuild/prefix/lib/libopus.a",
|
|
90
|
-
"/opt/ffbuild/prefix/lib/libmp3lame.a",
|
|
91
|
-
"/opt/ffbuild/prefix/lib/libdav1d.a",
|
|
92
|
-
"/opt/ffbuild/prefix/lib/libSvtAv1Enc.a",
|
|
93
|
-
"/opt/ffbuild/prefix/lib/libogg.a",
|
|
94
|
-
"/opt/ffbuild/prefix/lib/libvorbis.a",
|
|
95
|
-
"/opt/ffbuild/prefix/lib/libvorbisenc.a",
|
|
96
|
-
"/opt/ffbuild/prefix/lib/libtheora.a",
|
|
97
|
-
"/opt/ffbuild/prefix/lib/libtheoraenc.a",
|
|
98
|
-
"/opt/ffbuild/prefix/lib/libtheoradec.a",
|
|
99
|
-
"/opt/ffbuild/prefix/lib/libwebp.a",
|
|
100
|
-
"/opt/ffbuild/prefix/lib/libwebpmux.a",
|
|
101
|
-
"/opt/ffbuild/prefix/lib/libsrt.a",
|
|
102
|
-
"/opt/ffbuild/prefix/lib/libass.a",
|
|
103
|
-
"/opt/ffbuild/prefix/lib/libharfbuzz.a",
|
|
104
|
-
"/opt/ffbuild/prefix/lib/libfontconfig.a",
|
|
105
|
-
"/opt/ffbuild/prefix/lib/libfreetype.a",
|
|
106
|
-
"/opt/ffbuild/prefix/lib/libfribidi.a",
|
|
107
|
-
"/opt/ffbuild/prefix/lib/libbluray.a",
|
|
108
|
-
"/opt/ffbuild/prefix/lib/libudfread.a",
|
|
109
|
-
"/opt/ffbuild/prefix/lib/libz.a",
|
|
110
|
-
"/opt/ffbuild/prefix/lib/liblzma.a",
|
|
111
|
-
"/opt/ffbuild/prefix/lib/libfdk-aac.a",
|
|
112
|
-
"/opt/ffbuild/prefix/lib/libNE10.a",
|
|
113
|
-
"/opt/ffbuild/prefix/lib/libchromaprint.a",
|
|
114
|
-
"/opt/ffbuild/prefix/lib/libopenmpt.a",
|
|
115
|
-
"/opt/ffbuild/prefix/lib/libzvbi.a",
|
|
116
|
-
"/opt/ffbuild/prefix/lib/libzimg.a",
|
|
117
|
-
"/opt/ffbuild/prefix/lib/libgmp.a",
|
|
118
|
-
"/opt/ffbuild/prefix/lib/libssl.a",
|
|
119
|
-
"/opt/ffbuild/prefix/lib/libcrypto.a",
|
|
120
|
-
"/opt/ffbuild/prefix/lib/libwhisper.a",
|
|
121
|
-
"/opt/ffbuild/prefix/lib/libggml.a",
|
|
122
|
-
"/opt/ffbuild/prefix/lib/libggml-base.a",
|
|
123
|
-
"/opt/ffbuild/prefix/lib/libggml-cpu.a",
|
|
124
|
-
"/opt/ffbuild/prefix/lib/libggml-blas.a",
|
|
125
|
-
"/opt/ffbuild/prefix/lib/libggml-metal.a",
|
|
126
|
-
"-liconv",
|
|
127
|
-
"-lxml2",
|
|
128
|
-
"-lbz2",
|
|
129
|
-
"-framework CoreFoundation",
|
|
130
|
-
"-framework CoreVideo",
|
|
131
|
-
"-framework CoreMedia",
|
|
132
|
-
"-framework CoreServices",
|
|
133
|
-
"-framework AudioToolbox",
|
|
134
|
-
"-framework VideoToolbox",
|
|
135
|
-
"-framework AVFoundation",
|
|
136
|
-
"-framework AppKit",
|
|
137
|
-
"-framework Accelerate",
|
|
138
|
-
"-framework Security",
|
|
139
|
-
"-framework IOKit",
|
|
140
|
-
"-framework OpenGL",
|
|
141
|
-
"-framework Metal",
|
|
142
|
-
"-framework MetalKit",
|
|
143
|
-
"-framework Foundation",
|
|
144
|
-
"-framework OpenCL",
|
|
145
|
-
],
|
|
146
|
-
"xcode_settings": {
|
|
147
|
-
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
|
|
148
|
-
"CLANG_CXX_LIBRARY": "libc++",
|
|
149
|
-
"CLANG_CXX_LANGUAGE_STANDARD": "c++17",
|
|
150
|
-
"MACOSX_DEPLOYMENT_TARGET": "12.0",
|
|
151
|
-
"OTHER_CPLUSPLUSFLAGS": [
|
|
152
|
-
"-fexceptions",
|
|
153
|
-
"-O3",
|
|
154
|
-
],
|
|
155
|
-
"OTHER_LDFLAGS": [
|
|
156
|
-
"-Wl,-dead_strip",
|
|
157
|
-
"-Wl,-no_warn_duplicate_libraries",
|
|
158
|
-
],
|
|
159
|
-
"CONDITIONS": [
|
|
160
|
-
["target_arch=='x64'", {"ARCHS": ["x86_64"]}],
|
|
161
|
-
["target_arch=='arm64'", {"ARCHS": ["arm64"]}],
|
|
162
|
-
],
|
|
163
|
-
},
|
|
164
|
-
}
|
|
165
|
-
]
|
|
166
|
-
}
|