@boruto_vk7/stickengine 4.2.2 → 4.2.3

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @boruto_vk7/stickengine
2
2
 
3
- > **4.2.2 — TURBO**: WebP animado agora é codificado **em paralelo** (um processo ffmpeg por núcleo, até 4) e os pedaços são remontados byte a byte, sem recodificar a junção. Defaults de velocidade: `fps` 15→12, `quality` animado 80→75, `compressionLevel` 6→1 (6 multiplicava o tempo de encode), auto-shrink proporcional (≤3 tentativas) e ffmpeg do sistema preferido quando tem `libwebp`. Um clipe de 4s que levava ~20s numa VPS fraca agora sai em poucos segundos. Desative o paralelismo com `parallelChunks: 1`.
3
+ > **4.2.3 — TURBO**: WebP animado agora é codificado **em paralelo** (um processo ffmpeg por núcleo, até 4) e os pedaços são remontados byte a byte, sem recodificar a junção. Defaults de velocidade: `fps` 15→10, `quality` animado 80→75, `compressionLevel` 6→1 (6 multiplicava o tempo de encode), auto-shrink proporcional (≤3 tentativas) e ffmpeg do sistema preferido quando tem `libwebp`. Um clipe de 4s que levava ~20s numa VPS fraca agora sai em poucos segundos. Desative o paralelismo com `parallelChunks: 1`.
4
4
 
5
5
 
6
6
  [![npm](https://img.shields.io/npm/v/@boruto_vk7/stickengine)](https://www.npmjs.com/package/@boruto_vk7/stickengine)
@@ -761,7 +761,7 @@ class StickEngine extends node_events_1.EventEmitter {
761
761
  async detectVideoCropByCropdetect(input, mediaInfo) {
762
762
  try {
763
763
  const args = ['-nostdin', '-hide_banner', '-i', input, '-an'];
764
- const sample = mediaInfo.duration > 0 ? Math.min(mediaInfo.duration, 3) : 0;
764
+ const sample = mediaInfo.duration > 0 ? Math.min(mediaInfo.duration, 2) : 0;
765
765
  if (sample > 0)
766
766
  args.push('-t', String(sample));
767
767
  args.push('-vf', `cropdetect=limit=${this.crop.tolerance}:round=2:reset=0`, '-f', 'null', '-');
@@ -1428,12 +1428,12 @@ class StickEngine extends node_events_1.EventEmitter {
1428
1428
  let quality = this.options.quality != null
1429
1429
  ? (0, util_js_1.clamp)(Number(this.options.quality) || 80, 1, 100)
1430
1430
  : (isAnimated ? 75 : 90);
1431
- let fps = (0, util_js_1.clamp)(Math.round(Number(this.options.fps ?? 12) || 12), 1, 60);
1431
+ let fps = (0, util_js_1.clamp)(Math.round(Number(this.options.fps ?? 10) || 10), 1, 60);
1432
1432
  // orçamento de frames: clipe longo roda com fps menor p/ codificar
1433
- // menos frames e caber no maxSize sem re-encode (~120 frames no total)
1433
+ // menos frames e caber no maxSize sem re-encode (~100 frames no total)
1434
1434
  const clipeDur = this.duracaoClipe(opts.mediaInfo);
1435
- if (isAnimated && this.options.fps == null && clipeDur > 6)
1436
- fps = Math.max(8, Math.round(120 / clipeDur));
1435
+ if (isAnimated && this.options.fps == null && clipeDur > 10)
1436
+ fps = Math.max(8, Math.round(100 / clipeDur));
1437
1437
  const limit = isAnimated ? this.maxSize : this.maxSizeStatic;
1438
1438
  try {
1439
1439
  const paralelo = isAnimated && !watermarkPath
@@ -746,7 +746,7 @@ export class StickEngine extends EventEmitter {
746
746
  async detectVideoCropByCropdetect(input, mediaInfo) {
747
747
  try {
748
748
  const args = ['-nostdin', '-hide_banner', '-i', input, '-an'];
749
- const sample = mediaInfo.duration > 0 ? Math.min(mediaInfo.duration, 3) : 0;
749
+ const sample = mediaInfo.duration > 0 ? Math.min(mediaInfo.duration, 2) : 0;
750
750
  if (sample > 0)
751
751
  args.push('-t', String(sample));
752
752
  args.push('-vf', `cropdetect=limit=${this.crop.tolerance}:round=2:reset=0`, '-f', 'null', '-');
@@ -1413,12 +1413,12 @@ export class StickEngine extends EventEmitter {
1413
1413
  let quality = this.options.quality != null
1414
1414
  ? clamp(Number(this.options.quality) || 80, 1, 100)
1415
1415
  : (isAnimated ? 75 : 90);
1416
- let fps = clamp(Math.round(Number(this.options.fps ?? 12) || 12), 1, 60);
1416
+ let fps = clamp(Math.round(Number(this.options.fps ?? 10) || 10), 1, 60);
1417
1417
  // orçamento de frames: clipe longo roda com fps menor p/ codificar
1418
- // menos frames e caber no maxSize sem re-encode (~120 frames no total)
1418
+ // menos frames e caber no maxSize sem re-encode (~100 frames no total)
1419
1419
  const clipeDur = this.duracaoClipe(opts.mediaInfo);
1420
- if (isAnimated && this.options.fps == null && clipeDur > 6)
1421
- fps = Math.max(8, Math.round(120 / clipeDur));
1420
+ if (isAnimated && this.options.fps == null && clipeDur > 10)
1421
+ fps = Math.max(8, Math.round(100 / clipeDur));
1422
1422
  const limit = isAnimated ? this.maxSize : this.maxSizeStatic;
1423
1423
  try {
1424
1424
  const paralelo = isAnimated && !watermarkPath
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boruto_vk7/stickengine",
3
- "version": "4.2.2",
3
+ "version": "4.2.3",
4
4
  "description": "WhatsApp sticker engine - media preparation only: 512x512 static/animated WebP, parallel animated encoding, automatic black-border removal, full-bleed cover fit, audio sticker pair (WebP + OGG/Opus), bundled canvas and ffmpeg binaries, pack EXIF, chalk logging. No message sending, no Baileys coupling.",
5
5
  "author": "Borutovk7 - Lagos Solutions",
6
6
  "license": "MIT",