Recherche avancée

Médias (0)

Mot : - Tags -/logo

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

Autres articles (100)

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

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

Sur d’autres sites (11505)

  • Socket.io client in js and server in Socket.io go doesn't send connected messege and data

    24 mars 2023, par OmriHalifa

    I am using ffmpeg and socket.io and I have some issues. I'm trying to send a connection request to a server written in Go through React, but I'm unable to connect to it. I tried adding the events in useEffect and it's still not working, what should I do ? i attaching my code in js and in go :
main.go

    


    package main

import (
    "log"

    "github.com/gin-gonic/gin"

    socketio "github.com/googollee/go-socket.io"
)

func main() {
    router := gin.New()

    server := socketio.NewServer(nil)

    server.OnConnect("/", func(s socketio.Conn) error {
        s.SetContext("")
        log.Println("connected:", s.ID())
        return nil
    })

    server.OnEvent("/", "notice", func(s socketio.Conn, msg string) {
        log.Println("notice:", msg)
        s.Emit("reply", "have "+msg)
    })

    server.OnEvent("/", "transcoded-video", func(s socketio.Conn, data string) {
        log.Println("transcoded-video:", data)
    })

    server.OnEvent("/", "bye", func(s socketio.Conn) string {
        last := s.Context().(string)
        s.Emit("bye", last)
        s.Close()
        return last
    })

    server.OnError("/", func(s socketio.Conn, e error) {
        log.Println("meet error:", e)
    })

    server.OnDisconnect("/", func(s socketio.Conn, reason string) {
        log.Println("closed", reason)
    })

    go func() {
        if err := server.Serve(); err != nil {
            log.Fatalf("socketio listen error: %s\n", err)
        }
    }()
    defer server.Close()

    if err := router.Run(":8000"); err != nil {
        log.Fatal("failed run app: ", err)
    }
}



    


    App.js

    


    import &#x27;./App.css&#x27;;&#xA;import { useEffect } from &#x27;react&#x27;;&#xA;import { createFFmpeg, fetchFile } from &#x27;@ffmpeg/ffmpeg&#x27;;&#xA;import { io } from &#x27;socket.io-client&#x27;; &#xA;&#xA;function App() {&#xA;  const socket = io("http://localhost:8000",function() {&#xA;    // Send a message to the server when the client is connected&#xA;    socket.emit(&#x27;clientConnected&#x27;, &#x27;Client has connected to the server!&#x27;);&#xA;  })&#xA;&#xA;  const ffmpegWorker = createFFmpeg({&#xA;    log: true&#xA;  })&#xA;&#xA;  // Initialize FFmpeg when the component is mounted&#xA;  async function initFFmpeg() {&#xA;    await ffmpegWorker.load();&#xA;  }&#xA;&#xA;  async function transcode(webcamData) {&#xA;    const name = &#x27;record.webm&#x27;;&#xA;    await ffmpegWorker.FS(&#x27;writeFile&#x27;, name, await fetchFile(webcamData));&#xA;    await ffmpegWorker.run(&#x27;-i&#x27;, name, &#x27;-preset&#x27;, &#x27;ultrafast&#x27;, &#x27;-threads&#x27;, &#x27;4&#x27;, &#x27;output.mp4&#x27;);&#xA;    const data = ffmpegWorker.FS(&#x27;readFile&#x27;, &#x27;output.mp4&#x27;);&#xA;    &#xA;    // Set the source of the output video element to the transcoded video data&#xA;    const video = document.getElementById(&#x27;output-video&#x27;);&#xA;    video.src = URL.createObjectURL(new Blob([data.buffer], { type: &#x27;video/mp4&#x27; }));&#xA;    &#xA;    // Remove the output.mp4 file from the FFmpeg virtual file system&#xA;    ffmpegWorker.FS(&#x27;unlink&#x27;, &#x27;output.mp4&#x27;);&#xA;    &#xA;    // Emit a "transcoded-video" event to the server with the transcoded video data&#xA;    socket.emit("transcoded-video", data.buffer)&#xA;  }&#xA;  &#xA;  &#xA;&#xA;  let mediaRecorder;&#xA;  let chunks = [];&#xA;  &#xA;  // Request access to the user&#x27;s camera and microphone and start recording&#xA;  function requestMedia() {&#xA;    const webcam = document.getElementById(&#x27;webcam&#x27;);&#xA;    navigator.mediaDevices.getUserMedia({ video: true, audio: true })&#xA;    .then(async (stream) => {&#xA;      webcam.srcObject = stream;&#xA;      await webcam.play();&#xA;&#xA;      // Set up a MediaRecorder instance to record the video and audio&#xA;      mediaRecorder = new MediaRecorder(stream);&#xA;&#xA;      // Add the recorded data to the chunks array&#xA;      mediaRecorder.ondataavailable = async (e) => {&#xA;        chunks.push(e.data);&#xA;      }&#xA;&#xA;      // Transcode the recorded video data after the MediaRecorder stops&#xA;      mediaRecorder.onstop = async () => {&#xA;        await transcode(new Uint8Array(await (new Blob(chunks)).arrayBuffer()));&#xA;&#xA;        // Clear the chunks array after transcoding&#xA;        chunks = [];&#xA;&#xA;        // Start the MediaRecorder again after a 0 millisecond delay&#xA;        setTimeout(() => {&#xA;          mediaRecorder.start();&#xA;          &#xA;          // Stop the MediaRecorder after 3 seconds&#xA;          setTimeout(() => {&#xA;            mediaRecorder.stop();&#xA;          }, 500);&#xA;        }, 0);&#xA;      }&#xA;&#xA;      // Start the MediaRecorder&#xA;      mediaRecorder.start();&#xA;&#xA;      // Stop the MediaRecorder after 3 seconds&#xA;      setTimeout(() => {&#xA;        mediaRecorder.stop();&#xA;      }, 700);&#xA;    })&#xA;  }&#xA;  &#xA;  useEffect(() => {&#xA;    // Set up event listeners for the socket connection&#xA;    socket.on(&#x27;/&#x27;, function(){&#xA;      // Log a message when the client is connected to the server&#xA;      console.log("Connected to server!"); &#xA;    });&#xA;&#xA;    socket.on(&#x27;transcoded-video&#x27;, function(data){&#xA;      // Log the received data for debugging purposes&#xA;      console.log("Received transcoded video data:", data); &#xA;    });&#xA;&#xA;    socket.on(&#x27;notice&#x27;, function(data){&#xA;      // Emit a "notice" event back to the server to acknowledge the received data&#xA;      socket.emit("notice", "ping server!");&#xA;    });&#xA;&#xA;    socket.on(&#x27;bye&#x27;, function(data){&#xA;      // Log the received data and disconnect from the server&#xA;      console.log("Server sent:", data); &#xA;      socket.disconnect();&#xA;    });&#xA;&#xA;    socket.on(&#x27;disconnect&#x27;, function(){&#xA;      // Log a message when the client is disconnected from the server&#xA;      console.log("Disconnected from server!"); &#xA;    });&#xA;  }, [])&#xA;&#xA;  return (&#xA;    <div classname="App">&#xA;      <div>&#xA;          <video muted="{true}"></video>&#xA;          <video autoplay="autoplay"></video>&#xA;      </div>&#xA;      <button>start streaming</button>&#xA;    </div>&#xA;  );&#xA;}&#xA;&#xA;export default App;&#xA;

    &#xA;

    What can i do to fix it ? thank you !!

    &#xA;

  • How do i play an HLS stream when playlist.m3u8 file is constantly being updated ?

    3 janvier 2021, par Adnan Ahmed

    I am using MediaRecorder to record chunks of my live video in webm format from MediaStream and converting these chunks to .ts files on the server using ffmpeg and then updating my playlist.m3u8 file with this code :

    &#xA;

    function generateM3u8Playlist(fileDataArr, playlistFp, isLive, cb) {&#xA;    var durations = fileDataArr.map(function(fd) {&#xA;        return fd.duration;&#xA;    });&#xA;    var maxT = maxOfArr(durations);&#xA;&#xA;    var meta = [&#xA;        &#x27;#EXTM3U&#x27;,&#xA;        &#x27;#EXT-X-VERSION:3&#x27;,&#xA;        &#x27;#EXT-X-MEDIA-SEQUENCE:0&#x27;,&#xA;        &#x27;#EXT-X-ALLOW-CACHE:YES&#x27;,&#xA;        &#x27;#EXT-X-TARGETDURATION:&#x27; &#x2B; Math.ceil(maxT),&#xA;    ];&#xA;&#xA;    fileDataArr.forEach(function(fd) {&#xA;        meta.push(&#x27;#EXTINF:&#x27; &#x2B; fd.duration.toFixed(2) &#x2B; &#x27;,&#x27;);&#xA;        meta.push(fd.fileName2);&#xA;    });&#xA;&#xA;    if (!isLive) {&#xA;        meta.push(&#x27;#EXT-X-ENDLIST&#x27;);&#xA;    }&#xA;&#xA;    meta.push(&#x27;&#x27;);&#xA;    meta = meta.join(&#x27;\n&#x27;);&#xA;&#xA;    fs.writeFile(playlistFp, meta, cb);&#xA;}&#xA;

    &#xA;

    Here fileDataArr holds information for all the chunks that have been created.

    &#xA;

    After that i use this code to create a hls server :

    &#xA;

    var runStreamServer = (function(streamFolder) {&#xA;    var executed = false;&#xA;    return function(streamFolder) {&#xA;        if (!executed) {&#xA;            executed = true;&#xA;            var HLSServer = require(&#x27;hls-server&#x27;)&#xA;            var http = require(&#x27;http&#x27;)&#xA;&#xA;            var server = http.createServer()&#xA;            var hls = new HLSServer(server, {&#xA;                path: &#x27;/stream&#x27;, // Base URI to output HLS streams&#xA;                dir: &#x27;C:\\Users\\Work\\Desktop\\live-stream\\webcam2hls\\videos\\&#x27; &#x2B; streamFolder // Directory that input files are stored&#xA;            })&#xA;            console.log("We are going to stream from folder:" &#x2B; streamFolder);&#xA;            server.listen(8000);&#xA;            console.log(&#x27;Server Listening on Port 8000&#x27;);&#xA;        }&#xA;    };&#xA;})();&#xA;

    &#xA;

    The problem is that if i stop creating new chunks and then use the hls server link :&#xA;http://localhost:8000/stream/playlist.m3u8 then the video plays in VLC but if i try to play during the recording it keeps loading the file but does not play. I want it to play while its creating new chunks and updating playlist.m3u8. The quirk in generateM3u8Playlist function is that it adds &#x27;#EXT-X-ENDLIST&#x27; to the playlist file after i have stopped recording.&#xA;The software is still in production so its a bit messy code. Thank you for any answers.

    &#xA;

    The client side that generates blobs is as follows :

    &#xA;

    var mediaConstraints = {&#xA;            video: true,&#xA;            audio:true&#xA;        };&#xA;navigator.getUserMedia(mediaConstraints, onMediaSuccess, onMediaError);&#xA;function onMediaSuccess(stream) {&#xA;            console.log(&#x27;will start capturing and sending &#x27; &#x2B; (DT / 1000) &#x2B; &#x27;s videos when you press start&#x27;);&#xA;            var mediaRecorder = new MediaStreamRecorder(stream);&#xA;&#xA;            mediaRecorder.mimeType = &#x27;video/webm&#x27;;&#xA;&#xA;            mediaRecorder.ondataavailable = function(blob) {&#xA;                var count2 = zeroPad(count, 5);&#xA;                // here count2 just creates a blob number &#xA;                console.log(&#x27;sending chunk &#x27; &#x2B; name &#x2B; &#x27; #&#x27; &#x2B; count2 &#x2B; &#x27;...&#x27;);&#xA;                send(&#x27;/chunk/&#x27; &#x2B; name &#x2B; &#x27;/&#x27; &#x2B; count2 &#x2B; (stopped ? &#x27;/finish&#x27; : &#x27;&#x27;), blob);&#xA;                &#x2B;&#x2B;count;&#xA;            };&#xA;        }&#xA;// Here we have the send function which sends our blob to server:&#xA;        function send(url, blob) {&#xA;            var xhr = new XMLHttpRequest();&#xA;            xhr.open(&#x27;POST&#x27;, url, true);&#xA;&#xA;            xhr.responseType = &#x27;text/plain&#x27;;&#xA;            xhr.setRequestHeader(&#x27;Content-Type&#x27;, &#x27;video/webm&#x27;);&#xA;            //xhr.setRequestHeader("Content-Length", blob.length);&#xA;&#xA;            xhr.onload = function(e) {&#xA;                if (this.status === 200) {&#xA;                    console.log(this.response);&#xA;                }&#xA;            };&#xA;            xhr.send(blob);&#xA;        }&#xA;

    &#xA;

    The code that receives the XHR request is as follows :

    &#xA;

    var parts = u.split(&#x27;/&#x27;);&#xA;        var prefix = parts[2];&#xA;        var num = parts[3];&#xA;        var isFirst = false;&#xA;        var isLast = !!parts[4];&#xA;&#xA;        if ((/^0&#x2B;$/).test(num)) {&#xA;            var path = require(&#x27;path&#x27;);&#xA;            shell.mkdir(path.join(__dirname, &#x27;videos&#x27;, prefix));&#xA;            isFirst = true;&#xA;        }&#xA;&#xA;        var fp = &#x27;videos/&#x27; &#x2B; prefix &#x2B; &#x27;/&#x27; &#x2B; num &#x2B; &#x27;.webm&#x27;;&#xA;        var msg = &#x27;got &#x27; &#x2B; fp;&#xA;        console.log(msg);&#xA;        console.log(&#x27;isFirst:%s, isLast:%s&#x27;, isFirst, isLast);&#xA;&#xA;        var stream = fs.createWriteStream(fp, { encoding: &#x27;binary&#x27; });&#xA;        /*stream.on(&#x27;end&#x27;, function() {&#xA;            respond(res, [&#x27;text/plain&#x27;, msg]);&#xA;        });*/&#xA;&#xA;        //req.setEncoding(&#x27;binary&#x27;);&#xA;&#xA;        req.pipe(stream);&#xA;        req.on(&#x27;end&#x27;, function() {&#xA;            respond(res, [&#x27;text/plain&#x27;, msg]);&#xA;&#xA;            if (!LIVE) { return; }&#xA;&#xA;            var duration = 20;&#xA;            var fd = {&#xA;                fileName: num &#x2B; &#x27;.webm&#x27;,&#xA;                filePath: fp,&#xA;                duration: duration&#xA;            };&#xA;            var fileDataArr;&#xA;            if (isFirst) {&#xA;                fileDataArr = [];&#xA;                fileDataArrs[prefix] = fileDataArr;&#xA;            } else {&#xA;                var fileDataArr = fileDataArrs[prefix];&#xA;            }&#xA;            try {&#xA;                fileDataArr.push(fd);&#xA;            } catch (err) {&#xA;                fileDataArr = [];&#xA;                console.log(err.message);&#xA;            }&#xA;            videoUtils.computeStartTimes(fileDataArr);&#xA;&#xA;            videoUtils.webm2Mpegts(fd, function(err, mpegtsFp) {&#xA;                if (err) { return console.error(err); }&#xA;                console.log(&#x27;created %s&#x27;, mpegtsFp);&#xA;&#xA;                var playlistFp = &#x27;videos/&#x27; &#x2B; prefix &#x2B; &#x27;/playlist.m3u8&#x27;;&#xA;&#xA;                var fileDataArr2 = (isLast ? fileDataArr : lastN(fileDataArr, PREV_ITEMS_IN_LIVE));&#xA;&#xA;                var action = (isFirst ? &#x27;created&#x27; : (isLast ? &#x27;finished&#x27; : &#x27;updated&#x27;));&#xA;&#xA;                videoUtils.generateM3u8Playlist(fileDataArr2, playlistFp, !isLast, function(err) {&#xA;                    console.log(&#x27;playlist %s %s&#x27;, playlistFp, (err ? err.toString() : action));&#xA;                });&#xA;            });&#xA;&#xA;&#xA;            runStreamServer(prefix);&#xA;        }&#xA;

    &#xA;

  • How to write a video stream to a server ?

    14 août, par The Mask

    Recently been playing with FFmpeg and it's powerful abilities. Working on a cool project where I'm trying to create a live video stream using FFmpeg. The client (reactJs) and server (nodeJS) are connected via web-socket. The client sends the byte packets to server and the server then spawns an FFmpeg process and serve it to an nginx server.

    &#xA;

    Client(live-stream.js) :

    &#xA;

    const stream = await navigator.mediaDevices.getUserMedia({&#xA;    video: true,&#xA;    audio: true,&#xA;  });&#xA;  videoRef.current.srcObject = stream;&#xA;&#xA;  const ingestUrl = `ws://localhost:8081/ws`&#xA;  const socket = new WebSocket(ingestUrl);&#xA;  socket.binaryType = "arraybuffer";&#xA;  socket.onopen = () => {&#xA;    console.log("✅ WebSocket connection established");&#xA;    socket.send(JSON.stringify({ type: "start", stream_key: streamKey }));&#xA;    mediaRecorderRef.current.start(500);&#xA;  };&#xA;  socketRef.current = socket;&#xA;&#xA;  socket.onerror = (error) => {&#xA;    console.error("❌ WebSocket error:", error);&#xA;  };&#xA;&#xA;  mediaRecorderRef.current = new MediaRecorder(stream, {&#xA;    mimeType: "video/webm;codecs=vp8,opus",&#xA;    videoBitsPerSecond: 1000000,&#xA;    audioBitsPerSecond: 128000&#xA;  });&#xA;  mediaRecorderRef.current.ondataavailable = (event) => {&#xA;    if (event.data.size > 0 &amp;&amp; socket.readyState === WebSocket.OPEN) {&#xA;      event.data.arrayBuffer().then((buffer) => socket.send(buffer));&#xA;    }&#xA;  };&#xA;

    &#xA;

    Server(index.js) :

    &#xA;

    const http = require(&#x27;http&#x27;);&#xA;const WebSocket = require(&#x27;ws&#x27;);&#xA;const { spawn } = require(&#x27;child_process&#x27;);&#xA;const fs = require(&#x27;fs&#x27;);&#xA;&#xA;&#xA;const server = new WebSocket.Server({ server:wss, path:&#x27;/ws&#x27;});&#xA;&#xA;const startFFmpeg = (stream_key) => {&#xA;  return ffmpeg = spawn("ffmpeg", [&#xA;    "-re",&#xA;    "-f", "matroska",&#xA;    "-i", "pipe:0",&#xA;    "-map", "0:v:0",&#xA;    "-map", "0:a:0",&#xA;    "-c:v", "libx264",&#xA;    "-c:a", "aac ",&#xA;    "-b:v", "6000k",&#xA;    "-maxrate", "6000k ",&#xA;    "-bufsize", "6000k ",&#xA;    "-pix_fmt", "yuv420p ",&#xA;    "-f", "flv",&#xA;    `rtmp://localhost/live/${stream_key}`,&#xA;  ]);&#xA;}&#xA;server.on(&#x27;connection&#x27;, (ws) => {&#xA;  console.log(&#x27;&#128225; New WebSocket connection&#x27;);&#xA;&#xA;  let ffmpeg = null;&#xA;  let buffer = Buffer.alloc(0);&#xA;  let streamStarted = false;&#xA;&#xA;  ws.on(&#x27;message&#x27;, (msg, isBinary) => {&#xA;    if (!isBinary) {&#xA;      const parsed = JSON.parse(msg);&#xA;      if (parsed.type === "start") {&#xA;        const { stream_key } = parsed;&#xA;        console.log(`&#128273; Stream key: ${stream_key}`);&#xA;        console.log(`&#127909; Starting ingest for stream key: ${stream_key}`);&#xA;&#xA;        ffmpeg = startFFmpeg(stream_key)&#xA;        ffmpeg.stdin.on("error", (e) => {&#xA;          console.error("FFmpeg stdin error:", e.message);&#xA;        });&#xA;&#xA;        ffmpeg.stderr.on("data", (data) => {&#xA;          console.log(`FFmpeg Data: ${data}`);&#xA;        });&#xA;&#xA;        ffmpeg.on("close", (code) => {&#xA;          console.log(`FFmpeg exited with code ${code}`);&#xA;        });&#xA;&#xA;        ffmpeg.on("exit", (code, signal) => {&#xA;          console.log(`FFmpeg exited with code: ${code}, signal: ${signal}`);&#xA;          if (signal === &#x27;SIGSEGV&#x27;) {&#xA;            console.log(&#x27;&#128260; FFmpeg segfaulted, attempting restart...&#x27;);&#xA;            setTimeout(() => {&#xA;              if (ws.readyState === WebSocket.OPEN) {&#xA;                startFFmpeg(stream_key);&#xA;              }&#xA;            }, 1000);&#xA;          }&#xA;        });&#xA;&#xA;        streamStarted = true;&#xA;      }&#xA;    } else if (isBinary &amp;&amp; ffmpeg &amp;&amp; ffmpeg.stdin.writable) {&#xA;        try {&#xA;        // Convert to Buffer if it&#x27;s an ArrayBuffer&#xA;        let data;&#xA;        if (msg instanceof ArrayBuffer) {&#xA;          data = Buffer.from(msg);&#xA;        } else {&#xA;          data = Buffer.from(msg);&#xA;        }&#xA;&#xA;        // Buffer the data&#xA;        buffer = Buffer.concat([buffer, data]);&#xA;        &#xA;        // Write in larger chunks to reduce overhead&#xA;        if (buffer.length >= 8192) { // 8KB threshold&#xA;          console.log(`&#128229; Writing ${buffer.length} bytes to FFmpeg`);&#xA;          &#xA;          if (ffmpeg.stdin.write(buffer)) {&#xA;            buffer = Buffer.alloc(0);&#xA;          } else {&#xA;            // Handle backpressure&#xA;            ffmpeg.stdin.once(&#x27;drain&#x27;, () => {&#xA;              buffer = Buffer.alloc(0);&#xA;              ffmpeg.stdin.setMaxListeners(20); // or a safe upper bound&#xA;            });&#xA;          }&#xA;        }&#xA;      } catch (e) {&#xA;        console.error("FFmpeg write error:", e);&#xA;      }&#xA;    }&#xA;  });&#xA;  &#xA;  ws.on(&#x27;close&#x27;, () => {&#xA;    console.log(&#x27;❌ WebSocket closed&#x27;);&#xA;    streamStarted = false;&#xA;&#xA;    if (ffmpeg){     // Write any remaining buffer&#xA;      if (buffer.length > 0 &amp;&amp; ffmpeg.stdin.writable) {&#xA;        console.log(`&#128229; Writing final ${buffer.length} bytes to FFmpeg`);&#xA;        ffmpeg.stdin.write(buffer);&#xA;      }&#xA;            &#xA;      // Gracefully close FFmpeg&#xA;      if (ffmpeg.stdin.writable) {&#xA;        ffmpeg.stdin.end();&#xA;      }&#xA;      &#xA;      setTimeout(() => {&#xA;        if (ffmpeg &amp;&amp; !ffmpeg.killed) {&#xA;          ffmpeg.kill(&#x27;SIGTERM&#x27;);&#xA;          setTimeout(() => {&#xA;            if (ffmpeg &amp;&amp; !ffmpeg.killed) {&#xA;              ffmpeg.kill(&#x27;SIGKILL&#x27;);&#xA;            }&#xA;          }, 5000);&#xA;        }&#xA;      }, 1000);&#xA;    }&#xA;  });&#xA;});&#xA;&#xA;wss.listen(8081, "localhost", () => {&#xA;  console.log("&#128752;️ Server listening on http://localhost:8081/ws");&#xA;});&#xA;

    &#xA;

    The problem statment :&#xA;Been facing error like pixels drops in the video, bad quality. FFmpeg is crashing with error :

    &#xA;

    FFmpeg Data: Input #0, matroska,webm, from &#x27;pipe:0&#x27;:&#xA;&#xA;FFmpeg Data:   Metadata:&#xA;    encoder         : Chrome&#xA;  Duration: N/A, start: 0.000000, bitrate: N/A&#xA;  Stream #0:0(eng): Audio: opus, 48000 Hz, mono, fltp (default)&#xA;&#xA;FFmpeg Data:   Stream #0:1(eng): Video: vp8, yuv420p(progressive), 640x480, SAR 1:1 DAR 4:3, &#xA;FFmpeg Data: 1k tbr, 1k tbn (default)&#xA;    Metadata:&#xA;      alpha_mode      : 1&#xA;&#xA;FFmpeg Data: Unknown pixel format requested: yuv420p .&#xA;&#xA;FFmpeg stdin error: write EPIPE&#xA;FFmpeg exited with code: 1, signal: null&#xA;FFmpeg exited with code 1&#xA;

    &#xA;