@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
|
-
.
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
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;
|
|
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"}
|