Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (14)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

Sur d’autres sites (3701)

  • Can ffmpeg transcode an audio track and add it as a second audio track at the same time, or if not, how to do it as separate commands ?

    31 mai 2020, par wb6vpm

    A bit of history. I am using Plex as my media server, but for reasons unknown, it has issues transcoding the DTS-HD MA 7.1 audio to EAC3 stereo and keeps buffering (the server has plenty of horsepower on all fronts, CPU/RAM/drive space & speed, gigabit networks connections for all devices. The playback device (TCL Roku TV, with a 3rd party soundbar connected via HDMI ARC) doesn't support the built-in 7.1 audio, so I get silence if I play it back directly by putting the file on a USB stick.

    



    Also, I am by no means a ffmpeg guru, I figured out what I do know by Google University and asking questions, so please be kind and forgive me if I ask follow-up questions that may seem n00b-ish, and please provide example commands (preferably in the context of my command below so that I can have a known point of reference to start with).

    



    I have a movie with 4K (HEVC Main 10 HDR) video and DTS-HD MA 7.1 audio that I am looking to leave the video and audio untouched, but to add a 2nd audio track in either EAC3 or if necessary, just AC3 in stereo

    



    So what I am looking for is as follows :

    



    video.mkv

    



      

    • Existing->4k video file (no change)
    • 


    • Existing->7.1 audio (no change)
    • 


    • Convert and add->stereo audio as a 2nd audio track to the output.mkv file
    • 


    



    Below is the command I've historically used with ffmpeg to convert and replace the audio file with the stereo audio, but since I'd prefer to leave the 7.1 audio in place, this doesn't work :
ffmpeg -i "D:\video.mkv" -c:v copy -c:a aac -b:a 128k "D:\output.mkv"

    



    And if this cannot be done as a single command, please also let me know what steps I do need to take to be able to do it.

    



    Thanks in advace,
Mike

    


  • Persistent AbortError During Reconnection Attempts in Discord Bot

    17 mai 2024, par Nerevaine

    I'm working on a Discord bot that connects to a voice channel, listens to the audio, and sends it to a WebSocket server. Initially, everything works fine, but after some time, when I try to reconnect after losing the connection, I encounter `AbortError` repeatedly. Despite several attempts to handle this error, the problem persists. The error occurs during the reconnection attempts. Here is the error message I keep receiving :

    


    Attempting to reconnect: Try 1 of 5Reconnect attempt 2 failed: AbortError: The operation was abortedat EventTarget.abortListener (node:events:1008:14)at [nodejs.internal.kHybridDispatch] (node:internal/event_target:822:20)at EventTarget.dispatchEvent (node:internal/event_target:757:26)at abortSignal (node:internal/abort_controller:374:10)at AbortController.abort (node:internal/abort_controller:396:5)at Timeout.<anonymous> (/path/to/project/node_modules/@discordjs/voice/dist/index.js:1931:39)at listOnTimeout (node:internal/timers:573:17)at process.processTimers (node:internal/timers:514:7) {code: &#x27;ABORT_ERR&#x27;,[cause]: DOMException [AbortError]: This operation was abortedat new DOMException (node:internal/per_context/domexception:53:5)at AbortController.abort (node:internal/abort_controller:395:18)at Timeout.<anonymous> (/path/to/project/node_modules/@discordjs/voice/dist/index.js:1931:39)at listOnTimeout (node:internal/timers:573:17)at process.processTimers (node:internal/timers:514:7)}&#xA;</anonymous></anonymous>

    &#xA;

    Here are the key parts of the code I use to handle the connection and reconnection attempts :

    &#xA;

    1. Handling Connection and WebSocket :

    &#xA;

    let connection; let count = 0;  await entersState(connection, VoiceConnectionStatus.Ready, 30000); console.log(&#x27;Voice connection ready:&#x27;, voiceChannel.id); let player = createAudioPlayer(); connection.subscribe(player);  let ws = new WebSocket(&#x27;ws://...&#x27;);  ws.on(&#x27;open&#x27;, () => {   console.log(&#x27;WebSocket connection opened&#x27;);   voiceChannel.members.forEach(member => {     if (member.user.id !== client.user.id) {       member.voice.setMute(false);     }   }); });  ws.on(&#x27;error&#x27;, (error) => {   console.error(&#x27;WebSocket error:&#x27;, error); });  ws.on(&#x27;close&#x27;, () => {   console.log(&#x27;WebSocket connection closed, attempting to reconnect...&#x27;);   reconnectWebSocket(ws); });&#xA;

    &#xA;

      &#xA;
    1. Reconnecting Logic :
    2. &#xA;

    &#xA;

    async function attemptReconnect(client, voiceChannel, player, retries = 5, delay = 10000) {&#xA;  for (let i = 0; i &lt; retries; i&#x2B;&#x2B;) {&#xA;    try {&#xA;      console.log(`Attempting to reconnect: Try ${i &#x2B; 1} of ${retries}`);&#xA;      connection.destroy();&#xA;      connection = joinVoiceChannel({&#xA;        channelId: voiceChannel.id,&#xA;        guildId: voiceChannel.guild.id,&#xA;        adapterCreator: voiceChannel.guild.voiceAdapterCreator,&#xA;        selfDeaf: false,&#xA;        selfMute: false&#xA;      });&#xA;&#xA;      await entersState(connection, VoiceConnectionStatus.Ready, 30000);&#xA;      console.log(&#x27;Reconnected to voice channel:&#x27;, voiceChannel.id);&#xA;      connection.subscribe(player);&#xA;      return;&#xA;    } catch (error) {&#xA;      console.error(`Reconnect attempt ${i &#x2B; 1} failed:`, error);&#xA;      if (error.code === &#x27;ABORT_ERR&#x27;) {&#xA;        console.log(&#x27;Reconnect attempt aborted, will retry&#x27;);&#xA;      }&#xA;      if (i &lt; retries - 1) {&#xA;        await new Promise(resolve => setTimeout(resolve, delay));&#xA;        delay *= 2; // Increase delay exponentially&#xA;      }&#xA;    }&#xA;  }&#xA;  console.error(&#x27;Failed to reconnect to voice channel after several attempts, restarting connection&#x27;);&#xA;  restartConnection(client, voiceChannel);&#xA;}&#xA;

    &#xA;

      &#xA;
    1. Restarting Connection :
    2. &#xA;

    &#xA;

    function restartConnection(client, voiceChannel) {&#xA;  try {&#xA;    if (connection) {&#xA;      connection.destroy();&#xA;      console.log(&#x27;Connection destroyed&#x27;);&#xA;    }&#xA;    handleAudio(client, voiceChannel);&#xA;  } catch (error) {&#xA;    console.error(&#x27;Error restarting connection:&#x27;, error);&#xA;  }&#xA;}&#xA;

    &#xA;

      &#xA;
    • Implement Exponential Retries : I have increased the delay between each reconnection attempt.
    • &#xA;

    • Destroy and Recreate Connections : Ensure the voice and WebSocket connections are destroyed before reconnecting.
    • &#xA;

    • Restart Complete Connection : After several failed attempts, I attempt to restart the entire connection.
    • &#xA;

    &#xA;

  • DirectShow RTSP SourceFilter with MPEG-4 Video Stream

    5 octobre 2011, par 6.45.Vapuru

    I create a simple direct show source filter using FFmpeg.I read rtp packets from RTSP source and give them to decoder. It works for h264 stream.

    MyRtspSourceFilter[H264 Stream] ---> h264 Decoder --> Video Renderer

    The bad news is that it does not work for MPEG-4. I can able to connect my rtsp source filter with MPEG-Decoder. I got no exception but video renderer does not show anything. Actually just show one frame then nothing [just stop]... Decoders and Renderers are 3rd party so i can not debug them.

    MyRtspSourceFilter[MP4 Stream] ---> MPEG-4 Decoder --> Video Renderer

    I can able to get rtp packets from MPEG-4 RTSP Source using FFmpeg sucessfully.There is no problem with it.

    It seems that i have not set something(?) in my Rtsps Source
    Filter which is not necessary for H264 stream but may be important for
    MPEG-4 stream

    What may cause this h264 stream and MPEG-4 stream difference in a direct show rtsp source filter ? Any ideas.

    More Info :

    — First i try some other rtsp source filters for MPEG-4 Stream...Although my rtsp source is same i see different subtypes in their pin connections.

    — Secondly i realy get suspicious if the source is really MPEG-4 SO i check with FFmpeg...FFmpeg gives the source codec id as "CODEC_ID_MPEG4".

    Update :
    [ Hack ]

    I just set m_bmpInfo.biCompression = DWORD('xvid') it just worked fine...But it is static. How to dynamically get/determine this value using ffmpeg or other ways...