Recherche avancée

Médias (0)

Mot : - Tags -/acrobat

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

Autres articles (77)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • 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" ;

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

Sur d’autres sites (5333)

  • How to successfully parse the output of FFMpeg in NodeJS

    22 mai 2017, par Danny SMc

    So I have seen a lot of topics on FFMPeg and it’s a great tool I learnt about today, but I have spent the day perfecting the command and now am a little stuck with the NodeJS part.

    In essence the command does the following : take input from a Mac OSX webcam, and then stream it to a web-socket. Now I looked at a lot of the NodeJS libraries but I couldn’t find one that did what I need ; or did not understand how to. Here is an example of the command that I am using :

    ffmpeg -f avfoundation -framerate 30 -video_size 640x480 -pix_fmt uyvy422 -i "0:1" -f mpegts -codec:v mpeg1video -s 640x480 -b:v 1000k -bf 0 http://localhost:8081/stream

    This does everything I need for the streaming side of things, but I wish to call it via NodeJS, and then be able to monitor the log, and parse the data that comes back for example :

    frame= 4852 fps= 30 q=6.8 size=   30506kB time=00:02:41.74 bitrate=1545.1kbits/s speed=   1x    \r

    and use it to get a JSON array back for me to output to a webpage.

    Now all I am doing is working on ways of actually parsing the data, and I have looked at lots of other answers for things like this, but I can’t seem to split/replace/regex it. I can’t get anything but a long string from it.

    Here is the code I am using (NodeJS) :

    var ffmpeg = require('child_process').spawn('/usr/local/Cellar/ffmpeg/3.3.1/bin/ffmpeg', ['-f', 'avfoundation', '-framerate', '30', '-video_size', '640x480', '-pix_fmt', 'uyvy422', '-i', '0:1', '-f', 'mpegts', '-codec:v', 'mpeg1video', '-s', '640x480', '-b:v', '1000k', '-bf', '0', 'http://localhost:8081/test']);

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

    ffmpeg.on('close', function (code) {
       console.log('ffmpeg exited with code ' + code);
    });

    ffmpeg.stderr.on('data', function (data) {
       // console.log('stderr: ' + data);
       var tData = data.toString('utf8');
       // var a = tData.split('[\\s\\xA0]+');
       var a = tData.split('\n');
       console.log(a);
    });

    ffmpeg.stdout.on('data', function (data) {
       var frame = new Buffer(data).toString('base64');
       // console.log(frame);
    });

    I have tried splitting with new lines, carridge return, spaces, tabs, but I just can’t seem to get a basic array of bits, that I can work with.

    Another thing to note, is you will notice the log comes back via stderr, I have seen this online and apparently it does it for a lot of people ? So I am not sure what the deal is with that ? but the code is is the sdterr callback.

    Any help is very appreciated as I am truly confused on what I am doing wrong.

    Thanks.

  • How to successfully parse the output of FFMpeg in NodeJS

    28 juillet 2022, par Dahknee

    So I have seen a lot of topics on FFMPeg and it's a great tool I learnt about today, but I have spent the day perfecting the command and now am a little stuck with the NodeJS part.

    



    In essence the command does the following : take input from a Mac OSX webcam, and then stream it to a web-socket. Now I looked at a lot of the NodeJS libraries but I couldn't find one that did what I need ; or did not understand how to. Here is an example of the command that I am using :

    



    ffmpeg -f avfoundation -framerate 30 -video_size 640x480 -pix_fmt uyvy422 -i "0:1" -f mpegts -codec:v mpeg1video -s 640x480 -b:v 1000k -bf 0 http://localhost:8081/stream


    



    This does everything I need for the streaming side of things, but I wish to call it via NodeJS, and then be able to monitor the log, and parse the data that comes back for example :

    



    frame= 4852 fps= 30 q=6.8 size=   30506kB time=00:02:41.74 bitrate=1545.1kbits/s speed=   1x    \r


    



    and use it to get a JSON array back for me to output to a webpage.

    



    Now all I am doing is working on ways of actually parsing the data, and I have looked at lots of other answers for things like this, but I can't seem to split/replace/regex it. I can't get anything but a long string from it.

    



    Here is the code I am using (NodeJS) :

    



    var ffmpeg = require('child_process').spawn('/usr/local/Cellar/ffmpeg/3.3.1/bin/ffmpeg', ['-f', 'avfoundation', '-framerate', '30', '-video_size', '640x480', '-pix_fmt', 'uyvy422', '-i', '0:1', '-f', 'mpegts', '-codec:v', 'mpeg1video', '-s', '640x480', '-b:v', '1000k', '-bf', '0', 'http://localhost:8081/test']);

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

ffmpeg.on('close', function (code) {
    console.log('ffmpeg exited with code ' + code);
});

ffmpeg.stderr.on('data', function (data) {
    // console.log('stderr: ' + data);
    var tData = data.toString('utf8');
    // var a = tData.split('[\\s\\xA0]+');
    var a = tData.split('\n');
    console.log(a);
});

ffmpeg.stdout.on('data', function (data) {
    var frame = new Buffer(data).toString('base64');
    // console.log(frame);
});


    



    I have tried splitting with new lines, carridge return, spaces, tabs, but I just can't seem to get a basic array of bits, that I can work with.

    



    Another thing to note, is you will notice the log comes back via stderr, I have seen this online and apparently it does it for a lot of people ? So I am not sure what the deal is with that ? but the code is is the sdterr callback.

    



    Any help is very appreciated as I am truly confused on what I am doing wrong.

    



    Thanks.

    


  • Maintain PTS on .ts file resize

    5 février 2020, par PRMan

    Let’s say I have a .ts file from an existing HLS and I simply want to resize it. For example, to create a second lower-resolution stream that can be switched when bandwidth is poor.

    ffmpeg -i video1080_1.ts -vf "scale=1280:720" video720_1.ts

    How do I ensure that video720_1.ts starts at the exact same PTS as video1080_1.ts ? I haven’t changed the rate, so it will play fine as long as it starts at the exact same PTS.

    I have tried a lot of things (vsync, copyts, etc.) but none of them give me the exact same number.

    Also, I tried adding -copyts -vsync 2 -muxdelay 0 -muxpreload 0 and that got it closer, but still off by 1100 (4422778 vs 4423680).