Recherche avancée

Médias (0)

Mot : - Tags -/presse-papier

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

Autres articles (26)

  • 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

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

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (5310)

  • Correct usage of fdkaac for liquidsoap->icecast

    1er février 2024, par user4893295

    Can't seem to get aac working using fdkaac with liquidsoap. It just seems to shutdown.

    


    TBF I have no idea which aot or transmux to use for "normal" icecast stuff. mp3 works fine, and the icecast server works fine with aac from other sources (BUTT etc).

    


    This is my starting point from the liquidsoap cookbook :

    


    %fdkaac(channels=2, samplerate=44100, bandwidth="auto", bitrate=64, afterburner=false, aot="mpeg2_he_aac_v2", transmux="adts", sbr_mode=false)


    


    And this is my output from liquidsoap :

    


    2024/02/01 20:49:05 [clock:3] Using native (high-precision) implementation for latency control
2024/02/01 20:49:07 [main:3] Standard library loaded in 1.64 seconds.
2024/02/01 20:49:07 [lang:2] WARNING: "set" is deprecated and will be removed in future version. Please use `settings.path.to.key := value`
2024/02/01 20:49:07 [lang:2] WARNING: "set" is deprecated and will be removed in future version. Please use `settings.path.to.key := value`
2024/02/01 20:49:07 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.
2024/02/01 20:49:07 [frame:3] Video frame size set to: 1280x720
2024/02/01 20:49:07 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2024/02/01 20:49:07 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2024/02/01 20:49:07 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2024/02/01 20:49:07 [sandbox:3] Could not find binary bwrap, disabling sandboxing.
2024/02/01 20:49:07 [startup:3] DSSI plugins registration: 0.00s
2024/02/01 20:49:07 [startup:3] FFmpeg filters registration: 0.02s
2024/02/01 20:49:07 [startup:3] FFmpeg bitstream filters registration: 0.00s
2024/02/01 20:49:07 [startup:3] Lilv plugins registration: 0.00s
2024/02/01 20:49:07 [startup:3] Frei0r plugin registration: 0.00s
2024/02/01 20:49:07 [startup:3] LADSPA plugins registration: 0.00s
2024/02/01 20:49:07 [startup:3] Typechecking: 1.36s
2024/02/01 20:49:07 [startup:3] Evaluation: 0.01s
2024/02/01 20:49:07 [startup:3] Typechecking: 0.02s
2024/02/01 20:49:07 [startup:3] Evaluation: 0.00s
2024/02/01 20:49:07 [startup:3] Typechecking: 0.00s
2024/02/01 20:49:07 [startup:3] Evaluation: 0.00s
2024/02/01 20:49:07 [startup:3] Typechecking: 0.00s
2024/02/01 20:49:07 [startup:3] Evaluation: 0.08s
2024/02/01 20:49:07 [startup:3] Loaded /etc/liquidsoap/index.liq: 0.08s
2024/02/01 20:49:07 [64_aac:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [cross:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [on_track:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [promos.2:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [promos:3] Content type is {}.
2024/02/01 20:49:07 [current:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [music.3:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [music.2:3] Content type is {}.
2024/02/01 20:49:07 [music:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [safe_blank:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [clock.main:3] Streaming loop starts in auto-sync mode
2024/02/01 20:49:07 [clock.main:3] Delegating synchronization to CPU clock
2024/02/01 20:49:07 [video.converter:3] Using preferred video converter: ffmpeg.
2024/02/01 20:49:07 [audio.converter:3] Using samplerate converter: libsamplerate.
2024/02/01 20:49:07 [video.text:3] Using sdl implementation
2024/02/01 20:49:07 [mksafe:3] Switch to safe_blank.
2024/02/01 20:49:07 [clock.main:2] Source 64_aac failed while streaming: Lang.Runtime_error { kind: "encoder", msg: "Invalid configuration: aot", pos: [at /etc/liquidsoap/index.liq, line 52, char 2-144] }!
2024/02/01 20:49:07 [clock.main:2] Raised at Liquidsoap_lang__Runtime_error.raise in file "src/lang/runtime_error.ml", line 48, characters 14-21
2024/02/01 20:49:07 [clock.main:2] Called from Stdlib__List.iter in file "list.ml", line 110, characters 12-15
2024/02/01 20:49:07 [clock.main:2] Called from Fdkaac_encoder.create_encoder in file "src/core/encoder/encoders/fdkaac_encoder.ml", line 69, characters 2-22
2024/02/01 20:49:07 [clock.main:2] Called from Fdkaac_encoder.encoder in file "src/core/encoder/encoders/fdkaac_encoder.ml", line 73, characters 12-35
2024/02/01 20:49:07 [clock.main:2] Called from Encoder.get_factory.(fun) in file "src/core/encoder/encoder.ml", line 344, characters 8-32
2024/02/01 20:49:07 [clock.main:2] Called from Icecast2.output#icecast_start in file "src/core/outputs/icecast2.ml", line 555, characters 16-67
2024/02/01 20:49:07 [clock.main:2] Called from Icecast2.output#send in file "src/core/outputs/icecast2.ml", line 544, characters 12-30
2024/02/01 20:49:07 [clock.main:2] Called from Output.encoded#send_frame.output_chunks.f in file "src/core/outputs/output.ml", line 256, characters 10-24
2024/02/01 20:49:07 [clock.main:2] Called from Output.output#output in file "src/core/outputs/output.ml", line 192, characters 45-70
2024/02/01 20:49:07 [clock.main:2] Called from Clock.MkClock.clock#end_tick.(fun) in file "src/core/clock.ml", line 318, characters 16-24
Incorrect BOM value
Error reading lyrics, skipped
2024/02/01 20:49:07 [clock.main:2]
[mp3 @ 0x7fd5ad428000] Estimating duration from bitrate, this may be inaccurate
2024/02/01 20:49:07 [decoder.ffmpeg:3] Requested content-type for "/data/dropbox/promos/current/24-7 promo 1 remix.mp3": {audio=pcm(stereo)}
2024/02/01 20:49:07 [decoder.ffmpeg:3] FFmpeg recognizes "/data/dropbox/promos/current/24-7 promo 1 remix.mp3" as audio: {codec: mp3, 44100Hz, 2 channel(s)}
2024/02/01 20:49:07 [decoder.ffmpeg:3] Decoded content-type for "/data/dropbox/promos/current/24-7 promo 1 remix.mp3": {audio=pcm(stereo)}
2024/02/01 20:49:07 [decoder.ffmpeg:3] Requested content-type for "/data/music/Bruno Mars - Locked out of Heaven.mp3": {audio=pcm(stereo)}
2024/02/01 20:49:07 [decoder.ffmpeg:3] FFmpeg recognizes "/data/music/Bruno Mars - Locked out of Heaven.mp3" as audio: {codec: mp3, 44100Hz, 2 channel(s)}, video: {codec: mjpeg, 640x640, yuvj444p}, video_2: {codec: mjpeg, 640x640, yuvj444p}
2024/02/01 20:49:07 [decoder.ffmpeg:3] Decoded content-type for "/data/music/Bruno Mars - Locked out of Heaven.mp3": {audio=pcm(stereo)}
Incorrect BOM value
Error reading lyrics, skipped
[mp3 @ 0x7fd5ad428000] Estimating duration from bitrate, this may be inaccurate
2024/02/01 20:49:07 [clock.main:3] Streaming loop stopped.
2024/02/01 20:49:07 [threads:3] Main loop exited
2024/02/01 20:49:07 [main:3] Shutdown started!
2024/02/01 20:49:07 [threads:3] Waiting for main threads to terminate...
2024/02/01 20:49:07 [threads:3] Main threads terminated.
2024/02/01 20:49:07 [threads:3] Shutting down scheduler...
2024/02/01 20:49:07 [threads:3] Scheduler shut down.
2024/02/01 20:49:07 [main:3] Cleaning downloaded files...
2024/02/01 20:49:07 [main:3] Freeing memory...
2024/02/01 20:49:07 >>> LOG END


    


    EDIT it does seem to be using video, which wouldn't help ? Looking at this bit :

    


    2024/02/01 20:49:07 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.
2024/02/01 20:49:07 [frame:3] Video frame size set to: 1280x720


    


    But no idea why or how to stop that...

    


  • FFMPEG is not working in app service post deployment

    1er mars 2024, par Tushar Gupta

    I using the Xabe.FFmpeg package to generate clips from a video. The code is basically converting a video to multiple clips and it's working fine in my local but whenever I am uploading the code to app service the code is not working.

    


    Stack : .net
App Service OS : Windows

    


    Error :

    


    2024-02-13 08:57:34.092 +00:00 [Error] Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer : Connection ID "16573246629528734243", Request ID "40000a24-0000-e600-b63f-84710c7967bb" : An unhandled exception was thrown by the application.System.ComponentModel.Win32Exception (193) : An error occurred trying to start process 'C :\home\site\wwwroot\Controllers\ffmpeg\bin\ffmpeg.exe' with working directory 'C :\home\site\wwwroot'. The specified executable is not a valid application for this OS platform.at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)at System.Diagnostics.Process.Start()at Xabe.FFmpeg.FFmpeg.RunProcess(String args, String processPath, Nullable1 priority, Boolean standardInput, Boolean standardOutput, Boolean standardError)at Xabe.FFmpeg.FFmpegWrapper.&lt;>c__DisplayClass14_0.<runprocess>b__0()at System.Threading.Tasks.Task</runprocess>1.InnerInvoke()at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj)at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)--- End of stack trace from previous location ---at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)--- End of stack trace from previous location ---at Xabe.FFmpeg.Conversion.Start(String parameters, CancellationToken cancellationToken)at ExtractResponseAPI.Controllers.HomeController.PrepareVideoClips(CloudBlockBlob sourceVideoBlob, TimeSpan startTime, TimeSpan endTime) in C :\Users\tushar.h.gupta\source\repos\ExtractResponseAPI\Controllers\HomeController.cs:line 164at ExtractResponseAPI.Controllers.HomeController.GetIntervalsAsync(String query) in C :\Users\tushar.h.gupta\source\repos\ExtractResponseAPI\Controllers\HomeController.cs:line 60at ExtractResponseAPI.Controllers.HomeController.Get(String query) in C :\Users\tushar.h.gupta\source\repos\ExtractResponseAPI\Controllers\HomeController.cs:line 24at lambda_method4(Closure, Object)at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<invokenextactionfilterasync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State&amp; next, Scope&amp; scope, Object&amp; state, Boolean&amp; isCompleted)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<invokeinnerfilterasync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<invokefilterpipelineasync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<invokeasync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<invokeasync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT</invokeasync></invokeasync></invokefilterpipelineasync></invokeinnerfilterasync></invokenextactionfilterasync>1.ProcessRequestAsync()

    &#xA;

    Code :

    &#xA;

    private async Task> PrepareVideoClips(CloudBlockBlob sourceVideoBlob, TimeSpan startTime, TimeSpan endTime)&#xA;{&#xA;    string tempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());&#xA;&#xA;    // Create a temporary directory to store clips locally&#xA;    Directory.CreateDirectory(tempDirectory);&#xA;&#xA;    // Download the source video&#xA;    string sourceVideoPath = Path.Combine(tempDirectory, "sourceVideo.mp4");&#xA;    await sourceVideoBlob.DownloadToFileAsync(sourceVideoPath, FileMode.Create);&#xA;    FFmpeg.SetExecutablesPath("Controllers\\ffmpeg\\bin\\");&#xA;    // Use FFmpegCore to trim the video&#xA;    string outputVideoPath = Path.Combine(tempDirectory, "output.mp4");&#xA;&#xA;    await FFmpeg.Conversions.New()&#xA;        .AddParameter($"-ss {startTime.TotalSeconds}") // Start time&#xA;        .AddParameter($"-i {sourceVideoPath}")&#xA;        .AddParameter($"-to {(endTime - startTime).TotalSeconds}") // Duration&#xA;        .SetOutput(outputVideoPath)&#xA;        .Start();&#xA;&#xA;    // Return a list of file paths for the clips&#xA;    return new List<string> { outputVideoPath };&#xA;}&#xA;</string>

    &#xA;

    I tried deploying the app service using different OS but still facing the same issue, I also tried using different packages but the result is same.

    &#xA;

  • Stream sent via FFMPEG (NodeJS) to RTMP (YouTube) not being received

    10 décembre 2024, par Qumber

    I am writing a very basic chrome extension that captures and sends video stream to a nodeJS server, which in turns sends it to Youtube live server.

    &#xA;

    Here is my implementation of the backend which receives data via WebRTC and send to YT using FFMPEG :

    &#xA;

    const express = require(&#x27;express&#x27;);&#xA;const cors = require(&#x27;cors&#x27;);&#xA;const { RTCPeerConnection, RTCSessionDescription } = require(&#x27;@roamhq/wrtc&#x27;);&#xA;const { spawn } = require(&#x27;child_process&#x27;);&#xA;&#xA;const app = express();&#xA;app.use(express.json());&#xA;app.use(cors());&#xA;&#xA;app.post(&#x27;/webrtc&#x27;, async (req, res) => {&#xA;  const peerConnection = new RTCPeerConnection();&#xA;&#xA;  // Start ffmpeg process for streaming&#xA;  const ffmpeg = spawn(&#x27;ffmpeg&#x27;, [&#xA;    &#x27;-f&#x27;, &#x27;flv&#x27;,&#xA;    &#x27;-i&#x27;, &#x27;pipe:0&#x27;,&#xA;    &#x27;-c:v&#x27;, &#x27;libx264&#x27;,&#xA;    &#x27;-preset&#x27;, &#x27;veryfast&#x27;,&#xA;    &#x27;-maxrate&#x27;, &#x27;3000k&#x27;,&#xA;    &#x27;-bufsize&#x27;, &#x27;6000k&#x27;,&#xA;    &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;,&#xA;    &#x27;-g&#x27;, &#x27;50&#x27;,&#xA;    &#x27;-f&#x27;, &#x27;flv&#x27;,&#xA;    &#x27;rtmp://a.rtmp.youtube.com/live2/MY_KEY&#x27;&#xA;  ]);&#xA;&#xA;  ffmpeg.on(&#x27;error&#x27;, (err) => {&#xA;    console.error(&#x27;FFmpeg error:&#x27;, err);&#xA;  });&#xA;&#xA;  ffmpeg.stderr.on(&#x27;data&#x27;, (data) => {&#xA;    console.error(&#x27;FFmpeg stderr:&#x27;, data.toString());&#xA;  });&#xA;&#xA;  ffmpeg.stdout.on(&#x27;data&#x27;, (data) => {&#xA;    console.log(&#x27;FFmpeg stdout:&#x27;, data.toString());&#xA;  });&#xA;&#xA;  // Handle incoming tracks&#xA;  peerConnection.ontrack = (event) => {&#xA;    console.log(&#x27;Track received:&#x27;, event.track.kind);&#xA;    const track = event.track;&#xA;&#xA;    // Stream the incoming track to FFmpeg&#xA;    track.onunmute = () => {&#xA;      console.log(&#x27;Track unmuted:&#x27;, track.kind);&#xA;      const reader = track.createReadStream();&#xA;      reader.on(&#x27;data&#x27;, (chunk) => {&#xA;        console.log(&#x27;Forwarding chunk to FFmpeg:&#x27;, chunk.length);&#xA;        ffmpeg.stdin.write(chunk);&#xA;      });&#xA;      reader.on(&#x27;end&#x27;, () => {&#xA;        console.log(&#x27;Stream ended&#x27;);&#xA;        ffmpeg.stdin.end();&#xA;      });&#xA;    };&#xA;&#xA;    track.onmute = () => {&#xA;      console.log(&#x27;Track muted:&#x27;, track.kind);&#xA;    };&#xA;  };&#xA;&#xA;  // Set the remote description (offer) received from the client&#xA;  await peerConnection.setRemoteDescription(new RTCSessionDescription(req.body.sdp));&#xA;&#xA;  // Create an answer and send it back to the client&#xA;  const answer = await peerConnection.createAnswer();&#xA;  await peerConnection.setLocalDescription(answer);&#xA;&#xA;  res.json({ sdp: peerConnection.localDescription });&#xA;});&#xA;&#xA;app.listen(3000, () => {&#xA;  console.log(&#x27;WebRTC to RTMP server running on port 3000&#x27;);&#xA;});&#xA;&#xA;

    &#xA;

    This is the output I get, but nothing gets sent to YouTube :

    &#xA;

    &#xA;
    FFmpeg stderr: ffmpeg version 7.0.2 Copyright (c) 2000-2024 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.3.9.4)&#xA;&#xA;FFmpeg stderr:   configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.0.2_1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags=&#x27;-Wl,-ld_classic&#x27; --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --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-audiotoolbox --enable-neon&#xA;&#xA;FFmpeg stderr:   libavutil      59.  8.100 / 59.  8.100&#xA;  libavcodec     61.  3.100 / 61.  3.100&#xA;  libavformat    61.  1.100 / 61.  1.100&#xA;  libavdevice    61.  1.100 / 61.  1.100&#xA;&#xA;FFmpeg stderr:   libavfilter    10.  1.100 / 10.  1.100&#xA;  libswscale      8.  1.100 /  8.  1.100&#xA;  libswresample   5.  1.100 /  5.  1.100&#xA;  libpostproc    58.  1.100 / 58.  1.100&#xA;

    &#xA;

    &#xA;

    I do not understand what I am doing wrong. Any help would be appreciated.

    &#xA;


    &#xA;

    Optionally Here's the frontend code from the extension, which (to me) appears to be recording and sending the capture :

    &#xA;

    popup.js & popup.html

    &#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    document.addEventListener(&#x27;DOMContentLoaded&#x27;, () => {&#xA;  document.getElementById(&#x27;openCapturePage&#x27;).addEventListener(&#x27;click&#x27;, () => {&#xA;    chrome.tabs.create({&#xA;      url: chrome.runtime.getURL(&#x27;capture.html&#x27;)&#xA;    });&#xA;  });&#xA;});

    &#xD;&#xA;

    &#xA;&#xA;&#xA;&#xA;  &#xA;  <code class="echappe-js">&lt;script src='http://stackoverflow.com/feeds/tag/popup.js'&gt;&lt;/script&gt;&#xA;&#xA;&#xA;&#xA;  

    StreamSavvy

    &#xA;

    &#xA;&#xA;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;

    capture.js & capture.html

    &#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    let peerConnection;&#xA;&#xA;async function startStreaming() {&#xA;  try {&#xA;    const stream = await navigator.mediaDevices.getDisplayMedia({&#xA;      video: {&#xA;        cursor: "always"&#xA;      },&#xA;      audio: false&#xA;    });&#xA;&#xA;    peerConnection = new RTCPeerConnection({&#xA;      iceServers: [{&#xA;        urls: &#x27;stun:stun.l.google.com:19302&#x27;&#xA;      }]&#xA;    });&#xA;&#xA;    stream.getTracks().forEach(track => peerConnection.addTrack(track, stream));&#xA;&#xA;    const offer = await peerConnection.createOffer();&#xA;    await peerConnection.setLocalDescription(offer);&#xA;&#xA;    const response = await fetch(&#x27;http://localhost:3000/webrtc&#x27;, {&#xA;      method: &#x27;POST&#x27;,&#xA;      headers: {&#xA;        &#x27;Content-Type&#x27;: &#x27;application/json&#x27;&#xA;      },&#xA;      body: JSON.stringify({&#xA;        sdp: peerConnection.localDescription&#xA;      })&#xA;    });&#xA;&#xA;    const {&#xA;      sdp&#xA;    } = await response.json();&#xA;    await peerConnection.setRemoteDescription(new RTCSessionDescription(sdp));&#xA;&#xA;    console.log("Streaming to server via WebRTC...");&#xA;  } catch (error) {&#xA;    console.error("Error starting streaming:", error.name, error.message);&#xA;  }&#xA;}&#xA;&#xA;async function stopStreaming() {&#xA;  if (peerConnection) {&#xA;    // Stop all media tracks&#xA;    peerConnection.getSenders().forEach(sender => {&#xA;      if (sender.track) {&#xA;        sender.track.stop();&#xA;      }&#xA;    });&#xA;&#xA;    // Close the peer connection&#xA;    peerConnection.close();&#xA;    peerConnection = null;&#xA;    console.log("Streaming stopped");&#xA;  }&#xA;}&#xA;&#xA;document.addEventListener(&#x27;DOMContentLoaded&#x27;, () => {&#xA;  document.getElementById(&#x27;startCapture&#x27;).addEventListener(&#x27;click&#x27;, startStreaming);&#xA;  document.getElementById(&#x27;stopCapture&#x27;).addEventListener(&#x27;click&#x27;, stopStreaming);&#xA;});

    &#xD;&#xA;

    &#xA;&#xA;&#xA;&#xA;  &#xA;  <code class="echappe-js">&lt;script src='http://stackoverflow.com/feeds/tag/capture.js'&gt;&lt;/script&gt;&#xA;&#xA;&#xA;&#xA;  

    StreamSavvy Capture

    &#xA;

    &#xA;

    &#xA;&#xA;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;

    background.js (service worker)

    &#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    chrome.runtime.onInstalled.addListener(() => {&#xA;  console.log("StreamSavvy Extension Installed");&#xA;});&#xA;&#xA;chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {&#xA;  if (message.type === &#x27;startStreaming&#x27;) {&#xA;    chrome.tabs.create({&#xA;      url: chrome.runtime.getURL(&#x27;capture.html&#x27;)&#xA;    });&#xA;    sendResponse({&#xA;      status: &#x27;streaming&#x27;&#xA;    });&#xA;  } else if (message.type === &#x27;stopStreaming&#x27;) {&#xA;    chrome.tabs.query({&#xA;      url: chrome.runtime.getURL(&#x27;capture.html&#x27;)&#xA;    }, (tabs) => {&#xA;      if (tabs.length > 0) {&#xA;        chrome.tabs.sendMessage(tabs[0].id, {&#xA;          type: &#x27;stopStreaming&#x27;&#xA;        });&#xA;        sendResponse({&#xA;          status: &#x27;stopped&#x27;&#xA;        });&#xA;      }&#xA;    });&#xA;  }&#xA;  return true; // Keep the message channel open for sendResponse&#xA;});

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;