Recherche avancée

Médias (0)

Mot : - Tags -/protocoles

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

Autres articles (69)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (6654)

  • How to configure proc_open "pipes" for ffmpeg stdin/stderr on Windows ?

    10 septembre 2018, par GDP

    Firstly, I’ve spent the week googling and trying variations of dozens and dozens of answers for Unix, but it’s been a complete bust, I need an answer for Windows, so this is not a duplicate question of the Unix equivalents.

    We’re trying to create a scheduled task that will process a queue of tasks in PHP, and maintain an array of up to 10 ffmpeg instances at a time. I’ve tried exec, shell_exec and proc_open , coupled with/without start /B without any "complete" luck.
    I’m also quite certain that it has to do with setting up the descriptorspec and pipes (which I’m completely unfamiliar with), and here’s why :

    Per https://trac.ffmpeg.org/wiki/PHP,

    The part that says ">/dev/null" will redirect the standard OUTPUT
    (stdout) of the ffmpeg instance to /dev/null (effectively ignoring the
    output) and "2>/dev/null" will redirect the standard ERROR (stderr) to
    /dev/null (effectively ignoring any error log messages). These two can
    be combined into a shorter representation : ">/dev/null 2>&1". If you
    like, you can ?read more about I/O Redirection.

    An important note should be mentioned here. The ffmpeg command-line
    tool uses stderr for output of error log messages and stdout is
    reserved for possible use of pipes (to redirect the output media
    stream generated from ffmpeg to some other command line tool). That
    being said, if you run your ffmpeg in the background, you’ll most
    probably want to redirect the stderr to a log file, to be able to
    check it later.

    One more thing to take care about is the standard INPUT (stdin).
    Command-line ffmpeg tool is designed as an interactive utility that
    accepts user’s input (usually from keyboard) and reports the error log
    on the user’s current screen/terminal. When we run ffmpeg in the
    background, we want to tell ffmpeg that no input should be accepted
    (nor waited for) from the stdin. We can tell this to ffmpeg, using I/O
    redirection again "

    echo "Starting ffmpeg...\n\n";
    echo shell_exec("ffmpeg -y -i input.avi output.avi null >/dev/null 2>/var/log/ffmpeg.log &");
    echo "Done.\n";

    This example actually uses shell_exec, though we want to use proc_open so that we can use a loop to check if the process has completed or not.

    Here’s a basic sample loop of what I’ve tried. The problem in executing this is that the actual ffmpeg processing completes, but the process is hung "waiting for something". When I use debugging, and step out of the loop and terminate the process after a few minutes, the ffmpeg output is written and the script carries on. (From the command line, ffmpeg takes less than a minute to complete)

    $descriptorspec = array(
       array('pipe', 'r'),
       array('pipe', 'w'),
       array('pipe', 'w'),
    );
    $pipes = null;
    $cwd = null;
    $env = null;
    $process = proc_open('start /B ffmpeg.exe -i input.mov output.mp4 -nostdin', $descriptorspec, $pipes, $cwd, $env);
    $status = proc_get_status($process);
    while($status['running']) {
       sleep (60);
       $status = proc_get_status($process);
    }
    proc_terminate($process);

    Also, as documented at ffmpeg Main-options :

    Enable interaction on standard input. On by default unless standard
    input is used as an input. To explicitly disable interaction you need
    to specify -nostdin.

    The -nostdin option seems to indicate that it addresses my problem, but it has no apparent affect. In all solutions for Unix that I’ve found, it appears to still require some form of this this unix added : null or 2>&1.

    So, with that somewhat exhaustive prologue, can someone explain how to properly configure the proc_open function to satisfy how ffmpeg.exe interacts with I/O ? If there is a better or more appropriate approach, I’m happy to do that, but the important thing is to be able to loop thru an array of processes to check if they’re complete, so that other faster processes can complete in the meantime.

    UPDATE
    After exhaustive R&D, it seems that the I/O is not the issue in making this happen (the -nostdin option seems to work as advertised). The premise of my design was to use proc_get_status() to determine when ffmpeg was finished. The flaw in that approach is that apparently that does NOT return the actual PID of the ffmpeg process...it returns the parent PID. So, when proc_get_status() returned that the video conversion was complete, it was in fact still running, not hung. This was further complicated by testing on larger video files. The larger the video, the longer the "residual" time was that it took to actually finish — the I/O wasn’t the issue - watching the Parent PID instead of the child PID was the problem. So, without getting into much lower level system internals with Windows, this doesn’t appear to be possible with PHP directly. I’ve decided to abandon this approach, but hopefully this discovery will save someone else some time and trouble.

  • How do i get ffprobe to parse 'TAG : timecode' into ffmpeg 'drawtext' command ? (Bash Terminal)

    4 juin 2019, par Myles

    I have a .mov file that contains original source timecode metadata but i can’t figure out a way to get ffmpeg to burn the original timecode into the picture.

    If i open the original file in QuickTime Player we can see it displays the true timecode on the far left :
    Original TC

    I can also see that ffprobe is able to see the metadata when i run the following :

    Command :

    ffprobe -i test.mov -show_streams

    Abbreviated Result :

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mov':
     Metadata:
       major_brand     : qt  
       minor_version   : 537199360
       compatible_brands: qt  
       creation_time   : 2018-11-05T14:20:51.000000Z
       timecode        : 09:59:53:00
     Duration: 00:16:37.64, start: 0.000000, bitrate: 1680 kb/s

    So i can see that ffprobe is able to determine the start timecode of the file in its metadata results. The question is how to i pass that information into an ffmpeg command so that the timecode seen by ffprobe is what gets used when i convert the file for timecode burn-in ?

    An example of a standard burnt in timecode command would be this :

    ffmpeg -i test.mov -vcodec libx264 -cmp 22 -vf
    "drawtext=fontfile=DroidSansMono.ttf : timecode=’09:59:53:00’ : r=25 :
    x=(w-tw)/2 : y=h-(2*lh) : fontcolor=white : box=1 : boxcolor=0x00000099"
    -y test_bitc.mov

    The only problem there though is that i’ve had to manually put the timecode in myself. I want the command to use the existing timecode metadata as the timecode input value so the same command can be used on multiple files.

    Does anyone know how to do this ?

  • How to setup a virtual mic and pipe audio to it from node.js

    28 octobre 2018, par Niellles

    Summary of what I am trying to achieve :

    I’m currently doing some work on a Discord bot. I’m trying to join a voice channel, which is the easy part, and then use the combined audio of the speakers in that voice channel as input for a webpage in a web browser. It doesn’t really matter which browser it is as long as it can be controlled with Selenium.


    What I’ve tried/looked into so far

    My bot so far is written up in Python using the discord.py API wrapper. Unfortunately listening to, as opposed to putting in, audio hasn’t been exactly implemented great − let alone documented − with discord.py. This made me decide to switch to node.js (i.e. discord.js) for the voice channel stuff of my bot.

    After switching to discord.js it was pretty easy to determine who’s talking and create an audio stream (PCM stream) for that user. For the next part I though I’d just pipe the audio stream to a virtual microphone and select that as the audio input on the browser. You can even use FFMPEG from within node.js 1, to get something that looks like this :

    const Discord = require("discord.js");
    const client = new Discord.Client();

    client.on('ready', () => {
     voiceChannel = client.channels.get('SOME_CHANNEL_ID');
     voiceChannel.join()
       .then(conn => {
         console.log('Connected')

         const receiver = conn.createReceiver();

         conn.on('speaking', (user, speaking) => {
           if (speaking) {
             const audioStream = receiver.createPCMStream(user);

             ffmpeg(stream)
                 .inputFormat('s32le')
                 .audioFrequency(16000)
                 .audioChannels(1)
                 .audioCodec('pcm_s16le')
                 .format('s16le')
                 .pipe(someVirtualMic);          
           }
         });
       })
       .catch(console.log);
     });

    client.login('SOME_TOKEN');

    This last part, creating and streaming to a virtual microphone, has proven to be rather complicated. I’ve read a ton of SO posts and documentation on both The Advanced Linux Sound Architecture (ALSA) and the JACK Audio Connection Kit, but I simply can’t figure out how to setup a virtual microphone that will show up as a mic in my browser, or how to pipe audio to it.

    Any help or pointers to a solution would be greatly appreciated !


    Addendum

    For the past couple of days I’ve kept on looking into to this issue. I’ve now learned about ALSA loopback devices and feel that the solution must be there.

    I’ve pretty much followed a post that talks about loopback devices and aims to achieve the following :

    Simply imagine that you have a physical link between one OUT and one
    IN of the same device.

    I’ve set up the devices as described in the post and now two new audio devices show up when selecting a microphone in Firefox. I’d expect one, but I that may be because I don’t entirely understand the loopback devices (yet).

    The loop back devices are created and I think that they’re linked (if I understood the aforementioned article correctly). Assuming that’s the case the only problem I have to tackle is streaming the audio via FFMPEG from within node.js.

    Audio devices