Recherche avancée

Médias (29)

Mot : - Tags -/Musique

Autres articles (104)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (6280)

  • 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

  • Using a pipe character | with child_process spawn

    19 avril 2020, par Titan

    I'm running nodejs on a raspberry pi and I want to run a child process to spawn a webcam stream.

    



    Outside of node my command is :

    



    raspivid -n -mm matrix -w 320 -h 240 -fps 18 -g 100 -t 0 -b 5000000 -o - | ffmpeg -y -f h264 -i - -c:v copy -map 0:0 -f flv -rtmp_buffer 100 -rtmp_live live "rtmp://example.com/big/test"


    



    With child_process I have to break each argument up

    



    var args = ["-n", "-mm", "matrix", "-w", "320", "-h", "240", "-fps", "18", "-g", "100", "-t", "0", "-b", "5000000", "-o", "-", "|", "ffmpeg", "-y", "-f", "h264", "-i", "-", "-c:v", "copy", "-map", "0:0", "-f", "flv", "-rtmp_buffer", "100", "-rtmp_live", "live", "rtmp://example.com/big/test"];


    



    camera.proc = child.spawn('raspivid', args);


    



    However it chokes on the | character :

    



    error, exit code 64
Invalid command line option (|)


    



    How do I use this pipe character as an argument ?

    


  • ffmpeg mp3 encoding result differs between pipe and file creation

    11 octobre 2018, par Jinsung Lee

    I’m making the program by using ffmpeg but stuck in some problem

    Encode to mp3 and file out

    ffmpeg -nostats -loglevel 0 -i example.weba -i albumart.jpg -map 0:0 -map 1:0 -id3v2_version 3 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" out.mp3

    this works very good but

    Encode to mp3 and pipe out

    ffmpeg -nostats -loglevel 0 -i example.weba -i albumart.jpg -map 0:0 -map 1:0 -id3v2_version 3 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" -f MP3 - > out.mp3

    using pipe output i got

    ffmpeg -i out.mp3
    [mp3 @ 0000000001028980] Header missing

    This error

    I need to get this mp3 data with oneline php shell_exec command

    any solution ?

    Thanks