bililive-cli 3.9.0 → 3.9.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.
|
@@ -11802,6 +11802,16 @@ const amfPresets = [
|
|
|
11802
11802
|
label: "quality",
|
|
11803
11803
|
},
|
|
11804
11804
|
];
|
|
11805
|
+
const videoToolBoxPresets = [
|
|
11806
|
+
{
|
|
11807
|
+
value: "1",
|
|
11808
|
+
label: "realtime",
|
|
11809
|
+
},
|
|
11810
|
+
{
|
|
11811
|
+
value: "0",
|
|
11812
|
+
label: "not realtime",
|
|
11813
|
+
},
|
|
11814
|
+
];
|
|
11805
11815
|
const amfAv1Presets = [
|
|
11806
11816
|
...amfPresets,
|
|
11807
11817
|
{
|
|
@@ -11876,6 +11886,17 @@ const videoEncoders = [
|
|
|
11876
11886
|
],
|
|
11877
11887
|
presets: amfPresets,
|
|
11878
11888
|
},
|
|
11889
|
+
{
|
|
11890
|
+
value: "h264_videotoolbox",
|
|
11891
|
+
label: "H.264(Apple)",
|
|
11892
|
+
birateControls: [
|
|
11893
|
+
{
|
|
11894
|
+
value: "VBR",
|
|
11895
|
+
label: "平均比特率",
|
|
11896
|
+
},
|
|
11897
|
+
],
|
|
11898
|
+
presets: videoToolBoxPresets,
|
|
11899
|
+
},
|
|
11879
11900
|
{
|
|
11880
11901
|
value: "libx265",
|
|
11881
11902
|
label: "H.265(x265)",
|
|
@@ -11932,9 +11953,20 @@ const videoEncoders = [
|
|
|
11932
11953
|
],
|
|
11933
11954
|
presets: amfPresets,
|
|
11934
11955
|
},
|
|
11956
|
+
{
|
|
11957
|
+
value: "hevc_videotoolbox",
|
|
11958
|
+
label: "H.265(Apple)",
|
|
11959
|
+
birateControls: [
|
|
11960
|
+
{
|
|
11961
|
+
value: "VBR",
|
|
11962
|
+
label: "平均比特率",
|
|
11963
|
+
},
|
|
11964
|
+
],
|
|
11965
|
+
presets: videoToolBoxPresets,
|
|
11966
|
+
},
|
|
11935
11967
|
{
|
|
11936
11968
|
value: "libsvtav1",
|
|
11937
|
-
label: "AV1
|
|
11969
|
+
label: "AV1(libsvtav1)",
|
|
11938
11970
|
birateControls: [
|
|
11939
11971
|
{
|
|
11940
11972
|
value: "CRF",
|
|
@@ -12006,7 +12038,7 @@ const videoEncoders = [
|
|
|
12006
12038
|
},
|
|
12007
12039
|
{
|
|
12008
12040
|
value: "av1_qsv",
|
|
12009
|
-
label: "AV1
|
|
12041
|
+
label: "AV1(Intel QSV)",
|
|
12010
12042
|
birateControls: [
|
|
12011
12043
|
{
|
|
12012
12044
|
value: "ICQ",
|
|
@@ -12021,7 +12053,7 @@ const videoEncoders = [
|
|
|
12021
12053
|
},
|
|
12022
12054
|
{
|
|
12023
12055
|
value: "av1_nvenc",
|
|
12024
|
-
label: "AV1
|
|
12056
|
+
label: "AV1(NVIDIA NVEnc)",
|
|
12025
12057
|
birateControls: [
|
|
12026
12058
|
{
|
|
12027
12059
|
value: "CQ",
|
|
@@ -12036,7 +12068,7 @@ const videoEncoders = [
|
|
|
12036
12068
|
},
|
|
12037
12069
|
{
|
|
12038
12070
|
value: "av1_amf",
|
|
12039
|
-
label: "AV1
|
|
12071
|
+
label: "AV1(AMD AMF)",
|
|
12040
12072
|
birateControls: [
|
|
12041
12073
|
{
|
|
12042
12074
|
value: "VBR",
|
|
@@ -12045,6 +12077,17 @@ const videoEncoders = [
|
|
|
12045
12077
|
],
|
|
12046
12078
|
presets: amfAv1Presets,
|
|
12047
12079
|
},
|
|
12080
|
+
{
|
|
12081
|
+
value: "av1_videotoolbox",
|
|
12082
|
+
label: "AV1(Apple)",
|
|
12083
|
+
birateControls: [
|
|
12084
|
+
{
|
|
12085
|
+
value: "VBR",
|
|
12086
|
+
label: "平均比特率",
|
|
12087
|
+
},
|
|
12088
|
+
],
|
|
12089
|
+
presets: videoToolBoxPresets,
|
|
12090
|
+
},
|
|
12048
12091
|
];
|
|
12049
12092
|
const defaultRecordConfig = {
|
|
12050
12093
|
providerId: "DouYu",
|
|
@@ -12175,6 +12218,18 @@ const baseFfmpegPresets = [
|
|
|
12175
12218
|
preset: "balanced",
|
|
12176
12219
|
},
|
|
12177
12220
|
},
|
|
12221
|
+
{
|
|
12222
|
+
id: "b_videotoolbox_h264",
|
|
12223
|
+
name: "H.264(Apple)",
|
|
12224
|
+
config: {
|
|
12225
|
+
...commonPresetParams,
|
|
12226
|
+
encoder: "h264_videotoolbox",
|
|
12227
|
+
bitrateControl: "VBR",
|
|
12228
|
+
bitrate: 8000,
|
|
12229
|
+
bit10: false,
|
|
12230
|
+
preset: "1",
|
|
12231
|
+
},
|
|
12232
|
+
},
|
|
12178
12233
|
{
|
|
12179
12234
|
id: "b_libx265",
|
|
12180
12235
|
name: "H.265(x265)",
|
|
@@ -12227,9 +12282,21 @@ const baseFfmpegPresets = [
|
|
|
12227
12282
|
preset: "balanced",
|
|
12228
12283
|
},
|
|
12229
12284
|
},
|
|
12285
|
+
{
|
|
12286
|
+
id: "b_videotoolbox_h265",
|
|
12287
|
+
name: "H.265(Apple)",
|
|
12288
|
+
config: {
|
|
12289
|
+
...commonPresetParams,
|
|
12290
|
+
encoder: "hevc_videotoolbox",
|
|
12291
|
+
bitrateControl: "VBR",
|
|
12292
|
+
bitrate: 8000,
|
|
12293
|
+
bit10: false,
|
|
12294
|
+
preset: "1",
|
|
12295
|
+
},
|
|
12296
|
+
},
|
|
12230
12297
|
{
|
|
12231
12298
|
id: "b_svt_av1",
|
|
12232
|
-
name: "AV1
|
|
12299
|
+
name: "AV1(libsvtav1)",
|
|
12233
12300
|
config: {
|
|
12234
12301
|
...commonPresetParams,
|
|
12235
12302
|
encoder: "libsvtav1",
|
|
@@ -12243,7 +12310,7 @@ const baseFfmpegPresets = [
|
|
|
12243
12310
|
},
|
|
12244
12311
|
{
|
|
12245
12312
|
id: "b_qsv_av1",
|
|
12246
|
-
name: "AV1
|
|
12313
|
+
name: "AV1(Intel QSV)",
|
|
12247
12314
|
config: {
|
|
12248
12315
|
...commonPresetParams,
|
|
12249
12316
|
encoder: "av1_qsv",
|
|
@@ -12256,7 +12323,7 @@ const baseFfmpegPresets = [
|
|
|
12256
12323
|
},
|
|
12257
12324
|
{
|
|
12258
12325
|
id: "b_nvenc_av1",
|
|
12259
|
-
name: "AV1
|
|
12326
|
+
name: "AV1(NVIDIA NVEnc)",
|
|
12260
12327
|
config: {
|
|
12261
12328
|
...commonPresetParams,
|
|
12262
12329
|
encoder: "av1_nvenc",
|
|
@@ -12270,7 +12337,7 @@ const baseFfmpegPresets = [
|
|
|
12270
12337
|
},
|
|
12271
12338
|
{
|
|
12272
12339
|
id: "b_amf_av1",
|
|
12273
|
-
name: "AV1
|
|
12340
|
+
name: "AV1(AMD AMF)",
|
|
12274
12341
|
config: {
|
|
12275
12342
|
...commonPresetParams,
|
|
12276
12343
|
encoder: "av1_amf",
|
|
@@ -12280,6 +12347,18 @@ const baseFfmpegPresets = [
|
|
|
12280
12347
|
preset: "balanced",
|
|
12281
12348
|
},
|
|
12282
12349
|
},
|
|
12350
|
+
{
|
|
12351
|
+
id: "b_videotoolbox_av1",
|
|
12352
|
+
name: "AV1(Apple)",
|
|
12353
|
+
config: {
|
|
12354
|
+
...commonPresetParams,
|
|
12355
|
+
encoder: "av1_videotoolbox",
|
|
12356
|
+
bitrateControl: "VBR",
|
|
12357
|
+
bitrate: 8000,
|
|
12358
|
+
bit10: false,
|
|
12359
|
+
preset: "1",
|
|
12360
|
+
},
|
|
12361
|
+
},
|
|
12283
12362
|
];
|
|
12284
12363
|
class FFmpegPreset extends CommonPreset {
|
|
12285
12364
|
constructor({ globalConfig }) {
|
|
@@ -44460,7 +44539,7 @@ async function trash(paths, options) {
|
|
|
44460
44539
|
} else if (process$2.platform === 'win32') {
|
|
44461
44540
|
module = await Promise.resolve().then(function () { return require('./windows-CJCw0QtL.cjs'); });
|
|
44462
44541
|
} else {
|
|
44463
|
-
module = await Promise.resolve().then(function () { return require('./linux-
|
|
44542
|
+
module = await Promise.resolve().then(function () { return require('./linux-CNe7K9Gx.cjs'); });
|
|
44464
44543
|
}
|
|
44465
44544
|
|
|
44466
44545
|
return module.default(paths);
|
|
@@ -53151,11 +53230,15 @@ const getHardwareAcceleration = (encoder) => {
|
|
|
53151
53230
|
else if (["libx264", "libx265", "libsvtav1"].includes(encoder)) {
|
|
53152
53231
|
return "cpu";
|
|
53153
53232
|
}
|
|
53233
|
+
else if (["h264_videotoolbox", "hevc_videotoolbox", "av1_videotoolbox"].includes(encoder)) {
|
|
53234
|
+
return "videotoolbox";
|
|
53235
|
+
}
|
|
53154
53236
|
else {
|
|
53155
53237
|
throw new Error(`未知的编码器: ${encoder}`);
|
|
53156
53238
|
}
|
|
53157
53239
|
};
|
|
53158
53240
|
const genFfmpegParams = (options) => {
|
|
53241
|
+
const hardware = getHardwareAcceleration(options.encoder);
|
|
53159
53242
|
const result = [];
|
|
53160
53243
|
if (options.encoder) {
|
|
53161
53244
|
result.push(`-c:v ${options.encoder}`);
|
|
@@ -53187,7 +53270,12 @@ const genFfmpegParams = (options) => {
|
|
|
53187
53270
|
if (options.preset) {
|
|
53188
53271
|
const encoder = videoEncoders.find((item) => item.value === options.encoder);
|
|
53189
53272
|
if ((encoder?.presets ?? []).findIndex((item) => item.value === options.preset) !== -1) {
|
|
53190
|
-
|
|
53273
|
+
if (hardware === "videotoolbox") {
|
|
53274
|
+
result.push(`-realtime ${options.preset}`);
|
|
53275
|
+
}
|
|
53276
|
+
else {
|
|
53277
|
+
result.push(`-preset ${options.preset}`);
|
|
53278
|
+
}
|
|
53191
53279
|
}
|
|
53192
53280
|
}
|
|
53193
53281
|
if (["libsvtav1"].includes(options.encoder)) {
|
|
@@ -4,7 +4,7 @@ var path$7 = require('node:path');
|
|
|
4
4
|
var http$3 = require('node:http');
|
|
5
5
|
var require$$0$4 = require('node:url');
|
|
6
6
|
var a = require('node:https');
|
|
7
|
-
var index = require('./index-
|
|
7
|
+
var index = require('./index-B4DHRkFJ.cjs');
|
|
8
8
|
var require$$0$5 = require('tty');
|
|
9
9
|
var require$$1$2 = require('util');
|
|
10
10
|
var require$$0$c = require('assert');
|
|
@@ -80233,7 +80233,9 @@ class WebhookHandler {
|
|
|
80233
80233
|
// 处理后的视频文件,可能被上传、非弹幕上传、同步
|
|
80234
80234
|
if (syncConfig?.targetFiles.includes("danmaku")) {
|
|
80235
80235
|
const shouldRemove = config.afterConvertRemoveVideoRaw;
|
|
80236
|
-
|
|
80236
|
+
if (filePath.includes("后处理") || filePath.includes("弹幕版")) {
|
|
80237
|
+
this.fileRefManager.addRef(filePath, shouldRemove);
|
|
80238
|
+
}
|
|
80237
80239
|
}
|
|
80238
80240
|
if (config.uid) {
|
|
80239
80241
|
const shouldRemove = config.afterUploadDeletAction === "delete" ||
|
|
@@ -80274,8 +80276,8 @@ class WebhookHandler {
|
|
|
80274
80276
|
// 5. 处理弹幕和视频压制
|
|
80275
80277
|
const processingResult = await this.processMediaFiles(context, options, config, xmlFilePath);
|
|
80276
80278
|
index.logObj.debug("processingResult", processingResult, options.filePath, context.part.filePath);
|
|
80279
|
+
this.collectTasks(context.part.filePath, "handledVideo", config);
|
|
80277
80280
|
if (processingResult.conversionSuccessful) {
|
|
80278
|
-
this.collectTasks(context.part.filePath, "handledVideo", config);
|
|
80279
80281
|
this.fileRefManager.releaseRef(options.filePath);
|
|
80280
80282
|
}
|
|
80281
80283
|
if (xmlFilePath && processingResult.danmuConversionSuccessful) {
|
|
@@ -81094,7 +81096,7 @@ exports.handler = void 0;
|
|
|
81094
81096
|
exports.appConfig = void 0;
|
|
81095
81097
|
exports.container = void 0;
|
|
81096
81098
|
const fileCache = createFileCache();
|
|
81097
|
-
path$7.dirname(require$$0$4.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-
|
|
81099
|
+
path$7.dirname(require$$0$4.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-Cba0EEtx.cjs', document.baseURI).href))));
|
|
81098
81100
|
const authMiddleware = (passKey) => {
|
|
81099
81101
|
return async (ctx, next) => {
|
|
81100
81102
|
const authHeader = ctx.headers["authorization"] || ctx.request.query.auth;
|
package/lib/index.cjs
CHANGED
|
@@ -3715,7 +3715,7 @@ const {
|
|
|
3715
3715
|
Help,
|
|
3716
3716
|
} = commander;
|
|
3717
3717
|
|
|
3718
|
-
var version = "3.9.
|
|
3718
|
+
var version = "3.9.1";
|
|
3719
3719
|
|
|
3720
3720
|
process.on("uncaughtException", function (error) {
|
|
3721
3721
|
console.error(`${new Date().toISOString()} uncaughtException`, error);
|
|
@@ -3741,8 +3741,8 @@ program
|
|
|
3741
3741
|
throw new Error(`${c.configFolder}参数不存在,请先重新运行 config gen 命令`);
|
|
3742
3742
|
}
|
|
3743
3743
|
// 下面两行顺序不能换(
|
|
3744
|
-
const { init } = await Promise.resolve().then(function () { return require('./index-
|
|
3745
|
-
const { serverStart } = await Promise.resolve().then(function () { return require('./index-
|
|
3744
|
+
const { init } = await Promise.resolve().then(function () { return require('./index-B4DHRkFJ.cjs'); }).then(function (n) { return n.index; });
|
|
3745
|
+
const { serverStart } = await Promise.resolve().then(function () { return require('./index-Cba0EEtx.cjs'); });
|
|
3746
3746
|
const globalConfig = {
|
|
3747
3747
|
ffmpegPresetPath: path$1.join(c.configFolder, "ffmpeg_presets.json"),
|
|
3748
3748
|
videoPresetPath: path$1.join(c.configFolder, "presets.json"),
|
|
@@ -3825,7 +3825,7 @@ function generateConfig(configPath) {
|
|
|
3825
3825
|
defaultConfig.configFolder = configFolder;
|
|
3826
3826
|
}
|
|
3827
3827
|
}
|
|
3828
|
-
else if (process.platform === "linux") {
|
|
3828
|
+
else if (process.platform === "linux" || process.platform === "darwin") {
|
|
3829
3829
|
defaultConfig.ffmpegPath = "ffmpeg";
|
|
3830
3830
|
defaultConfig.ffprobePath = "ffprobe";
|
|
3831
3831
|
defaultConfig.mesioPath = "mesio";
|
|
@@ -4,7 +4,7 @@ var os$3 = require('node:os');
|
|
|
4
4
|
var path$5 = require('node:path');
|
|
5
5
|
var fs$3 = require('node:fs');
|
|
6
6
|
var crypto = require('node:crypto');
|
|
7
|
-
var index = require('./index-
|
|
7
|
+
var index = require('./index-B4DHRkFJ.cjs');
|
|
8
8
|
var require$$0$1 = require('fs');
|
|
9
9
|
var require$$0 = require('path');
|
|
10
10
|
var require$$0$2 = require('child_process');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bililive-cli",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "biliLive-tools的cli程序",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"commander": "^12.1.0",
|
|
40
40
|
"rimraf": "^6.0.1",
|
|
41
41
|
"tsx": "^4.19.2",
|
|
42
|
-
"@biliLive-tools/
|
|
43
|
-
"@biliLive-tools/
|
|
44
|
-
"@biliLive-tools/
|
|
42
|
+
"@biliLive-tools/http": "3.9.1",
|
|
43
|
+
"@biliLive-tools/types": "3.9.1",
|
|
44
|
+
"@biliLive-tools/shared": "3.9.1"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"start": "tsx src/index.ts",
|