Recherche avancée

Médias (91)

Autres articles (32)

  • Création définitive du canal

    12 mars 2010, par

    Lorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
    A la validation, vous recevez un email vous invitant donc à créer votre canal.
    Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
    A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)

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

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

Sur d’autres sites (4403)

  • How can I manually pass a SoundCloud track duration to HTML5 audio ?

    30 janvier 2016, par thebaer

    I’m currently using a stripped-down version of Canvas.fm to convert SoundCloud mp3 streams into ogg streams using Node and ffmpeg, to support the audio element in ogg-playing browsers like Firefox. My problem is : while the duration is correctly set for SoundCloud’s mp3 streams, the ogg stream gives an indefinite duration in the player ; I want the actual duration to show up.

    I noticed when requesting a SoundCloud mp3 stream, I get a canceled request, a pending one, and then a 206 Partial Content response. My Node app does similar redirects, without as many headers, since I’m sending them myself.

    Should I be trying to calculate/forge the Content-Length or Content-Range headers ? Or does HTML5 audio get the duration from mp3 metadata/ID3 information ? If I can get the duration from SoundCloud’s API (which I can), how can I pass this to the client in my ogg stream ?

  • How can I manually pass a SoundCloud track duration to HTML5 audio ?

    19 juin 2013, par thebaer

    I'm currently using a stripped-down version of Canvas.fm to convert SoundCloud mp3 streams into ogg streams using Node and ffmpeg, to support the audio element in ogg-playing browsers like Firefox. My problem is : while the duration is correctly set for SoundCloud's mp3 streams, the ogg stream gives an indefinite duration in the player ; I want the actual duration to show up.

    I noticed when requesting a SoundCloud mp3 stream, I get a canceled request, a pending one, and then a 206 Partial Content response. My Node app does similar redirects, without as many headers, since I'm sending them myself.

    Should I be trying to calculate/forge the Content-Length or Content-Range headers ? Or does HTML5 audio get the duration from mp3 metadata/ID3 information ? If I can get the duration from SoundCloud's API (which I can), how can I pass this to the client in my ogg stream ?

  • How to pipe rgba data using Node.js to ffmpeg ?

    7 juillet 2015, par Swoth

    Context
    I am developing a small programm that is supposed to render a video, as fast as possible, based on frames captured from a canvas. The animation is rendered to a headless canvas implementation using Rekapi (JavaScript animation framework). The headless canvas is a Node.js module called node-canvas by Automattic. The animation frames are rendered one after another, after each rendering the frame is retrieved using canvas.getImageData().data (Uint8ClampedArray - rgba, faster than canvas.toDataUrl) and put into an array. Every frame is supposed to be send to ffmpeg to create a video.

    Rekapi -> canvas -> getImageData -> array -> ffmpeg

    Problem
    Everything except the transfer of stored rgba-array-data to ffmpeg works. I don’t seem to manage the transport using Node.js. How do I pass my frames to ffmpeg using Node.js and what did I do wrong ?

    What I do
    The code below renders and saves each frame as rgba data to an array. The renderScene-function renders each animation frame.

    console.log("Rendering getImageData, length:"+ videoLength);
    var dataArray = [];
    function imageDataCallback() {
       dataArray.push(context.getImageData(0, 0, 1280, 720).data);
    }
    rekapi.on('afterUpdate', imageDataCallback);

    var time = Date.now();
    renderScene(rekapi);
    console.log('Time used: ' + (Date.now() - time) + 'ms;');
    rekapi.off('afterUpdate', imageDataCallback);

    I already tried various possibilities to pipe that data to ffmpeg. In general I created a child process in Node.js executing ffmpeg :

    var spawn = require('child_process').spawn;    
    var child = spawn('ffmpeg', [
           '-pix_fmt', 'rgba',
           '-s','1280x720',
           '-r', 25,
           '-f', 'rawvideo',
           '-vcodec', 'rawvideo',
           '-i', '-', // read frames from stdin
           '-threads', 0, // use all cores
           'test.mpg']);

    I also tried using -i pipe:0, which is the same as -i -, just to be sure.
    After process creation i registered for various events to know what happens :

    child.on('error', function(error){
       console.log(error);
    });
    child.stdin.on('data', function (data) {
       console.log('data retrieved')
    });
    child.on('exit', function (code) {
       console.log('child exit with code:' + code)
    });

    Now I write my array data to the child’s stdin :

    for(var i = 0; i < dataArray.length; ++i){
       var buffer = new Buffer(dataArray[i]);
       child.stdin.write(buffer);
       console.log('wrote: ' + i);
    }

    I wrote 25 frames this way. The console displays the following :

    wrote: 24
    wrote: 25
    events.js:85
         throw er; // Unhandled 'error' event
               ^
    Error: read ECONNRESET
       at exports._errnoException (util.js:746:11)
       at Pipe.onread (net.js:559:26)

    ffmpeg generated a 0 byte test.mpg and as it seems no definded child-callback (like data) except error has been called. I am not 100% sure about the lifecycle but, as I understood, data should be called each time I write something.

    I am very new to Node.js, thus I might not understand the big picture of it’s child processes.

    Since my reputation is too low I am not allowed to post more than 2 links (first question) and I don’t feel comfortable using non-typed languages like JavaScript.