Recherche avancée

Médias (0)

Mot : - Tags -/upload

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

Autres articles (6)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

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

  • How to send encoded video (or audio) data from server to client in a way that's decodable by webcodecs API using minimal latency and data overhead

    11 janvier 2023, par Tiger Yang

    My question (read entire post for context) :

    


    Given the unique circumstance of only ever decoding data from a specifically-configured encoder, what is the best way I can send the encoded bitstream along with the bare minimum extra bytes required to properly configure the decoder on the client's end (including only things that change per stream, and omitting things that don't, such as resolution) ? I'm a sucker for zero compromises, and I think I am willing to design my own minimal container format to accomplish this.

    


    Context and problem :

    


    I'm working on a remote desktop implementation that consists of a server that captures and encodes the display and speakers using FFmpeg and forwards it via pipe to a go (language) program which sends it on two unidirectional webtransport streams to my client, which I plan to decode using the webcodecs API. According to MDN, the video decoder needs to be fed via .configure() an object containing the following : https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/configure before it's able to decode anything.

    


    same goes for the audio decoder : https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/configure

    


    What I've tried so far :

    


    Because this remote desktop will be for my personal use only, it would only ever receive streams from a specific encoder configured in a specific way encoding video at a specific resolution, framerate, color space, etc.. Therefore, I took my video capture FFmpeg command...

    


    videoString := []string{
        "ffmpeg",
        "-init_hw_device", "d3d11va",
        "-filter_complex", "ddagrab=video_size=1920x1080:framerate=60",
        "-vcodec", "hevc_nvenc",
        "-tune", "ll",
        "-preset", "p7",
        "-spatial_aq", "1",
        "-temporal_aq", "1",
        "-forced-idr", "1",
        "-rc", "cbr",
        "-b:v", "500K",
        "-no-scenecut", "1",
        "-g", "216000",
        "-f", "hevc", "-",
    }


    


    ...and instructed it to write to an mp4 file instead of outputting to pipe, and then I had this webcodecs demo https://w3c.github.io/webcodecs/samples/video-decode-display/ demux it using mp4box.js. Knowing that the demo outputs a proper .configure() object, I blindly copied it and had my client configure using that every time. Sadly, it didn't work, and I since noticed that the "description" part of the configure object changes despite the encoder and parameters being the same.

    


    I knew that mp4 files worked via mp4box, but they can't be streamed with low latency over a network, and additionally, ffmpeg's -f parameters specifies the muxer to use, but there are so many different types.

    


    At this point, I think I'm completely out of my depth, so :

    


    Given the unique circumstance of only ever decoding data from a specifically-configured encoder, what is the best way I can send the encoded bitstream along with the bare minimum extra bytes required to properly configure the decoder on the client's end (including only things that change per stream, and omitting things that don't, such as resolution) ? I'm a sucker for zero compromises, and I think I am willing to design my own minimal container format to accomplish this. (copied above)

    


  • avfilter/vf_libplacebo : add flexible crop exprs

    1er mai 2023, par Niklas Haas
    avfilter/vf_libplacebo : add flexible crop exprs
    

    Motivated by a desire to use vf_libplacebo as a GPU-accelerated
    cropping/padding/zooming filter. This commit adds support for setting
    the `input/target.crop` fields as dynamic expressions.

    Re-use the same generic variables available to other scale and crop type
    filters, and also add some more that we can afford as a result of being
    able to set these properties dynamically.

    It's worth pointing out that `out_t/ot` is currently redundant with
    `in_t/t` since it will always contain the same PTS values, but I plan on
    changing this in the near future.

    I decided to also expose `crop_w/crop_h` and `pos_w/pos_h` as variables
    in the expression parser itself, since this enables the fairly common
    use case of determining dimensions first and then placing the image
    appropriately, such as is done in the default behavior (which centers
    the cropped/placed region by default).

    • [DH] doc/filters.texi
    • [DH] libavfilter/vf_libplacebo.c
  • How do I exit or kill a running OS process (FFMPEG) started with Node.js without crashing my app ?

    18 novembre 2022, par Alula Leakemariam

    I am developing an express application that starts FFMPEG through nodejs's child_process. The process starts, but when I try deleting specific processes by pid, the whole app crashes and has to be restarted.

    


    I start the stream with this :

    


    const { spawn, exec } = require("child_process");
const execFile = require("child_process").execFile;

function startStream(foo, url, bar) {
  const ls = spawn(`mkdir`, [`$foo`], {
    cwd: `path/to/working/dir`,
    stdio: "inherit",
  });

  const child = execFile(
    "ffmpeg",
    ["-i", url, "-hls_flags", "delete_segments", "-c", "copy", `path/to/file.m3u8`],
    { maxBuffer: Infinity },
    (error, stdout, stderr) => {
      if (error) {
        console.error("stderr: =============================", stderr);
        throw error;
      }
      console.log("stdout: ==========================", stdout);
    }
  );

  const checkProcesses = exec(`ps`, (error, stdout, stderr) => {
    if (error) {
      console.error("stderr: =============================", stderr);
      throw error;
    }
    console.log("stdout: ==========================", stdout);
  });

  return child.pid;
}

module.exports = startStream;


    


    The code below is the results of running the ps command to list the running processes, which lists ffmpeg as one of them. This will also show ffmpeg again for each time I run the function above.

    


       6394 pts/3    00:00:00 bash
 110129 pts/3    00:00:28 npm run start
 110140 pts/3    00:00:00 sh
 110141 pts/3    00:00:38 node
 136730 pts/3    00:00:00 node
 137148 pts/3    00:00:00 ffmpeg
 137358 pts/3    00:00:00 sh
 137359 pts/3    00:00:00 ps



    


    This will also start copying the FFMPEG files to the directory as expected. Afterwards, another endpoint will use the function below to delete the files created and (attempt to) kill the process :

    


    const { spawn, exec } = require("child_process");
const kill = require("tree-kill");

async function endStream(foo, bar, pid) {
  kill(pid, "SIGKILL");

  // Also tried this commented out code below with spawn and exec
  // const killProcessByPid = spawn("kill", ["-9", `${pid}`]);
  
  const ls = exec(`rm -rf  ${foo}`, {
    cwd: `./path/to/working/dir`,
  });
}
module.exports = endStream;



    


    I've tried a few variations but the result I get is usually along the lines of this :

    


    Exiting normally, received signal 15.&#xA;&#xA;    at ChildProcess.exithandler (node:child_process:402:12)&#xA;    at ChildProcess.emit (node:events:513:28)&#xA;    at maybeClose (node:internal/child_process:1100:16)&#xA;    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {&#xA;  code: 255,&#xA;  killed: false,&#xA;  signal: null,&#xA;  cmd: &#x27;ffmpeg -i <url>.m3u8 -hls_flags delete_segments -c copy path/to/file.m3u8&#x27;&#xA;}&#xA;[nodemon] app crashed - waiting for file changes before starting..&#xA;&#xA;</url>

    &#xA;

    I only started using exec/execFile/spawn after failing with libraries like fluent-ffmpeg and a few others, though it doesn't look like starting the process causes the same issues that exiting them do.

    &#xA;

    If there's anything else I can optimize while my code is up, i'd love to hear it. I'm not even sure if this code will have success with many ffmpeg processes running concurrently.

    &#xA;

    I am running this on linux (ubuntu) right now and eventually plan to deploy the server.

    &#xA;