Modifier la fonction createVideoWithList pour accepter la durée et ajuster le frame rate en conséquence
This commit is contained in:
@@ -27,7 +27,7 @@ async function deleteVideoProject(videoId) {
|
||||
return res.rows[0];
|
||||
}
|
||||
|
||||
async function createVideoWithList(projectId, pathList) {
|
||||
async function createVideoWithList(projectId, pathList, duration) {
|
||||
//pathList étant la liste des chemins déjà triés
|
||||
const tempFile = path.join('temp.txt');
|
||||
try {
|
||||
@@ -55,7 +55,7 @@ async function createVideoWithList(projectId, pathList) {
|
||||
// Créer un fichier temporaire pour la liste des images
|
||||
fs.writeFileSync(tempFile, sortedImages.map(image => `file '${image}'`).join('\n'));
|
||||
|
||||
const frameRate = 10;
|
||||
const frameRate = Math.ceil(sortedImages.length / duration);
|
||||
|
||||
// le fichier final prend cette forme : {projectId}_{firstImageId}_{lastImageId}-{timestamp}.mp4
|
||||
const timestamp = new Date().getTime();
|
||||
|
||||
Reference in New Issue
Block a user