Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (21)

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

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (4501)

  • Which ffmpeg command sequence can generate the first frame of the video [Need thumbnails for Node.js app]

    6 janvier 2021, par Jedavard

    I'm trying to make thumbnails for videos, but the problem is I'm not able to write some right ffmpeg commands for getting the very first frame. This is for a Node.js AWS Lambda function.

    



    I tried this, but it's not working for me.

    



    -vf "select=eq(n\,0)"


    



    Tried all from here How to extract the 1st frame and restore as an image with ffmpeg ?.

    



    Here's my command line, I copied it and honestly I have no idea about this commands.

    



    function createImage(type) {
    return new Promise((resolve, reject) => {
      let tmpFile = fs.createWriteStream(`/tmp/screenshot.${type}`);
      const ffmpeg = spawn(ffmpegPath, [
      '-ss',
      '00:00:00.01',
      '-i',
      target,
      '-vf',
      `thumbnail`,
      '-qscale:v',
      '2',
      '-frames:v',
      '1',
      '-f',
      'image2',
      '-c:v',
      'mjpeg',
      'pipe:1',
    ]);


  ffmpeg.stdout.pipe(tmpFile);

  ffmpeg.on('close', function(code) {
    tmpFile.end();
    resolve();
  });

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


    



    (I use this https://johnvansickle.com/ffmpeg/ release 4.2.3 version on a Node child process.)

    


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

    



    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;

  • (Ffmpeg) How to play live audio in the browser from received UDP packets using Ffmpeg ?

    26 octobre 2022, par Yousef Alaqra

    I have .NET Core console application which acts as UDP Server and UDP Client

    &#xA;&#xA;

      &#xA;
    • UDP client by receiving audio packet.
    • &#xA;

    • UDP server, by sending each received packet.
    • &#xA;

    &#xA;&#xA;

    Here's a sample code of the console app :

    &#xA;&#xA;

    static UdpClient udpListener = new UdpClient();&#xA;    static IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse("192.168.1.230"), 6980);&#xA;    static IAudioSender audioSender = new UdpAudioSender(new IPEndPoint(IPAddress.Parse("192.168.1.230"), 65535));&#xA;&#xA;    static void Main(string[] args)&#xA;    {&#xA;        udpListener.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);&#xA;        udpListener.Client.Bind(endPoint);&#xA;&#xA;        try&#xA;        {&#xA;            udpListener.BeginReceive(new AsyncCallback(recv), null);&#xA;        }&#xA;        catch (Exception e)&#xA;        {&#xA;            throw e;&#xA;        }&#xA;&#xA;        Console.WriteLine("Press enter to dispose the running service");&#xA;        Console.ReadLine();&#xA;    }&#xA;&#xA;    private async static void recv(IAsyncResult res)&#xA;    {&#xA;        byte[] received = udpListener.EndReceive(res, ref endPoint);&#xA;        OnAudioCaptured(received);&#xA;        udpListener.BeginReceive(new AsyncCallback(recv), null);&#xA;    }&#xA;

    &#xA;&#xA;

    On the other side, I have a node js API application, which supposes to execute an FFmpeg command as a child process and to do the following

    &#xA;&#xA;

      &#xA;
    • receive the audio packet as an input from the console app UDP server.
    • &#xA;

    • convert the received bytes into WebM
    • &#xA;

    • pipe out the result into the response.
    • &#xA;

    &#xA;&#xA;

    Finally, in the client-side, I should have an audio element with source value equals to the http://localhost:3000

    &#xA;&#xA;

    For now, I can only execute this FFmpeg command :

    &#xA;&#xA;

    ffmpeg -f  s16le  -ar 48000 -ac 2 -i &#x27;udp://192.168.1.230:65535&#x27; output.wav&#xA;

    &#xA;&#xA;

    Which do the following

    &#xA;&#xA;

      &#xA;
    • Receive UDP packet as an input
    • &#xA;

    • Convert the received bytes into the output.wav audio file.
    • &#xA;

    &#xA;&#xA;

    How would I execute a child process in the node js server which receives the UDP packets and pipe out the result into the response as Webm ?

    &#xA;