Recherche avancée

Médias (91)

Autres articles (35)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    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 (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (5089)

  • Killing a FFmpeg process triggered by spawn in NodeJs

    15 janvier 2023, par user7364588

    I am facing an issue wanting to kill a FFmpeg process triggered by spawn from the child_process native NodeJs package.

    


    Here is the script i use to trigger the ffmpeg process.

    


    Assume that the conversion takes a long time, like about 2 hours.

    


    /**
 * Execute a command line cmd
 * with the arguments in options given as an array of string
 * processStore is an array that will store the process during its execution
 * and remove it at the end of the command or when error occurs
 */
function execCommandLine({
   cmd,
   options = [],
   processStore = [],
}) {
  return new Promise((resolve, reject) => {
    const spwaned_process = childProcess.spawn(cmd, options);

    // Append the process to a buffer to keep track on it
    processStore.push(spwaned_process);

    // Do nothing about stdout
    spwaned_process.stdout.on('data', () => true);

    // Do nothing about stderr
    spwaned_process.stderr.on('data', () => true);

    spwaned_process.on('close', () => {
      const index = processStore.indexOf(spwaned_process);

      if (index !== -1) {
        processStore.splice(index, 1);
      }

      resolve();
    });

    spwaned_process.on('error', () => {
      const index = processStore.indexOf(spwaned_process);

      if (index !== -1) {
        processStore.splice(index, 1);
      }

      reject();
    });
  });
}

const processStore = [];

await execCommandLine({
  cmd: 'ffmpeg',

  options: [
    '-i',
    '/path/to/input',
    '-c:v',
    'libvpx-vp9',
    '-strict',
    '-2',
    '-crf',
    '30',
    '-b:v',
    '0',
    '-vf',
    'scale=1920:1080',
    '/path/to/output',
  ],

  processStore,
});


    


    During the conversion, the following code is called to kill all process into the processStore, including the FFmpeg process that is triggered.

    


    // getProcessStore() returns the const processStore array of the above script
getProcessStore().forEach(x => x.kill());

process.exit();


    


    After the program exit, when i run ps -ef | grep ffmpeg, there is still some FFmpeg process running.

    


    


    root 198 1 0 09:26 ? 00:00:00 ffmpeg -i /path/to/input -ss 00:01:47 -vframes 1 /path/to/output

    


    root 217 1 0 09:26 ? 00:00:00 ps -ef

    


    


    Do you have an idea about the way to kill a ffmpeg process properly ?

    


  • System.Diagnostics.Process calling FFMPEG fails with international character

    1er septembre 2013, par Petter Brodin

    I'm using System.Diagnostics.Process to launch FFMPEG, and it works as intended on paths that only contain non-special characters.

    string strParam = "C:\myFolder\foo.png";

    Process ffmpeg = new Process();

    ffmpeg.StartInfo.UseShellExecute = false;
    ffmpeg.StartInfo.RedirectStandardOutput = true;

    ffmpeg.StartInfo.FileName = Path_FFMPEG;
    ffmpeg.StartInfo.Arguments = strParam;

    ffmpeg.Start();

    ffmpeg.WaitForExit();

    The above example works perfectly, but if I use "c :\myFolder\føø.png" I get the following error message :

    Could find no file with path 'C.\myFolder\f├©├©.png'

    This looks like some kind of encoding error, but that's where my ideas stop.

  • How can I read process getInputstream ?

    25 août 2015, par NeverJr

    I use process builder and process ( with the ffmpeg), and I have to redirect the ffmpeg output to the java input. I wrote this short code, but the inputstream is empty anyways...

    public class Ffmpegtest {
    public static void main(String[] args) {
       String[] cmd = {"ffmpeg ","-i ","output2.mp4 ","-f ","mp4 ", "-"};
       InputStream stream;
       try {
           stream = new ProcessBuilder(Arrays.asList(cmd)).start().getInputStream();
           System.out.println(stream.available()); // still 0
           byte[] kilo = new byte[1024];
           int i = stream.read(kilo,0,1024);
           while(i != -1){
               System.out.println("read "+1024);
               i = stream.read(kilo,0,1024);
           }

       } catch (IOException ex) {
           System.out.println(ex.getMessage());
       }
    }