Recherche avancée

Médias (91)

Autres articles (25)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • 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 (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (3284)

  • FFMPEG with node , using child_process , suppressing un-necessary stderr

    16 mai 2018, par drexdelta

    I am trying to resize the video using (FFMPEG + node + child_process). and my code looks something like this , You can read comments and understand it. it’s self-explanatory for people who are familiar with node and ffmpeg. when I run this code, I keep getting error in
    newThread.stderr.on() function
    . which is not expected behaviour. After running this process I am getting expected video translation, which is expected behaviour.

    const spawn = require('child_process').spawn;

    // resize and compress video promise  = prom2
    const resizeVideoWith_FFMPEG_Promise = (sourceFile , sinkFile)=>{
       return new Promise ( (resolve , reject)=>{

           // actual command for ffmpeg is something like this , "ffmpeg -i oldVideo -vf scale=-2:480 newVideo"
           // New thread
           const newThread = spawn('ffmpeg' , ['-i','vid1.mp4','-vf','scale=-2:480','vid2.mp4']);

           // on close signal
           newThread.on('close',(data)=>{
               console.log(' thread closed for video ' , sourceFile);
               return resolve();
           });
           // on stderr signals
           newThread.stderr.on('data',(data)=>{
               console.log(' got error in the thread of video ' , sourceFile);
               fullError = data.toString();
               console.log(fullError);
               // return resolve();
               // return reject();
           });
           newThread.stdout.on('data',(data)=>{
               // just ignore all stadanrd outputs
           });
       });
    }

    resizeVideoWith_FFMPEG_Promise('vid1.mp4' , 'vid2.mp4' ).then((res)=>{
       console.log(res);
    });

    For the sake of simplicity I am resolving the promise everytime, even if I get stderr. And at end of running this code I get output something like this ,

    got error in the thread of video  vid1.mp4
    frame= 3277 fps=116 q=28.0 size=   12288kB time=00:02:16.64 bitrate= 736.7kbits/s speed=4.82x    
    got error in the thread of video  vid1.mp4
    frame= 3313 fps=115 q=28.0 size=   12544kB time=00:02:18.15 bitrate= 743.8kbits/s speed=4.79x    
    got error in the thread of video  vid1.mp4
    frame= 3362 fps=115 q=28.0 size=   12800kB time=00:02:20.17 bitrate= 748.0kbits/s speed=4.78x    
    got error in the thread of video  vid1.mp4
    frame= 3408 fps=114 q=28.0 size=   12800kB time=00:02:22.12 bitrate= 737.8kbits/s speed=4.77x    
    got error in the thread of video  vid1.mp4
    frame= 3465 fps=114 q=28.0 size=   13056kB time=00:02:24.49 bitrate= 740.2kbits/s speed=4.76x    
    got error in the thread of video  vid1.mp4
    frame= 3522 fps=114 q=28.0 size=   13312kB time=00:02:26.86 bitrate= 742.5kbits/s speed=4.76x    
    got error in the thread of video  vid1.mp4
    frame= 3580 fps=114 q=28.0 size=   13568kB time=00:02:29.28 bitrate= 744.6kbits/s speed=4.76x

    Now, my problem is if I always keep resolving errors, then I will never be able to catch when the video ACTUALLY FAILED TO RESCALE. so, how can I ignore these type of un-necessary stderr and catch only useful errors ?

    Pls someone help.

    I have been through lot of related links like this, but none of these actually solve my problem(even if they did, I couldn’t figure out)

    Error while using h264_cuvid decoder with ffmpeg

    Using module "child_process" without Webpack

    Suppressing STDOUT with node child_process

    Small hint will be very helpful. Thank you .

    BTW , SO moderators , My actual title was like

    stderr problem while using FFMPEG with node via child_process module

    But it didn’t allow me to use such title. so, I am using some dummy title.

  • Ffmpeg command in nodejs

    2 mars 2017, par sharad chauhan

    I want to use ffmpeg commands in my nodejs application. I dont want to using any npm packages like fluent-ffmpeg.
    Till now I have done this :

    var ffmpeg = spawn('ffmpeg', ['-i',fileName+'.wav' ,fileName+'.amr','-acodec libopencore_amrnb', '-ab 12200k', '-ac 1', '-ar 8000']);
               // input_file.pipe(ffmpeg.stdin);
               // ffmpeg.stdout.pipe(output_stream);

               ffmpeg.stderr.on('data', function (data) {
                   console.log(data.toString());
               });

               ffmpeg.stderr.on('end', function () {
                   console.log('file has been converted succesfully');
               });

               ffmpeg.stderr.on('exit', function () {
                   console.log('child process exited');
               });

               ffmpeg.stderr.on('close', function() {
                   console.log('...closing time! bye');
               });

    In output it gives error like this :

    Unrecognized option 'acodec libopencore_amrnb'

    I have installed all binaries required. Just need to know what command i have to pass in spawn() like :

    var ffmpeg = spawn('ffmpeg', ['-i',fileName+'.wav' ,fileName+'.amr','-acodec libopencore_amrnb', '-ab 12200k', '-ac 1', '-ar 8000']);

    I have tried the command on terminal and works perfectly. All i want is the correct way to pass command (options) in spawn(). Any help would be appreciated.

  • Which ffmpeg command sequence can generate the first frame of the video [Need thumbnails for Node.js app]

    6 janvier 2021, par Jedavard

    I'm trying to make thumbnails for videos, but the problem is I'm not able to write some right ffmpeg commands for getting the very first frame. This is for a Node.js AWS Lambda function.

    



    I tried this, but it's not working for me.

    



    -vf "select=eq(n\,0)"


    



    Tried all from here How to extract the 1st frame and restore as an image with ffmpeg ?.

    



    Here's my command line, I copied it and honestly I have no idea about this commands.

    



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


  ffmpeg.stdout.pipe(tmpFile);

  ffmpeg.on('close', function(code) {
    tmpFile.end();
    resolve();
  });

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


    



    (I use this https://johnvansickle.com/ffmpeg/ release 4.2.3 version on a Node child process.)