Ajouter la prise en charge de la résolution personnalisée lors de la création de vidéos
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user