
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (80)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (10352)
-
How to Correctly Implement ffmpeg Complex Filters in Node.js for Image Processing ?
24 janvier 2024, par LukeProblem :


I am trying to add filters and transitions between my image slideshow array, and am struggling to apply the proper filters. For example, I get errors like this :


{
 "errorType": "Error",
 "errorMessage": "ffmpeg exited with code 234: Failed to set value 'fade=type=in:start_time=0:duration=1,zoompan=z=zoom+0.002:d=120:x=if(gte(zoom,1.2),x,x+1):y=if(gte(zoom,1.2),y,y+1)' for option 'filter_complex': Invalid argument\nError parsing global options: Invalid argument\n",
 "trace": [
 "Error: ffmpeg exited with code 234: Failed to set value 'fade=type=in:start_time=0:duration=1,zoompan=z=zoom+0.002:d=120:x=if(gte(zoom,1.2),x,x+1):y=if(gte(zoom,1.2),y,y+1)' for option 'filter_complex': Invalid argument",
 "Error parsing global options: Invalid argument",
 "",
 " at ChildProcess.<anonymous> (/opt/nodejs/node_modules/fluent-ffmpeg/lib/processor.js:182:22)",
 " at ChildProcess.emit (node:events:517:28)",
 " at ChildProcess._handle.onexit (node:internal/child_process:292:12)"
 ]
}
</anonymous>


Lambda Function Code :


async function concat(bucketName, imageKeys) {
 const imageStreams = await Promise.all(
 imageKeys.map(async (key, i) => {
 const command = new GetObjectCommand({ Bucket: bucketName, Key: key });
 const response = await s3.send(command);
 // Define the temporary file path based on the index
 const tempFilePath = `/tmp/${i}.png`;
 
 // Write the image data to the temporary file
 await fs.writeFile(tempFilePath, response.Body);
 
 // Return the file path to be used later
 return tempFilePath;
 })
 );
 
 // Create a file list content with durations
 let fileContent = "";
 for (let i = 0; i < imageStreams.length; i++) {
 fileContent += `file '${imageStreams[i]}'\nduration 1\n`;
 
 // Check if it's the last image, and if so, add it again
 if (i === imageStreams.length - 1) {
 fileContent += `file '${imageStreams[i]}'\nduration 1\n`;
 }
 }
 
 // Define the file path for the file list
 const fileListPath = "/tmp/file_list.txt";
 
 // Write the file list content to the file
 await fs.writeFile(fileListPath, fileContent);
 
 try {
 await fs.writeFile(fileListPath, fileContent);
 } catch (error) {
 console.error("Error writing file list:", error);
 throw error;
 }
 
 // Create a complex filter to add zooms and pans
 // Simplified filter example
 let complexFilter = [
 // Example of a fade transition
 {
 filter: 'fade',
 options: { type: 'in', start_time: 0, duration: 1 },
 inputs: '0:v', // first video stream
 outputs: 'fade0'
 },
 // Example of dynamic zoompan
 {
 filter: 'zoompan',
 options: {
 z: 'zoom+0.002',
 d: 120, // duration for this image
 x: 'if(gte(zoom,1.2),x,x+1)', // dynamic x position
 y: 'if(gte(zoom,1.2),y,y+1)' // dynamic y position
 },
 inputs: 'fade0',
 outputs: 'zoom0'
 }
 // Continue adding filters for each image
 ];

 let filterString = complexFilter
 .map(
 (f) =>
 `${f.filter}=${Object.entries(f.options)
 .map(([key, value]) => `${key}=${value}`)
 .join(":")}`
 )
 .join(",");
 
 let filterString = complexFilter
 .map(
 (f) =>
 `${f.filter}=${Object.entries(f.options)
 .map(([key, value]) => `${key}=${value}`)
 .join(":")}`
 )
 .join(",");
 
 console.log("Filter String:", filterString);
 
 return new Promise((resolve, reject) => {
 ffmpeg()
 .input(fileListPath)
 .complexFilter(filterString)
 .inputOptions(["-f concat", "-safe 0"])
 .outputOptions("-c copy")
 .outputOptions("-c:v libx264")
 .outputOptions("-pix_fmt yuv420p")
 .outputOptions("-r 30")
 .on("end", () => {
 resolve();
 })
 .on("error", (err) => {
 console.error("Error during video concatenation:", err);
 reject(err);
 })
 .saveToFile("/tmp/output.mp4");
 });
 }



Filter String Console Log :


Filter String: fade=type=in:start_time=0:duration=1,zoompan=z=zoom+0.002:d=120:x=if(gte(zoom,1.2),x,x+1):y=if(gte(zoom,1.2),y,y+1)



Questions :


- 

- What is the correct syntax for implementing complex filters like zoompan and fade in ffmpeg when used in a Node.js environment ?
- How do I ensure the filters are applied correctly to each image in the sequence ?
- Is there a better way to dynamically generate these filters based on the number of images or their content ?








Any insights or examples of correctly implementing this would be greatly appreciated !


-
How To fix "PHP Fatal error : Class 'ffmpeg_movie' not found" Error in PHP
19 janvier 2019, par Ajay KatariyaI have installed FFMPEG in my server for video conversions into different sizes of videos within my WordPress site running on PHP 5.6/Linux. Previously all things were working fine but today suddenly I got one error like :
"PHP Fatal error : Class ’ffmpeg_movie’ not found".
PHP Warning : PHP Startup : Unable to load dynamic library ’/opt/cpanel/ea-php56/root/usr/lib64/php/modules/ffmpeg.so’ - /opt/cpanel/ea-php56/root/usr/lib64/php/modules/ffmpeg.so : cannot open shared object file : No such file or directory in Unknown on line 0
I have searched solution for this error, so I got one solution like include autoload.php file. Which I have already included.
So can anyone help me to solve out this problem ?
-
Cleaning AVFrame properly
12 septembre 2022, par VencatI'm creating AVFrame object using av_frame_alloc() function and clearing it using av_frame_free(&frame) which internally calls av_frame_unref(), but it's not cleaning the memory properly. Heap size of my app grows exponentially in run time.



Not working :



AVFrame* frame = av_frame_alloc();
av_frame_free(&frame);




Working :



AVFrame* frame = av_frame_alloc();
av_free(frame->data[0]);




As far as I know, av_frame_free() calls av_freep() which calls av_free() to free the dynamic memory. Memory gets cleaned, If I use av_free(frame->data[0]) directly instead of av_frame_free(&frame)