Recherche avancée
Médias (91)
-
Valkaama DVD Cover Outside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Valkaama DVD Cover Inside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
1,000,000
27 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Four of Us are Dying
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Sur d’autres sites (139)
-
Anomalie #1970 (Fermé) : Pas de crochets dans le HTML !
26 mars 2011, par cedric -corrigé par r17527
-
Revision 34267 : {{{ #DATE_DEBUT }}} dans les forums, c’est le 1er janvier 1970, ce qui ne ...
7 janvier 2010, par fil@… — Log#DATE_DEBUT dans les forums, c’est le 1er janvier 1970, ce qui ne m’arrange pas car je n’etais pas encore ne
-
Can I use the file buffer or stream as input for fluent-ffmpeg ? I am trying to avoid saving the video locally to get its path before removing
22 avril 2023, par Moath ThawahrehI am receiving the file via an api, I was trying to process the file.buffer as input for FFmpeg but it did not work, I had to save the video locally first and then process the path and remove the saved video later on.
I don't want to believe that there is no other way to solve this and I have been looking for solutions and workarounds but it was all about ffmpeg input as a path.


I would love to find a solution using fluent-ffmpeg because it has some other great features, but I won't mind any suggestions for compressing the video using any different approaches if it's more efficient


Again my code below works fine but I have to save the video and then remove it I am hoping for a more efficient solution :


fs.writeFileSync('temp.mp4', file.buffer);

 // Resize the temporary file using ffmpeg
 ffmpeg('temp.mp4') // here I tried pass file.buffer as readable stream,it receives paths only 
 .format('mp4')
 .size('50%')
 .save('resized.mp4')
 .on('end', async () => {
 // Upload the resized file to Firebase
 const resizedFileStream = bucket.file(`video/${uniqueId}`).createWriteStream();
 fs.createReadStream('resized.mp4').pipe(resizedFileStream);

 await new Promise<void>((resolve, reject) => {
 resizedFileStream
 .on('finish', () => {
 // Remove the local files after they have been uploaded
 fs.unlinkSync('temp.mp4');
 fs.unlinkSync('resized.mp4');
 resolve();
 })
 .on('error', reject);
 });

 // Get the URL of the uploaded resized version
 const resizedFile = bucket.file(`video/${uniqueId}`);
 const url = await resizedFile.getSignedUrl({
 action: 'read',
 expires: '03-17-2025', // Change this to a reasonable expiration date
 });

 console.log('Resized file uploaded successfully.');
 })
 .on('error', (err) => {
 console.log('An error occurred: ' + err.message);
 });
</void>