@runnerpro/backend 1.12.24 → 1.12.25

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.
@@ -336,20 +336,16 @@ const getThumbnailFromVideo = (videoPath, duration) => __awaiter(void 0, void 0,
336
336
  const timestamp = Math.min(Math.max(duration * 0.1, 1), 10);
337
337
  return new Promise((resolve, reject) => {
338
338
  (0, fluent_ffmpeg_1.default)(videoPath)
339
- .screenshots({
340
- timestamps: [timestamp],
341
- filename: outputFilename,
342
- folder: tempDir,
343
- size: `${targetWidth}x${targetHeight}`,
344
- // Agregar filtro para mantener aspect ratio y hacer crop (equivalente a object-fit: cover)
345
- fastSeek: true,
346
- })
347
- .videoFilters([
348
- // Escalar manteniendo aspect ratio para que la dimensión menor coincida con el target
349
- `scale=${targetWidth}:${targetHeight}:force_original_aspect_ratio=increase`,
350
- // Hacer crop desde el centro para obtener exactamente el tamaño deseado
351
- `crop=${targetWidth}:${targetHeight}`,
339
+ .seekInput(timestamp)
340
+ .outputOptions([
341
+ '-vf',
342
+ `scale=${targetWidth}:${targetHeight}:force_original_aspect_ratio=increase,crop=${targetWidth}:${targetHeight}`,
343
+ '-vframes',
344
+ '1',
345
+ '-f',
346
+ 'image2',
352
347
  ])
348
+ .output(outputPath)
353
349
  .on('end', () => {
354
350
  try {
355
351
  // Leer el archivo como buffer
@@ -374,7 +370,8 @@ const getThumbnailFromVideo = (videoPath, duration) => __awaiter(void 0, void 0,
374
370
  console.error('Error limpiando archivo temporal:', cleanupError);
375
371
  }
376
372
  reject(error);
377
- });
373
+ })
374
+ .run();
378
375
  });
379
376
  });
380
377
  const getVideoDuration = (videoPath) => __awaiter(void 0, void 0, void 0, function* () {
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAuBpD,CAAC;AAqbF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAuBpD,CAAC;AAkbF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runnerpro/backend",
3
- "version": "1.12.24",
3
+ "version": "1.12.25",
4
4
  "description": "A collection of common backend functions",
5
5
  "exports": {
6
6
  ".": "./lib/cjs/index.js"