Recherche avancée

Médias (0)

Mot : - Tags -/performance

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (77)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (8804)

  • Pass individual frames as BGRA byte array and set the timestamps via pipe to FFmpeg

    30 juillet 2023, par Nicke Manarin

    I have a set of images (as BGRA byte[]) with their respective timestamps in milliseconds and I want to pass it to FFmpeg to build an animation.

    


    I'm using FFmpeg v6 right now and in this example I'm expecting a GIF as output, but I'm going to export to multiple formats later.

    


    var arguments = "-vsync passthrough  
-f rawvideo 
-pix_fmt bgra 
-video_size {width}x{height} 
-i -  
-loop 0 
-lavfi palettegen=stats_mode=diff[pal],[0:v][pal]paletteuse=new=1:dither=sierra2_4a:diff_mode=rectangle 
-f gif 
-y \"C:\Users\User\Desktop\test.gif\"";

var process = new Process
{
    StartInfo = new ProcessStartInfo
    {
        FileName = "./ffmpeg.exe",
        Arguments = arguments.Replace("{width}", width.ToString()).Replace("{height}", height.ToString()),
        RedirectStandardInput = true,
        RedirectStandardOutput = true,
        UseShellExecute = false,
        CreateNoWindow = true
    }
};

_process.Start();



    


    Then on my render loop, I'm trying to send the frames and their timestamps one by one.

    


    public void EncodeFrame(IntPtr bufferAddress, int bufferStride, int width, int height, int index, long timestamp, int delay)
{
    var frameSize = height * bufferStride;
    var frameBytes = new byte[frameSize];
    System.Runtime.InteropServices.Marshal.Copy(bufferAddress, frameBytes, 0, frameSize);

    _process.StandardInput.BaseStream.Write(frameBytes, 0, frameSize);
    _process.StandardInput.BaseStream.Write(_delimiter, 0, _delimiter.Length);
    _process.StandardInput.BaseStream.Write(BitConverter.GetBytes(timestamp), 0, sizeof(long));
}


    


    The issue is that I'm getting an IOException (The pipe has been ended), so probably I'm not sending the frames correctly (not sending the delimiter and timestamp doesn't help).

    


    Is this even possible ?

    


  • NodeJS SpeechRecorder pipe to child process ffmpeg encoder - dest.on is not a function

    10 décembre 2022, par Matthew Swaringen

    Trying to make a utility to help me with recording words for something. Unfortunately getting stuck on the basics.

    


    The error I get when I hit s key and talk enough to fill the buffer is

    


    terminate called after throwing an instance of 'Napi::Error'
  what():  dest.on is not a function
[1]    2298218 IOT instruction (core dumped)  node record.js


    


    Code is below. I can write the wav file and then encode that but I'd rather not have to have an intermediate file unless there is no way around it, and I can't imagine that is the case.

    


    const { spawn } = require('child_process');
const { writeFileSync } = require('fs');
const readline = require('readline');
const { SpeechRecorder } = require('speech-recorder');
const { WaveFile } = require('wavefile');

let paused = true;

const ffmpeg = spawn('ffmpeg', [
 // '-f', 's16', // input format
  //'-sample_rate', '16000',
  '-i', '-', // input source
  '-c:a', 'libvorbis', // audio codec  
  'output.ogg', // output file  
  '-y'
]);

let buffer = [];
const recorder = new SpeechRecorder({
  onAudio: ({ audio, speech }) => {
    //if(speech) {

      for (let i = 0; i < audio.length; i++) {
        buffer.push(audio[i]);
      }

      if(buffer.length >= 16000 * 5) { 
        console.log('piping to ffmpeg for output');
        let wav = new WaveFile()
        wav.fromScratch(1,16000,"16",buffer);
        //writeFileSync('output.wav',wav.toBuffer());
        ffmpeg.stdin.pipe(buffer, {end: false});
      }
    //}
  }
});

// listen for keypress events
readline.emitKeypressEvents(process.stdin);
process.stdin.setRawMode(true);

process.stdin.on('keypress', (str, key) => {
  if (key.name === 's') {
    // pause or resume recording
    paused = !paused;
    if(paused) { recorder.stop(); } else { recorder.start(); }

   
  } else if (key.ctrl && key.name === 'c') {
    // exit program
    ffmpeg.kill('SIGINT');    
    process.exit();
  }
});


    


  • How to pipe a new command after ffmpeg background process completes ? (PHP)

    12 septembre 2013, par Mike Feng

    Ok this is my ffmpeg process :

    exec("/usr/local/bin/ffmpeg -y -i source.avi dest.mp4 >/dev/null 2>/dev/null &

    Now, I wish to execute a php file after the conversion is complete. Logically, this is what I have :

    exec("/usr/local/bin/ffmpeg -y -i source.avi dest.mp4 >/dev/null 2>/dev/null ; php proceed.php &

    This doesn't work though, since then PHP will hold up the process to wait till the ffmpeg conversion is complete. What I want is basically to call proceed.php after the conversion completes, both of which are done in the background.

    If anyone can provide the Windows server solution, that will be awesome too. Thank you in advanced !