Recherche avancée

Médias (1)

Mot : - Tags -/biographie

Autres articles (111)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (8898)

  • AWS Lambda for generate thumbnail save empty file

    30 octobre 2019, par Milousel

    I need to create aws lambda for creating thumbnail from video by using ffmpeg, which is saved on S3 and this thumbnail saved into S3 too.

    I downloaded ffmpeg from https://johnvansickle.com/ffmpeg/ page, set ffmpeg into nodejs file and send it into .zip. From this zip file I created ffmpeg layer. After that I connect my lambda with this ffmpeg layer. When I test it I receive Success response, but I save empty file (0 B size) into S3.

    const AWS = require("aws-sdk");
    const { spawn } = require("child_process");
    const { createReadStream, createWriteStream } = require("fs");

    const s3 = new AWS.S3();
    const ffmpegPath = "/opt/nodejs/ffmpeg";
    const allowedTypes = ["mov", "mpg", "mpeg", "mp4", "wmv", "avi", "webm"];
    const width = process.env.WIDTH;
    const height = process.env.HEIGHT;

    module.exports.handler = async (event, context) => {
     const srcKey = "test/0255f240-efef-11e9-862e-3949600f0ec9.mp4";
     const bucket = "video.devel.abc.com";
     const target = s3.getSignedUrl("getObject", {
       Bucket: bucket,
       Key: srcKey,
       Expires: 1000
     });
     let fileType = "mp4";
     console.log("srcKey: " + srcKey);
     console.log("bucket: " + bucket);
     console.log("target: " + target);
     if (!fileType) {
       throw new Error(`invalid file type found for key: ${srcKey}`);
     }

     if (allowedTypes.indexOf(fileType) === -1) {
       throw new Error(`filetype: ${fileType} is not an allowed type`);
     }

     function createImage(seek) {
       return new Promise((resolve, reject) => {
         let tmpFile = createWriteStream(`/tmp/screenshot.jpg`);
         const ffmpeg = spawn(ffmpegPath, [
           "-ss",
           seek,
           "-i",
           target,
           "-vf",
           `thumbnail,scale=${width}:${height}`,
           "-qscale:v",
           "2",
           "-frames:v",
           "1",
           "-f",
           "image2",
           "-c:v",
           "mjpeg",
           "pipe:1"
         ]);

         ffmpeg.stdout.pipe(tmpFile);
         ffmpeg.on("close", function(code) {
             console.log('code: ' + code);
           tmpFile.end();
           resolve();
         });

         ffmpeg.on("error", function(err) {
           console.log(err);
           reject();
         });
       });
     }

     function uploadToS3() {
       return new Promise((resolve, reject) => {
         let tmpFile = createReadStream(`/tmp/screenshot.jpg`);
         let dstKey = srcKey
           .replace(/\.\w+$/, `.jpg`)
           .replace("test/", "test/shots/");
         //const screensFile = "test/shots/";
         console.log("dstKey: " + dstKey);
         var params = {
           Bucket: bucket,
           Key: dstKey,
           Body: tmpFile,
           ContentType: `image/jpg`
         };

         s3.upload(params, function(err, data) {
           if (err) {
             console.log(err);
             reject();
           }
           console.log(`successful upload to ${bucket}/${dstKey}`);
           resolve();
         });
       });
     }

     await createImage(1);
     await uploadToS3();
     return console.log(`processed ${bucket}/${srcKey} successfully`);
    };

    When I test it I receive these logs :

  • srcKey : test/0255f240-efef-11e9-862e-3949600f0ec9.mp4
  • bucket : video.devel.abc.com
  • INFO processed video.devel.abc.com successfully
  • code : 1
  • bucket : video.devel.abc.com
  • dstKey : test/shots/0255f240-efef-11e9-862e-3949600f0ec9.jpg
  • successful upload to video.devel.abc.com/test/shots/0255f240-efef-11e9-862e-3949600f0ec9.jpg
  • processed video.devel.abc.com/test/0255f240-efef-11e9-862e-3949600f0ec9.mp4 successfully
  • So file is really created, but it is empty (size is 0 B), which is not ideal.

  • Invalid data when processing input ogg in ffmpeg

    23 mars 2023, par Albert Gomáriz Sancha

    I am getting an ogg file and I am trying to convert it to a mopo3 file using fluent-ffmpef node library. When trying to convert it, then this error is shown :** An error occurred : Error : ffmpeg exited with code 1 : pipe:0 : Invalid data found when processing input**.

    


    Can someone help me please ?

    


    This is my code :

    


     const input = createReadStream(getPath("temp.ogg"));
  // console.log(input);
  // ffmpeg.setFfmpegPath(ffmpegPath);

  // const output = createWriteStream(getPath("temp.mp3"));
  // spawn(`ffmpeg -i ${getPath("temp.ogg")} ${getPath("temp.mp3")}`);
  ffmpeg(input)
    .setFfmpegPath(ffmpegPath)
    .toFormat("wav")
    .on("data", (data) => {})
    .on("error", (err) => {
      console.log("An error occurred: " + err);
    })
    .on("progress", (progress) => {
      // console.log(JSON.stringify(progress));
      console.log("Processing: " + progress.targetSize + " KB converted");
    })
    .on("end", () => {
      console.log("Processing finished !");
    })
    .save(getPath("temp.mp3")); //path where you want to save your file


    


  • How to decode the video stream of an mp4 file and save the decoded images to local directory in NodeJs

    8 août 2018, par Rohit Verma

    How to decode the video stream of an mp4 file and save the decoded images to local directory in NodeJs. I have tried ffmpeg and fluent ffmpeg but didn’t get clear idea how to use,As I was getting error while using fluent ffmpeg

    Code snippet :

       const ffmpeg = require('fluent-ffmpeg')
       const probe = require('ffmpeg-probe')

    const info = await probe('input.mp4')

    and in case of ffmpeg I have tried this,

    var ffmpeg = require('ffmpeg');

    try {
       var process = new ffmpeg("VID_20160805_121411556.mp4");
       process.then(function (video) {
           // Callback mode
           video.fnExtractFrameToJPG('C:/Users/PcName/Documents', {
               frame_rate : 1,
               number : 5,
               file_name : 'my_frame_%t_%s'
           }, function (error, files) {
               if (!error)
                   console.log('Frames: ' + files);
           });
       }, function (err) {
           console.log('Error: ' + err);
       });
    } catch (e) {
       console.log(e.code);
       console.log(e.msg);
    }

    Nothing is working and I didn’t get any clue how to do so.

  • Boussole SPIP

    SPIP.net-La documentation officielle et téléchargement de (...) SPIP Code-La documentation du code de SPIP Programmer SPIP-La documentation pour développer avec (...) Traduire SPIP-Espace de traduction de SPIP et de ses (...) Plugins SPIP-L'annuaire des plugins SPIP SPIP-Contrib-L'espace des contributions à SPIP Forge SPIP-L'espace de développement de SPIP et de ses (...) Discuter sur SPIP-Les nouveaux forums de la communauté (...) SPIP Party-L'agenda des apéros et autres rencontres (...) Médias SPIP-La médiathèque de SPIP SPIP Syntaxe-Tester l'édition de texte dans SPIP