GUI-STUDIO commited on
Commit ·
07977e5
1
Parent(s): 4a7c094
p1
Browse files- src/lib/ffmpeg-v2.ts +23 -0
- src/sub-router/showtime.ts +28 -16
src/lib/ffmpeg-v2.ts
CHANGED
|
@@ -81,6 +81,7 @@ function check_if_fFmpeg_active() {
|
|
| 81 |
|
| 82 |
export const NS_ffmpeg_v2 = {
|
| 83 |
F_probe_t1,
|
|
|
|
| 84 |
F_build_ffmpeg_flags_t1,
|
| 85 |
proc_error_pattern,
|
| 86 |
ffmpeg_path,
|
|
@@ -1038,3 +1039,25 @@ export function F_estimate_hls_size(arg0: {
|
|
| 1038 |
return { ratio: spec_minimum(type), source: "spec_minimum" };
|
| 1039 |
}
|
| 1040 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
export const NS_ffmpeg_v2 = {
|
| 83 |
F_probe_t1,
|
| 84 |
+
F_ping_probe,
|
| 85 |
F_build_ffmpeg_flags_t1,
|
| 86 |
proc_error_pattern,
|
| 87 |
ffmpeg_path,
|
|
|
|
| 1039 |
return { ratio: spec_minimum(type), source: "spec_minimum" };
|
| 1040 |
}
|
| 1041 |
}
|
| 1042 |
+
|
| 1043 |
+
async function F_ping_probe(arg0: {
|
| 1044 |
+
playback: Omit<T_probe_playback, "picture_quality">;
|
| 1045 |
+
context?: Context;
|
| 1046 |
+
just_cmd?: boolean;
|
| 1047 |
+
timeout?: number;
|
| 1048 |
+
}) {
|
| 1049 |
+
const { context, playback, timeout, just_cmd } = arg0;
|
| 1050 |
+
|
| 1051 |
+
const [E_, R_] = await NS_promise.F_catch_promise({
|
| 1052 |
+
promise: NS_ffmpeg_v2.F_probe_t1({
|
| 1053 |
+
context,
|
| 1054 |
+
playback,
|
| 1055 |
+
timeout,
|
| 1056 |
+
just_cmd
|
| 1057 |
+
})
|
| 1058 |
+
});
|
| 1059 |
+
|
| 1060 |
+
if (E_) throw E_;
|
| 1061 |
+
|
| 1062 |
+
return R_;
|
| 1063 |
+
}
|
src/sub-router/showtime.ts
CHANGED
|
@@ -447,13 +447,6 @@ async function process_data(arg0: {
|
|
| 447 |
|
| 448 |
if (!stream_delivery_handler) stream_to_pipe = false;
|
| 449 |
|
| 450 |
-
if (separate_audio) {
|
| 451 |
-
phase = "single";
|
| 452 |
-
two_step = false;
|
| 453 |
-
use_s3_pipe = IS_RENDER_COM() && !gh_proxy ? true : false;
|
| 454 |
-
stream_to_pipe = false;
|
| 455 |
-
}
|
| 456 |
-
|
| 457 |
if (stream_to_pipe) {
|
| 458 |
use_s3_pipe = false;
|
| 459 |
}
|
|
@@ -462,6 +455,13 @@ async function process_data(arg0: {
|
|
| 462 |
use_s3_pipe = true;
|
| 463 |
}
|
| 464 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 465 |
const output_destination_clean = NS_misc.cleanNameV2(output_destination);
|
| 466 |
|
| 467 |
const clean_file_id =
|
|
@@ -669,7 +669,7 @@ async function process_data(arg0: {
|
|
| 669 |
};
|
| 670 |
}
|
| 671 |
|
| 672 |
-
const _ = await
|
| 673 |
|
| 674 |
if (!_?.success) {
|
| 675 |
throw new Error("Something went wrong: with probe");
|
|
@@ -796,7 +796,7 @@ async function process_data(arg0: {
|
|
| 796 |
flags = CMD.flags;
|
| 797 |
|
| 798 |
if (ops === "jc") {
|
| 799 |
-
const _ = await
|
| 800 |
|
| 801 |
if (_.success) {
|
| 802 |
return {
|
|
@@ -863,12 +863,13 @@ async function process_data(arg0: {
|
|
| 863 |
});
|
| 864 |
}
|
| 865 |
|
| 866 |
-
|
| 867 |
two_step &&
|
| 868 |
!(playback as any).i_x &&
|
| 869 |
stream_to_pipe &&
|
| 870 |
-
stream_delivery_handler
|
| 871 |
-
|
|
|
|
| 872 |
const _ = new URL(stream_delivery_handler);
|
| 873 |
|
| 874 |
_.searchParams.set("x_i", job_id);
|
|
@@ -946,7 +947,14 @@ async function process_data(arg0: {
|
|
| 946 |
use_s3_pipe = false;
|
| 947 |
}
|
| 948 |
|
| 949 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 950 |
} else {
|
| 951 |
NS_Misc.console.log({
|
| 952 |
ENV: "all",
|
|
@@ -965,7 +973,7 @@ async function process_data(arg0: {
|
|
| 965 |
? clean_sp_size > 30 * 1e9
|
| 966 |
: undefined;
|
| 967 |
|
| 968 |
-
NS_promise.F_catch_promise({
|
| 969 |
promise: ky.post(
|
| 970 |
(() => {
|
| 971 |
const _ = new URL(
|
|
@@ -1001,6 +1009,12 @@ async function process_data(arg0: {
|
|
| 1001 |
}
|
| 1002 |
)
|
| 1003 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1004 |
} else {
|
| 1005 |
run({
|
| 1006 |
ii: 0,
|
|
@@ -2042,8 +2056,6 @@ async function process_data(arg0: {
|
|
| 2042 |
return true;
|
| 2043 |
}
|
| 2044 |
|
| 2045 |
-
console.log({ logged_proc_info });
|
| 2046 |
-
|
| 2047 |
const eof_lines = logged_proc_info
|
| 2048 |
.map((xx) => xx.toString().toLowerCase())
|
| 2049 |
.filter(
|
|
|
|
| 447 |
|
| 448 |
if (!stream_delivery_handler) stream_to_pipe = false;
|
| 449 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 450 |
if (stream_to_pipe) {
|
| 451 |
use_s3_pipe = false;
|
| 452 |
}
|
|
|
|
| 455 |
use_s3_pipe = true;
|
| 456 |
}
|
| 457 |
|
| 458 |
+
if (separate_audio) {
|
| 459 |
+
phase = "single";
|
| 460 |
+
two_step = false;
|
| 461 |
+
use_s3_pipe = IS_RENDER_COM() && !gh_proxy ? true : false;
|
| 462 |
+
stream_to_pipe = false;
|
| 463 |
+
}
|
| 464 |
+
|
| 465 |
const output_destination_clean = NS_misc.cleanNameV2(output_destination);
|
| 466 |
|
| 467 |
const clean_file_id =
|
|
|
|
| 669 |
};
|
| 670 |
}
|
| 671 |
|
| 672 |
+
const _ = await NS_ffmpeg_v2.F_ping_probe({ playback, timeout: 0 });
|
| 673 |
|
| 674 |
if (!_?.success) {
|
| 675 |
throw new Error("Something went wrong: with probe");
|
|
|
|
| 796 |
flags = CMD.flags;
|
| 797 |
|
| 798 |
if (ops === "jc") {
|
| 799 |
+
const _ = await NS_ffmpeg_v2.F_ping_probe({ playback, timeout: 0 });
|
| 800 |
|
| 801 |
if (_.success) {
|
| 802 |
return {
|
|
|
|
| 863 |
});
|
| 864 |
}
|
| 865 |
|
| 866 |
+
const handle_over_to_stream =
|
| 867 |
two_step &&
|
| 868 |
!(playback as any).i_x &&
|
| 869 |
stream_to_pipe &&
|
| 870 |
+
stream_delivery_handler;
|
| 871 |
+
|
| 872 |
+
if (handle_over_to_stream) {
|
| 873 |
const _ = new URL(stream_delivery_handler);
|
| 874 |
|
| 875 |
_.searchParams.set("x_i", job_id);
|
|
|
|
| 947 |
use_s3_pipe = false;
|
| 948 |
}
|
| 949 |
|
| 950 |
+
if (IS_GH()) {
|
| 951 |
+
run({
|
| 952 |
+
ii: 0,
|
| 953 |
+
...((playback as any).i_x ? { keep_subs: true, rebuild: true } : {})
|
| 954 |
+
});
|
| 955 |
+
} else {
|
| 956 |
+
fail(["STREAM PIPE FAILED"]);
|
| 957 |
+
}
|
| 958 |
} else {
|
| 959 |
NS_Misc.console.log({
|
| 960 |
ENV: "all",
|
|
|
|
| 973 |
? clean_sp_size > 30 * 1e9
|
| 974 |
: undefined;
|
| 975 |
|
| 976 |
+
const [E_, R_] = await NS_promise.F_catch_promise({
|
| 977 |
promise: ky.post(
|
| 978 |
(() => {
|
| 979 |
const _ = new URL(
|
|
|
|
| 1009 |
}
|
| 1010 |
)
|
| 1011 |
});
|
| 1012 |
+
|
| 1013 |
+
NS_Misc.console.log({
|
| 1014 |
+
ENV: "all",
|
| 1015 |
+
_browser: false,
|
| 1016 |
+
_log: [`GH FF-DL PIPE INIT RESULTS`, { E_ }, { R_ }, "\n"]
|
| 1017 |
+
});
|
| 1018 |
} else {
|
| 1019 |
run({
|
| 1020 |
ii: 0,
|
|
|
|
| 2056 |
return true;
|
| 2057 |
}
|
| 2058 |
|
|
|
|
|
|
|
| 2059 |
const eof_lines = logged_proc_info
|
| 2060 |
.map((xx) => xx.toString().toLowerCase())
|
| 2061 |
.filter(
|