xvai-loi 0.1.81 → 0.1.83

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.
Files changed (3) hide show
  1. package/co.txt +1 -1
  2. package/package.json +1 -1
  3. package/xvai-loi.js +36 -3
package/co.txt CHANGED
@@ -1 +1 @@
1
- xvaiLoi120020
1
+ xvaiLoi120102
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xvai-loi",
3
- "version": "0.1.81",
3
+ "version": "0.1.83",
4
4
  "description": "Loi dung video (Edit Video Tu Dong) nap vao tool Google Flow qua o cam engine/oCam.ts",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
package/xvai-loi.js CHANGED
@@ -9684,8 +9684,8 @@ function moNhanh(g, W4, H2, ve, r, them = "") {
9684
9684
  // flow-src/engine/khuon.ts
9685
9685
  var KHUON_TOPN = {
9686
9686
  ten: "Top N chi\u1EC1u s\xE2u (Captions)",
9687
- tram: { phut: 18.3, tyLe: 0.7, phan: [0.83, 0.81, 0.46], daiTV: 2.1, video: 0.33, nhanVat: ["Vietnamese people in a real everyday setting.", "Close-up of an object, hands or a place that shows the idea, no faces."] },
9688
- // cảnh trám / phút, % thời lượng, 3 phần đầu/giữa/cuối, độ dài trung vị (s), tỉ lệ clip động; nhanVat: xen kẽ ảnh có người / cận vật-tay-nơi (đối thủ trộn web, stock, 3D — B06-1027: toàn ảnh người → 'không thấy mặt' 12 % < 15)
9687
+ tram: { phut: 18.3, tyLe: 0.7, phan: [0.83, 0.81, 0.46], daiTV: 2.1, video: 0.33, nhanVat: ["Vietnamese people in a real everyday setting.", "Close-up of an object, hands or a place that shows the idea, no faces."], cheToiDa: 0.55, tranToiDa: 0.8, tranToiThieu: 0.5 },
9688
+ // cheToiDa: phần phim người nói bị CHE (ảnh / thẻ kính toàn khung) tối đa — máy đo B9 'không thấy mặt' ≈ 0,5–0,87 × che (ảnh có người vẫn tính thấy mặt) → 0,55 giữ B9 ≤ ~40 (D03-1041: che 60 %, B9 53 %); tranToiThieu: không cắt khi trám còn < 50 % (B2 ≥ 45) · tranToiDa: trám cả chia / thẻ tối đa (B2 45–80 %) · cảnh trám / phút, % thời lượng, 3 phần đầu/giữa/cuối, độ dài trung vị (s), tỉ lệ clip động; nhanVat: xen kẽ ảnh có người / cận vật-tay-nơi (đối thủ trộn web, stock, 3D — B06-1027: toàn ảnh người → 'không thấy mặt' 12 % < 15)
9689
9689
  chu: { phut: [8, 18], caoMin: 0.042 },
9690
9690
  // caoMin: nét chữ nhấn (kể cả dấu) / H — đối thủ trung vị 0,042 (đo tay 23 dòng); chữ bị ép ngang thấp hơn → 2 dòng
9691
9691
  icon: { phut: 11.5 },
@@ -13004,6 +13004,35 @@ function lapCuongMe(o) {
13004
13004
  });
13005
13005
  }
13006
13006
  }
13007
+ {
13008
+ const mn = +(globalThis.__manhNguoi ?? KHUON_TOPN.cat.manhNguoi), ds2 = () => sp.filter((x) => x.bo !== "phong").sort((p, q) => p.f - q.f);
13009
+ for (const [loai2, tran] of [[/^(anh|kinh)$/, KHUON_TOPN.tram.cheToiDa], [/^(anh|kinh|chia|card)$/, KHUON_TOPN.tram.tranToiDa]]) {
13010
+ let du = sp.filter((x) => loai2.test(String(x.bo))).reduce((s2, x) => s2 + x.d, 0) - tran * tong, vong2 = 0;
13011
+ while (du > 0.05 && vong2++ < 60 && sp.filter((x) => /^(anh|kinh|chia|card)$/.test(String(x.bo))).reduce((s2, x) => s2 + x.d, 0) > KHUON_TOPN.tram.tranToiThieu * tong + 0.3) {
13012
+ const L = ds2(), cat2 = L.filter((x) => loai2.test(String(x.bo)) && /^(anh|chia)$/.test(String(x.bo)) && !x.khoa && !x.dong && !x.doc && !x.ui && !x.hang && x.f >= 1).sort((p, q) => q.d - p.d);
13013
+ let lam = false;
13014
+ for (const x of cat2) {
13015
+ const nx = L[L.indexOf(x) + 1], het = nx ? nx.f : tong, giu2 = Math.max(1.6, x.d - du - (nx && het - (x.f + x.d) < mn ? mn - (het - (x.f + x.d)) : 0));
13016
+ const d2 = nx && het - (x.f + giu2) < mn ? het - mn - x.f : giu2;
13017
+ if (d2 >= 1.6 && x.d - d2 > 0.25) {
13018
+ ghiL("rut", x, "khuon tram tran: " + x.d.toFixed(2) + " -> " + d2.toFixed(2) + " s");
13019
+ du -= x.d - d2;
13020
+ x.d = +d2.toFixed(2);
13021
+ lam = true;
13022
+ break;
13023
+ }
13024
+ }
13025
+ if (!lam) {
13026
+ const bo4 = cat2.filter((x) => !String(x.chu || x.giant || "").trim()).sort((p, q) => q.d - p.d)[0];
13027
+ if (!bo4) break;
13028
+ ghiL("bo", bo4, "khuon tram tran: bo anh khong chu");
13029
+ du -= bo4.d;
13030
+ sp.splice(sp.indexOf(bo4), 1);
13031
+ }
13032
+ }
13033
+ }
13034
+ G4.__tramTran = 1;
13035
+ }
13007
13036
  {
13008
13037
  const doi = (x) => /^(card|chia|tron|cut)$/.test(String(x.bo)), D = sp.filter(doi).sort((p, q) => p.f - q.f), tranD = Math.floor(KHUON_TOPN.nguoi.doiToiDa * tong / 60);
13009
13038
  let nD = 0;
@@ -18925,6 +18954,10 @@ async function chuanBiTaiSanAI(kieu, kb, bao) {
18925
18954
  if (khoaAnhDen() > Date.now() || loiLien >= 3) break;
18926
18955
  }
18927
18956
  }
18957
+ if (ok < ds2.length && khoaAnhDen() > Date.now()) {
18958
+ const G3 = globalThis, m = "Flow t\u1EA1m kho\xE1 t\u1EA1o \u1EA3nh t\u1EDBi " + new Date(khoaAnhDen()).toLocaleTimeString().slice(0, 5) + " \u2014 thi\u1EBFu " + (ds2.length - ok) + "/" + ds2.length + " \u1EA3nh tr\xE1m, xu\u1EA5t l\u1EA1i sau gi\u1EDD \u0111\xF3";
18959
+ G3.__canhBaoAI = G3.__canhBaoAI ? G3.__canhBaoAI + " \xB7 " + m : m;
18960
+ }
18928
18961
  return ok;
18929
18962
  }
18930
18963
  async function napAnhTay(ten, de, file) {
@@ -20944,7 +20977,7 @@ function datCauLenh(a) {
20944
20977
  on2 = true;
20945
20978
  window.addEventListener("message", async (ev) => {
20946
20979
  const d = ev.data;
20947
- if (!d || d.xvaiLoi120020 !== true) return;
20980
+ if (!d || d.xvaiLoi120102 !== true) return;
20948
20981
  const o = String(ev.origin || "");
20949
20982
  if (!(o.indexOf("https://flow.google.com") === 0 || o.indexOf("https://labs.google") === 0)) return;
20950
20983
  const tra = (kq) => {