Recherche avancée

Médias (91)

Autres articles (72)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

  • Qu’est ce qu’un masque de formulaire

    13 juin 2013, par

    Un masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
    Chaque formulaire de publication d’objet peut donc être personnalisé.
    Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
    Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (5240)

  • How to Use FFmpeg to Fetch an Audio From Local Network and Decode it to PCM ?

    26 mai 2020, par Yousef Alaqra

    Currently, I have a node js server which is connected to a specific IP address on the local network (the source of the audio), to receive the audio using VBAN protocol. VBAN protocol, basically uses UDP to send audio over the local network.

    



    Node js implementation :

    



    http.listen(3000, () => {
  console.log("Server running on port 3000");
});

let PORT = 6980;
let HOST = "192.168.1.244";

io.on("connection", (socket) => {
  console.log("a user connected");
  socket.on("disconnect", () => {
    console.log("user disconnected");
  });
});

io.on("connection", () => {

  let dgram = require("dgram");
  let server = dgram.createSocket("udp4");

  server.on("listening", () => {
    let address = server.address();
    console.log("server host", address.address);
    console.log("server port", address.port);
  });

  server.on("message", function (message, remote) {
    let audioData = vban.ProcessPacket(message);
    io.emit("audio", audioData); // // console.log(`Received packet: ${remote.address}:${remote.port}`)
  });
  server.bind({
    address: "192.168.1.230",
    port: PORT,
    exclusive: false,
  });
});


    



    once the server receives a package from the local network, it processes the package, then, using socket.io it emits the processed data to the client.

    



    An example of the processed audio data that's being emitted from the socket, and received in the angular :

    



         audio {&#xA;      format: {&#xA;        channels: 2,&#xA;        sampleRate: 44100,&#xA;        interleaved: true,&#xA;        float: false,&#xA;        signed: true,&#xA;        bitDepth: 16,&#xA;        byteOrder: &#x27;LE&#x27;&#xA;      },&#xA;      sampleRate: 44100,&#xA;      buffer: <buffer 2e="2e" 00="00" ce="ce" ff="ff" 3d="3d" bd="bd" 44="44" b6="b6" 48="48" c3="c3" 32="32" d3="d3" 31="31" d4="d4" 30="30" dd="dd" 38="38" 34="34" e5="e5" 1d="1d" c6="c6" 25="25" 974="974" more="more" bytes="bytes">,&#xA;      channels: 2,&#xA;}&#xA;</buffer>

    &#xA;&#xA;

    In the client-side (Angular), after receiving a package using socket.io.clinet, AudioConetext is used to decode the audio and play it :

    &#xA;&#xA;

       playAudio(audioData) {&#xA;    let audioCtx = new AudioContext();&#xA;    let count = 0;&#xA;    let offset = 0;&#xA;    let msInput = 1000;&#xA;    let msToBuffer = Math.max(50, msInput);&#xA;    let bufferX = 0;&#xA;    let audioBuffer;&#xA;    let prevFormat = {};&#xA;    let source;&#xA;&#xA;    if (!audioBuffer || Object.keys(audioData.format).some((key) => prevFormat[key] !== audioData.format[key])) {&#xA;      prevFormat = audioData.format;&#xA;      bufferX = Math.ceil(((msToBuffer / 1000) * audioData.sampleRate) / audioData.samples);&#xA;      if (bufferX &lt; 3) {&#xA;        bufferX = 3;&#xA;      }&#xA;      audioBuffer = audioCtx.createBuffer(audioData.channels, audioData.samples * bufferX, audioData.sampleRate);&#xA;      if (source) {&#xA;        source.disconnect();&#xA;      }&#xA;      source = audioCtx.createBufferSource();&#xA;      console.log("source", source);&#xA;      source.connect(audioCtx.destination);&#xA;      source.loop = true;&#xA;      source.buffer = audioBuffer;&#xA;      source.start();&#xA;    }&#xA;  }&#xA;

    &#xA;&#xA;

    Regardless that audio isn't playing in the client-side, and there is something wrong, this isn't the correct implementation.

    &#xA;&#xA;

    Brad, mentioned in the comments below, that I can implement this correctly and less complexity using FFmpeg child-process. And I'm very interested to know how to fetch the audio locally using FFmpeg.

    &#xA;

  • How do I use FFmpeg to fetch an audio from a local network and decode it to PCM ?

    26 mai 2020, par Yousef Alaqra

    Currently, I have a node js server which is connected to a specific IP address on the local network (the source of the audio), to receive the audio using VBAN protocol. VBAN protocol, basically uses UDP to send audio over the local network.

    &#xA;&#xA;

    Node js implementation :

    &#xA;&#xA;

    http.listen(3000, () => {&#xA;  console.log("Server running on port 3000");&#xA;});&#xA;&#xA;let PORT = 6980;&#xA;let HOST = "192.168.1.244";&#xA;&#xA;io.on("connection", (socket) => {&#xA;  console.log("a user connected");&#xA;  socket.on("disconnect", () => {&#xA;    console.log("user disconnected");&#xA;  });&#xA;});&#xA;&#xA;io.on("connection", () => {&#xA;&#xA;  let dgram = require("dgram");&#xA;  let server = dgram.createSocket("udp4");&#xA;&#xA;  server.on("listening", () => {&#xA;    let address = server.address();&#xA;    console.log("server host", address.address);&#xA;    console.log("server port", address.port);&#xA;  });&#xA;&#xA;  server.on("message", function (message, remote) {&#xA;    let audioData = vban.ProcessPacket(message);&#xA;    io.emit("audio", audioData); // // console.log(`Received packet: ${remote.address}:${remote.port}`)&#xA;  });&#xA;  server.bind({&#xA;    address: "192.168.1.230",&#xA;    port: PORT,&#xA;    exclusive: false,&#xA;  });&#xA;});&#xA;

    &#xA;&#xA;

    once the server receives a package from the local network, it processes the package, then, using socket.io it emits the processed data to the client.

    &#xA;&#xA;

    An example of the processed audio data that's being emitted from the socket, and received in the angular :

    &#xA;&#xA;

         audio {&#xA;      format: {&#xA;        channels: 2,&#xA;        sampleRate: 44100,&#xA;        interleaved: true,&#xA;        float: false,&#xA;        signed: true,&#xA;        bitDepth: 16,&#xA;        byteOrder: &#x27;LE&#x27;&#xA;      },&#xA;      sampleRate: 44100,&#xA;      buffer: <buffer 2e="2e" 00="00" ce="ce" ff="ff" 3d="3d" bd="bd" 44="44" b6="b6" 48="48" c3="c3" 32="32" d3="d3" 31="31" d4="d4" 30="30" dd="dd" 38="38" 34="34" e5="e5" 1d="1d" c6="c6" 25="25" 974="974" more="more" bytes="bytes">,&#xA;      channels: 2,&#xA;}&#xA;</buffer>

    &#xA;&#xA;

    In the client-side (Angular), after receiving a package using socket.io.clinet, AudioConetext is used to decode the audio and play it :

    &#xA;&#xA;

       playAudio(audioData) {&#xA;    let audioCtx = new AudioContext();&#xA;    let count = 0;&#xA;    let offset = 0;&#xA;    let msInput = 1000;&#xA;    let msToBuffer = Math.max(50, msInput);&#xA;    let bufferX = 0;&#xA;    let audioBuffer;&#xA;    let prevFormat = {};&#xA;    let source;&#xA;&#xA;    if (!audioBuffer || Object.keys(audioData.format).some((key) => prevFormat[key] !== audioData.format[key])) {&#xA;      prevFormat = audioData.format;&#xA;      bufferX = Math.ceil(((msToBuffer / 1000) * audioData.sampleRate) / audioData.samples);&#xA;      if (bufferX &lt; 3) {&#xA;        bufferX = 3;&#xA;      }&#xA;      audioBuffer = audioCtx.createBuffer(audioData.channels, audioData.samples * bufferX, audioData.sampleRate);&#xA;      if (source) {&#xA;        source.disconnect();&#xA;      }&#xA;      source = audioCtx.createBufferSource();&#xA;      console.log("source", source);&#xA;      source.connect(audioCtx.destination);&#xA;      source.loop = true;&#xA;      source.buffer = audioBuffer;&#xA;      source.start();&#xA;    }&#xA;  }&#xA;

    &#xA;&#xA;

    Regardless that audio isn't playing in the client-side, and there is something wrong, this isn't the correct implementation.

    &#xA;&#xA;

    Brad, mentioned in the comments below, that I can implement this correctly and less complexity using FFmpeg child-process. And I'm very interested to know how to fetch the audio locally using FFmpeg.

    &#xA;

  • avfilter/graphparser : remove 256 char limit from create_filter()

    4 août 2013, par Michael Niedermayer
    avfilter/graphparser : remove 256 char limit from create_filter()
    

    Fixes Ticket2803

    Signed-off-by : Michael Niedermayer <michaelni@gmx.at>

    • [DH] libavfilter/graphparser.c