Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (62)

  • L’agrémenter visuellement

    10 avril 2011

    MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
    Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

Sur d’autres sites (11664)

  • Encountered an exception of ffmpeg.wasm can only run one command at a time

    2 mars 2023, par Itay113

    I want to make a video chat using ffmepg wasm (I know the standard is WebRTC but my assignment is to do this with ffmpeg wasm and a server connecting the 2 clients) and when doing the follow code I am getting ffmpeg.wasm can only run one command at a time exception on the ffmpegWorker.run line

    


    function App() {&#xA;  const ffmpegWorker = createFFmpeg({&#xA;    log: true&#xA;  })&#xA;&#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;    ffmpegWorker.run(&#x27;-i&#x27;, name, &#x27;-preset&#x27;, &#x27;ultrafast&#x27;, &#x27;-c:v&#x27;, &#x27;h264&#x27;, &#x27;-crf&#x27;, &#x27;28&#x27;, &#x27;-b:v&#x27;, &#x27;0&#x27;, &#x27;-row-mt&#x27;, &#x27;1&#x27;, &#x27;-f&#x27;, &#x27;mp4&#x27;, &#x27;output.mp4&#x27;)&#xA;    .then(()=> {&#xA;&#xA;      const data = ffmpegWorker.FS(&#x27;readFile&#x27;, &#x27;output.mp4&#x27;);&#xA;  &#xA;      const video = document.getElementById(&#x27;output-video&#x27;);&#xA;      video.src = URL.createObjectURL(new Blob([data.buffer], { type: &#x27;video/mp4&#x27; }));&#xA;      ffmpegWorker.FS(&#x27;unlink&#x27;, &#x27;output.mp4&#x27;);&#xA;    })&#xA;  }&#xA;&#xA;  function requestMedia() {&#xA;    const webcam = document.getElementById(&#x27;webcam&#x27;);&#xA;    const chunks = []&#xA;    navigator.mediaDevices.getUserMedia({ video: true, audio: true })&#xA;    .then(async (stream) => {&#xA;      webcam.srcObject = stream;&#xA;      await webcam.play();&#xA;      const mediaRecorder = new MediaRecorder(stream);&#xA;      mediaRecorder.start(0);&#xA;      mediaRecorder.onstop = function(e) {&#xA;        stream.stop();   &#xA;      }&#xA;      mediaRecorder.ondataavailable = async function(e) {&#xA;        chunks.push(e.data);&#xA;        await transcode(new Uint8Array(await (new Blob(chunks)).arrayBuffer()));&#xA;        &#xA;      }&#xA;    })&#xA;  }&#xA;&#xA;  useEffect(() => {&#xA;    requestMedia();&#xA;  }, [])&#xA;&#xA;  return (&#xA;    <div classname="App">&#xA;      <div>&#xA;          <video width="320px" height="180px"></video>&#xA;          <video width="320px" height="180px"></video>&#xA;      </div>&#xA;    </div>&#xA;  );&#xA;}&#xA;

    &#xA;

    I have tried messing around with the time slice on the media recorder start method argument but it didn't helped

    &#xA;

  • What's the easiest way to convert ogg to webm on Node without ffmpeg ?

    12 mars 2023, par Evert

    I'm working on a Telegram bot that can receive voice messages and then let OpenAI's Whisper transcribe them and then respond using OpenAI's chat completions API.

    &#xA;

    Anyway, Whisper does accept a webm file as an input, but not an ogg file. Even though ironically, from what I've read, a webm container can contain a pure ogg file as its soundtrack.

    &#xA;

    I can't use ffmpeg, because I'm deploying this as a serverless function (on Vercel for now) and I have no guarantee that ffmpeg will be installed there. But I was thinking, since webm is simply a container file which can contain the raw ogg opus codec as the soundtrack, wouldn't it be possible to just take the binary audio data that I can get from Telegram, using const audioData = await response.arrayBuffer(), and just add some bytes to the beginning and end of it that represent the webm container ?

    &#xA;

    If yes, then can someone please tell me which bytes I'd need to add exactly ?

    &#xA;

  • Discord Voice Bot cannot play the audio file

    7 avril 2023, par Jakub Nawrocki

    I tried to write a bot that will join the voice channel and play a audio at 20:00.

    &#xA;

    Currently the bot joins the channel, but immediately after that it disconnects without making a single sound with this message :

    &#xA;

    2023-04-07 17:58:01 INFO     discord.player ffmpeg process 18258 has not terminated. Waiting to terminate... 2023-04-07 17:58:01 INFO     discord.player ffmpeg process 18258 should have terminated with a return code of -9. 2023-04-07 17:58:01 INFO     discord.voice_client The voice handshake is being terminated for Channel ID 1093533451778523241 (Guild ID 1093533451778523237) 2023-04-07 17:58:01 INFO     discord.voice_client Disconnecting from voice normally, close code 1000. Audio file loaded:  Audio could not be played:

    &#xA;

    Code :

    &#xA;

    import discord&#xA;import asyncio&#xA;import datetime&#xA;&#xA;TOKEN = &#x27;TOKEN HERE&#x27; &#xA;CHANNEL_ID = CHANNEL ID HERE&#xA;&#xA;client = discord.Client(intents=discord.Intents.all())&#xA;&#xA;async def play_sound(voice_client):&#xA;    try:&#xA;        source = discord.FFmpegPCMAudio(&#x27;audio.mp3&#x27;)&#xA;        print(f"Audio file loaded: {source}")&#xA;        voice_client.play(source)&#xA;        while voice_client.is_playing():&#xA;            await asyncio.sleep(1)&#xA;    except Exception as e:&#xA;        print(f"Audio could not be played: {e}")&#xA;&#xA;@client.event&#xA;async def on_ready():&#xA;    print(&#x27;Bot is ready&#x27;)&#xA;    now = datetime.datetime.now()&#xA;    target_time = datetime.time(hour=20, minute=00)&#xA;    if now.time() >= target_time:&#xA;        print(f"Current time: {now.time()}. Bot did not join channel.")&#xA;        return&#xA;    else:&#xA;        print(f"Current time: {now.time()}. Bot has joined at {target_time}.")&#xA;        await asyncio.sleep((datetime.datetime.combine(datetime.date.today(), target_time) - now).total_seconds())&#xA;        channel = client.get_channel(CHANNEL_ID)&#xA;        if channel is not None:&#xA;            try:&#xA;                voice_client = await channel.connect()&#xA;                print(f&#x27;{client.user} joined voice chat.&#x27;)&#xA;                await asyncio.sleep(1)&#xA;                await play_sound(voice_client)&#xA;                await voice_client.disconnect()&#xA;                print(f&#x27;{client.user} left voice chat.&#x27;)&#xA;            except Exception as e:&#xA;&#xA;                print(f"Error during joining channel : {e}")&#xA;        else:&#xA;            print(f"Did not find a channel of ID {CHANNEL_ID}.")&#xA;&#xA;client.run(TOKEN)&#xA;

    &#xA;

    Any ideas ?

    &#xA;

    ffmpeg has been installed properly.

    &#xA;