Recherche avancée

Médias (3)

Mot : - Tags -/pdf

Autres articles (44)

  • 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

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

Sur d’autres sites (6163)

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

  • avcodec/pictordec : Remove mid exit branch

    25 novembre 2022, par Michael Niedermayer
    avcodec/pictordec : Remove mid exit branch
    

    This causes the RLE decoder to exit before applying the last RLE run
    All images i tested with are unchanged, this makes the special case
    for handling the last run unused for non truncated images.

    Reviewed-by : Peter Ross <pross@xvid.org>
    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavcodec/pictordec.c
  • Flutter - FFmpeg Kit exit with code 1 when creating video but not converting video

    30 août 2023, par Nasir

    I'm working on simple flutter video converting app, its returning with 'Conversion Failed'. here is my code.

    &#xA;

    Directory tempDir = await getTemporaryDirectory();&#xA;    String timestamp = DateTime.now().millisecondsSinceEpoch.toString();&#xA;    String outputPath = "${tempDir.path}/$timestamp.mp4";&#xA;&#xA;    String command =&#xA;        &#x27;-i $_videoPath -vf "scale=$vidWidth:$vidHeight" -c:v libx264 -crf 23 $outputPath&#x27;;&#xA;&#xA;    await FFmpegKit.executeAsync(command, (session) async {&#xA;      final returnCode = await session.getReturnCode();&#xA;      print(&#x27;................... $returnCode&#x27;);&#xA;      if (returnCode == 1) {&#xA;        ScaffoldMessenger.of(context)&#xA;            .showSnackBar(SnackBar(content: Text(&#x27;Video Saved&#x27;)));&#xA;        await GallerySaver.saveVideo(outputPath);&#xA;      } else {&#xA;        ScaffoldMessenger.of(context)&#xA;            .showSnackBar(SnackBar(content: Text(&#x27;Conversion Failed&#x27;)));&#xA;      }&#xA;    });&#xA;

    &#xA;

    I use flutter_ffmpeg which was working fine. but its not working with FFmpegKit,

    &#xA;