Ajouter la prise en charge de la résolution personnalisée lors de la création de vidéos

This commit is contained in:
2025-03-31 11:22:19 +02:00
parent 6c48612554
commit 9101497a7f
2 changed files with 10 additions and 3 deletions

View File

@@ -57,9 +57,15 @@ router.post('/videos', async (req, res) => {
const { duration: videoDuration, measurement_ids: videoMeasurementIds, project_id: videoProjectId } = result.rows[0];
const pathList = await measureManager.getPathList(videoMeasurementIds, videoProjectId);
// parser la résolution (ex: 1920x1080)
const [res_width, res_height] = resolution.split('x').map(Number);
if (isNaN(res_width) || isNaN(res_height)) {
return res.status(400).json({ error: 'Invalid resolution format. Use WIDTHxHEIGHT (e.g., 1920x1080)' });
}
// Start background processing
videoManager.createVideoWithList(videoProjectId, pathList, videoDuration, videoId)
videoManager.createVideoWithList(videoProjectId, pathList, videoDuration, videoId, res_width, res_height)
.then(videoFile => {
console.log('Rendu vidéo terminé:', videoFile);
return videoManager.updateVideoFile(videoId, videoFile);