Recherche avancée

Médias (0)

Mot : - Tags -/content

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

Autres articles (88)

  • Configuration spécifique pour PHP5

    4 février 2011, par

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

Sur d’autres sites (3509)

  • NodeJS : Fail to write byte array input from webcam to ffmpeg spawn process

    23 mai 2024, par Thanesh Prabaghan

    I'm using NodeJS server to display an HTML page which has webcam option. Once user visited to my NodeJS server, it will serve html page. User can allow webcam option and see webcam view on the page.

    


    In the backend, I send webcam stream (byte array) using socket.io. I receive byte array successfully in backend with the help of socket.io. BUT MY PROBLEM IS, I can't pipe this byte array to the ffmpeg spawn process. I don't know how to properly pipe this data to the ffmpeg. Once it done, all my problem will be solved.

    


    On the other side, I have node-media-server as RTMP server to publish this stream to VLC player and other devices. Kindly help me to complete this task. I will attach all my code to this question. Kindly run this in your environment and answer the question.

    


    MY HTML PAGE

    


    &#xA;&#xA;  &#xA;    &#xA;      &#xA;&#xA;      &#xA;&#xA;      <code class="echappe-js">&lt;script src=&quot;https://cdn.socket.io/4.7.5/socket.io.min.js&quot; &amp;#xA;        integrity=&quot;integrity_code&quot; &amp;#xA;        crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;&#xA;    &#xA;    &#xA;      
    &#xA; &#xA;&#xA; &lt;script&gt;&amp;#xA;          const socket = io(&amp;#x27;http://localhost:8080/&amp;#x27;);&amp;#xA;          var video = document.getElementById(&quot;video&quot;);&amp;#xA;&amp;#xA;          if (navigator.mediaDevices.getUserMedia) {&amp;#xA;            navigator.mediaDevices.getUserMedia({ video: true, audio:true })&amp;#xA;            .then(function (stream) {&amp;#xA;              const recorder = new MediaRecorder(stream);&amp;#xA;&amp;#xA;              recorder.ondataavailable = event =&gt; {&amp;#xA;                socket.emit(&amp;#x27;VideoStream&amp;#x27;, event.data);&amp;#xA;              };&amp;#xA;              recorder.start(1000);      &amp;#xA;              video.srcObject = stream;&amp;#xA;            }).catch(function (error) {&amp;#xA;              console.log(&quot;Something went wrong!&quot;);&amp;#xA;            });&amp;#xA;         }  &amp;#xA;       &lt;/script&gt;&#xA; &#xA;&#xA;&#xA;

    &#xA;

    FFMPEG IMPLEMENTATION

    &#xA;

    const express = require(&#x27;express&#x27;);&#xA;const app = express();&#xA;const http = require(&#x27;http&#x27;);&#xA;const server = http.createServer(app);&#xA;const { Server } = require("socket.io");&#xA;const io = new Server(server);&#xA;const path = require(&#x27;node:path&#x27;); &#xA;const { spawn } = require(&#x27;node:child_process&#x27;);&#xA;&#xA;let cmd = spawn(&#x27;ffmpeg.exe&#x27;, [&#xA;    &#x27;-c:v&#x27;, &#x27;copy&#x27;, &#x27;-preset&#x27;, &#x27;ultrafast&#x27;, &#x27;-tune&#x27;, &#x27;zerolatency&#x27;,&#xA;    &#x27;-c:a&#x27;, &#x27;aac&#x27;, &#x27;-strict&#x27;, &#x27;-2&#x27;, &#x27;-ar&#x27;, &#x27;44100&#x27;, &#x27;-b:a&#x27;, &#x27;64k&#x27;,&#xA;    &#x27;-y&#x27;,&#xA;    &#x27;-use_wallclock_as_timestamps&#x27;, &#x27;1&#x27;,&#xA;    &#x27;-async&#x27;, &#x27;1&#x27;,&#xA;    &#x27;-flush_packets&#x27;, &#x27;1&#x27;,&#xA;    &#x27;-rtbufsize&#x27;, &#x27;1000&#x27;,&#xA;    &#x27;-bufsize&#x27;, &#x27;1000&#x27;,&#xA;    &#x27;-f&#x27;, &#x27;flv&#x27;,&#xA;     &#x27;-i&#x27;,&#x27;-&#x27;,&#xA;    &#x27;rtmp://localhost:1935&#x27;,&#xA;  ]);&#xA;&#xA;app.use(express.static(path.join(__dirname, &#x27;public&#x27;)));&#xA;&#xA;app.get(&#x27;/&#x27;, (req, res) => {&#xA;  res.sendFile(path.join(__dirname &#x2B; &#x27;index.html&#x27;));&#xA;});&#xA;&#xA;io.on(&#x27;connection&#x27;, (socket) => {&#xA;  socket.on("VideoStream", (data) => {&#xA;    cmd.stdin.write(data);&#xA;  });&#xA;});&#xA;&#xA;server.listen(8080, () => {&#xA;  console.log(&#x27;listening on *:8080&#x27;);&#xA;});&#xA;&#xA;```&#xA;**NODE MEDIA SERVER IMPLEMENTATION**&#xA;&#xA;```&#xA;const NodeMediaServer = require(&#x27;node-media-server&#x27;);&#xA;&#xA;const config = {&#xA;  rtmp: {&#xA;    port: 1935,&#xA;    chunk_size: 60000,&#xA;    gop_cache: true,&#xA;    ping: 30,&#xA;    ping_timeout: 60&#xA;  },&#xA;  http: {&#xA;    port: 8000,&#xA;    allow_origin: &#x27;*&#x27;&#xA;  }&#xA;};&#xA;&#xA;var nms = new NodeMediaServer(config)&#xA;nms.run();&#xA;```&#xA;&#xA;&#xA;

    &#xA;

  • Cannot merge audio and video streams from ytdl-core

    20 août 2022, par Abhigyan Kumar

    I am trying to merge ytdl-core video only and audio only streams and sending the merged stream are response to user (for download in browser). With JavaScript only, its working perfectly fine. But typeScript is saying child process stdio is undefined

    &#xA;

    import express, { Request } from "express";&#xA;import ytdl from "ytdl-core";&#xA;import cp from "child_process";&#xA;import ffmpeg from "ffmpeg-static";    &#xA;app.get("/downloadmerged", (req, res) => {&#xA;res.setHeader("Content-Type", "video/mp4");&#xA;res.setHeader(&#xA;  `Content-Disposition`,&#xA;  `attachment; filename="Merged.mp4"`&#xA;);&#xA;  const ref = "https://www.youtube.com/watch?v=aR-KAldshAE";&#xA;  const audio = ytdl(ref, { filter: "audioonly", quality: "highestaudio" });&#xA;  const video = ytdl(ref, { filter: "videoonly", quality: "highestvideo" });&#xA;  const ffmpegProcess = cp.spawn(&#xA;    ffmpeg,&#xA;    [&#xA;      // Remove ffmpeg&#x27;s console spamming&#xA;      "-loglevel",&#xA;      "0",&#xA;      "-hide_banner",&#xA;      // 3 second audio offset&#xA;      "-itsoffset",&#xA;      "3.0",&#xA;      "-i",&#xA;      "pipe:3",&#xA;      "-i",&#xA;      "pipe:4",&#xA;      // Rescale the video&#xA;      "-vf",&#xA;      "scale=320:240",&#xA;      // Choose some fancy codes&#xA;      "-c:v",&#xA;      "libx265",&#xA;      "-x265-params",&#xA;      "log-level=0",&#xA;      "-c:a",&#xA;      "flac",&#xA;      // Define output container&#xA;      "-f",&#xA;      "matroska",&#xA;      "pipe:5",&#xA;    ],&#xA;    {&#xA;      windowsHide: true,&#xA;      stdio: [&#xA;        /* Standard: stdin, stdout, stderr */&#xA;        "inherit",&#xA;        "inherit",&#xA;        "inherit",&#xA;        /* Custom: pipe:3, pipe:4, pipe:5 */&#xA;        "pipe",&#xA;        "pipe",&#xA;        "pipe",&#xA;      ],&#xA;    }&#xA;  );&#xA;  ffmpegProcess.on("close", () => {&#xA;    process.stdout.write("\n\n\n");&#xA;    console.log("done");&#xA;  });&#xA; &#xA;  audio.pipe(ffmpegProcess.stdio[3]);&#xA;  video.pipe(ffmpegProcess.stdio[4]);&#xA;  ffmpegProcess.stdio[5].pipe(res);&#xA;});&#xA;

    &#xA;

    line ffmpegProcess.stdio[3] and ffmpegProcess.stdio[4] are giving type error

    &#xA;

    Argument of type &#x27;Readable | Writable | null | undefined&#x27; is not assignable to parameter of type &#x27;WritableStream&#x27;.Type &#x27;undefined&#x27; is not assignable to type &#x27;WritableStream&#x27;&#xA;&#xA;  &#xA;

    &#xA;

  • How exactly do I extract and merge a audio file using @ffmpeg/ffmpeg

    5 octobre 2022, par jeff.gogooma

    I have a lot of issues about audio transfer to server and frontend.

    &#xA;

    I am building a solution that is extracting and merging a file received from frontend.

    &#xA;

    I am using local ffmpeg file with node.js child_process package.

    &#xA;

    My Env :

    &#xA;

    framework : nest.js

    &#xA;

    runtime : node.js

    &#xA;

    lang : typescript

    &#xA;

    here is console.log(file : Express.Multer.File).&#xA;I am storing to S3 bucket these files. So I am not using multer's memory, disk storage.

    &#xA;

    // console.log(file);&#xA; {&#xA;  fieldname: &#x27;file&#x27;,&#xA;  originalname: &#x27;input1.mp3&#x27;,&#xA;  encoding: &#x27;7bit&#x27;,&#xA;  mimetype: &#x27;audio/mpeg&#x27;&#xA;}&#xA;

    &#xA;

    import cp from "child_process";&#xA;&#xA;type Section = { from: number, to: number };&#xA;&#xA;const files: Array = [];&#xA;&#xA;export const setupAudioFileSection = async (file: Express.Multer.File, section: Section) => {&#xA;  try {&#xA;    const file1 = await cp.exec(`ffmpeg -i ${file} -y -ss 0 -t ${section.from}`);&#xA;    const file2 = await cp.exec(`ffmpeg -i ${file} -y -ss ${section.from} -t ${section.to}`);&#xA;    const file3 = await cp.exec(`ffmpeg -i ${file} -y -ss ${section.to}`);&#xA;    files.push(file1);&#xA;    files.push(file3);&#xA;&#xA;    return file2;&#xA;  } catch (error) {&#xA;    console.log(error);&#xA;    throw new Error(&#x27;setupAudioFileSection error&#x27;);&#xA;  }&#xA;

    &#xA;

    But, My Local ffmpeg is printing the error. because of [object Object]. I think local ffmpeg is not recognized the audio file received from client. So, I am resolving this issue by writing a file to disk or memory directly. but I am confusing this solution whether is right or not.

    &#xA;

    error Error: Command failed: ffmpeg -i [object Object] -y -ss 10 -t 20 -f mp3 ./TestOutput&#xA;ffmpeg version 5.1.1 Copyright (c) 2000-2022 the FFmpeg developers&#xA;  built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)&#xA;  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.1.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-neon&#xA;  libavutil      57. 28.100 / 57. 28.100&#xA;  libavcodec     59. 37.100 / 59. 37.100&#xA;  libavformat    59. 27.100 / 59. 27.100&#xA;  libavdevice    59.  7.100 / 59.  7.100&#xA;  libavfilter     8. 44.100 /  8. 44.100&#xA;  libswscale      6.  7.100 /  6.  7.100&#xA;  libswresample   4.  7.100 /  4.  7.100&#xA;  libpostproc    56.  6.100 / 56.  6.100&#xA;&#xA;[object: No such file or directory&#xA;&#xA;

    &#xA;

    How can I write file on my server and read ? if that can be, I can resolve [object Object] of ffmpeg issue maybe. Please some answer or advise my issue. Thank you !

    &#xA;