Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (66)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

Sur d’autres sites (6790)

  • Keep getting "discord.ext.commands.errors.CommandInvokeError : Command raised an exception : KeyError : 'source'" error

    22 février 2023, par kris

    Everytime I try to run play command in my bot, I get this error in the terminal, kind of new to coding so not exactly sure whats going on. It was working just fine, then it started not to work.

    


    import discord

from discord.ext import commands

from youtube_dl import YoutubeDL

class music_cog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        
        self.is_playing = False
        self.is_paused = False

        self.music_queue = []
        self.YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist': 'True'}
        self.FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}

        self.vc = None

    def search_yt(self, item):
        with YoutubeDL(self.YDL_OPTIONS) as ydl:
            try:
                info = ydl.extract_info("ytsearch:%s" % item, download=False)['entries'][0]
            except Exception:
                return False
        return {'sourcffmpege': info['formats'][0]['url'], 'title': info['title']}
    
    def play_next(self):
        if len(self.music_queue) > 0:
            self.is_playing = True

            m_url = self.music_queue[0][0]['source']

            self.music_queue.pop(0)

            self.vc.play(discord.FFmpegPCMAudio(executable="ffmpeg", source=m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())
        else:
            self.is_playing = False

    async def play_music(self, ctx):
        if len(self.music_queue) > 0:
            self.is_playing = True

            m_url=self.music_queue[0][0]['source']

            if self.vc == None or not self.vc.is_connected():
                self.vc = await self.music_queue[0][1].connect()

                if self.vc == None:
                    await ctx.send("Could not connect to the voice channel")
                    return
            else:
                await self.vc.move_to(self.music_queue[0][1])

            self.music_queue.pop(0)

            self.vc.play(discord.FFmpegPCMAudio(executable="ffmpeg", source=m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())

    @commands.command(name="play", aliases=["p", "playing"], help="Play the selected song from youtube")
    async def play(self, ctx, *args):
        query = " ".join(args)

        voice_channel = ctx.author.voice.channel
        if voice_channel is None:
            await ctx.send("Connect to a voice channel!")
        elif self.is_paused:
            self.vc.resume()
        else:
            song = self.search_yt(query)
            if type(song) == type(True):
                await ctx.send("Could not download the song. Incorrect format, try a different keyword")
            else:
                await ctx.send("Song added to the queue")
                self.music_queue.append([song, voice_channel])

                if self.is_playing == False:
                    await self.play_music(ctx)

    @commands.command(name="pause", help="Pauses the current song being played")
    async def pause(self, ctx, *args):
        if self.is_playing:
            self.is_playing = False
            self.is_paused = True
            self.vc.pause()
        elif self.is_paused:
            self.vc.resume()

    @commands.command(name="resume", aliases=["r"], help="Resumes playing the current song")
    async def resume(self, ctx, *args):
        if self.is_paused:
            self.is_playing = True
            self.is_paused = False
            self.vc.resume()

    @commands.command(name="skip", aliases=["s"], help="Skips the currently played song")
    async def skip(self, ctx, *args):
        if self.vc != None and self.vc:
            self.vc.stop()
            await self.play_music(ctx)

    @commands.command(name="queue", aliases=["q"], help="Displays all the songs currently in the queue")
    async def queue(self, ctx):
        retval = ""

        for i in range(0, len(self.music_queue)):
            if i > 5: break
            retval += self.music_queue[i][0]['title'] + '\n'

        if retval != "":
            await ctx.send(retval)
        else:
            await ctx.send("No music in queue.")
    
    @commands.command(name="clear", aliases=["c", "bin"], help="Stops the current song and clears the queue")
    async def clear(self, ctx, *args):
        if self.vc != None and self.is_playing:
            self.vc.stop()
        self.music_queue = []
        await ctx.send("Music queue cleared")

    @commands.command(name="leave", aliases=["l"], help="Kicks the bot from the voice channel")
    async def leave(self, ctx):
        self.is_playing = False
        self.is_paused = False
        await self.vc.disconnect()

async def setup(bot):
    await bot.add_cog(music_cog(bot))


    


    this is my music_cogs.py, this is where error is coming from

    


    was working just fine then it started to give me this error after a while.

    


    raceback (most recent call last):
  File "C:\Users\poopt\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 229, in wrapped
    ret = await coro(*args, **kwargs)
  File "c:\Users\poopt\Code\cool_bot\cogs\music_cog.py", line 77, in play
    await self.play_music(ctx)
  File "c:\Users\poopt\Code\cool_bot\cogs\music_cog.py", line 44, in play_music
    m_url=self.music_queue[0][0]['source']
KeyError: 'source'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
 line 1349, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\poopt\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 1023, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "C:\Users\poopt\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 238, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'source'


    


  • Error : "libavformat\avformat.h : No such file or directory"

    21 février 2023, par Abdo Daood

    I create a simple c++ file called test.cpp :

    


    #include <iostream>&#xA;#include &#xA;using namespace std;&#xA;&#xA;int main() &#xA;{&#xA;    cout &lt;&lt; "Hello, World!";&#xA;    return 0;&#xA;}&#xA;</iostream>

    &#xA;

    and using g++ in terminal to compile test.cpp file with the command :

    &#xA;

    g&#x2B;&#x2B; test.cpp -o test&#xA;

    &#xA;

    I get this error :

    &#xA;

    test.cpp:2:10: fatal error: libavformat\avformat.h: No such file or directory&#xA;    2 | #include &#xA;      |          ^~~~~~~~~~~~~~~~~~~~~~~~&#xA;compilation terminated.&#xA;

    &#xA;

    Notes :&#xA;libavformat\avformat.h path is : /usr/include/x86_64-linux-gnu/libavformat/avformat.h

    &#xA;

    and using ffmpeg version is :

    &#xA;

    $ ffmpeg -version&#xA;&#xA;ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers&#xA;built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)&#xA;configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared&#xA;libavutil      56. 70.100 / 56. 70.100&#xA;libavcodec     58.134.100 / 58.134.100&#xA;libavformat    58. 76.100 / 58. 76.100&#xA;libavdevice    58. 13.100 / 58. 13.100&#xA;libavfilter     7.110.100 /  7.110.100&#xA;libswscale      5.  9.100 /  5.  9.100&#xA;libswresample   3.  9.100 /  3.  9.100&#xA;libpostproc    55.  9.100 / 55.  9.100&#xA;

    &#xA;

    Using this command :

    &#xA;

    g&#x2B;&#x2B; `pkg-config --cflags libavformat` test.cpp  `pkg-config --libs libavformat` -o test&#xA;

    &#xA;

  • flient-ffmpeg getting error as "ffmpeg exited with code 1 : pipe:0 : Invalid data found when processing input"

    6 avril 2023, par Abhishek Rawal

    I am trying to create API where i need to get uploaded video and create thumbnail from that video. But conditions are :

    &#xA;

      &#xA;
    • Video should not store on local disk
    • &#xA;

    • Once thumbnail is create it should not store on local disk, instead it should directly uploaded to AWS s3 bucket.
    • &#xA;

    &#xA;

    Following is the code i am trying with :

    &#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    const ffmpeg = require(&#x27;fluent-ffmpeg&#x27;);&#xA;const stream = require(&#x27;stream&#x27;);&#xA;&#xA;router.post(&#x27;/thumbnail&#x27;, upload.any(), (req, res) => {&#xA;  const videoBuffer = req.files[0].buffer;&#xA;  &#xA;  let readableVideoBuffer = new stream.PassThrough();&#xA;    readableVideoBuffer.write(videoBuffer);&#xA;    readableVideoBuffer.end()&#xA;    &#xA;  let bufferStream = new stream.PassThrough();&#xA;  &#xA;  ffmpeg(readableVideoBuffer)&#xA;    .on(&#x27;filenames&#x27;, function(filenames) {&#xA;      console.log(&#x27;Will generate &#x27; &#x2B; filenames.join(&#x27;, &#x27;))&#xA;    })&#xA;    .on(&#x27;end&#x27;, function() {&#xA;      console.log(&#x27;Screenshots taken&#x27;);&#xA;    })&#xA;    .on(&#x27;error&#x27;, (err) => {&#xA;      console.log(err);&#xA;    })&#xA;    .screenshots({&#xA;      count: 4,&#xA;      size: &#x27;100x100&#x27;,&#xA;      timestamps: [&#x27;00:00:01.000&#x27;],&#xA;    })&#xA;    .writeToStream(bufferStream, { end: true });  /* while using this statement i am getting error */&#xA;    &#xA;    const buffers = [];&#xA;    bufferStream.on(&#x27;data&#x27;, function (buf) {&#xA;      buffers.push(buf);&#xA;    });&#xA;    bufferStream.on(&#x27;end&#x27;, function () {&#xA;      const outputBuffer = Buffer.concat(buffers);&#xA;      // use s3 bucket code here&#xA;      console.log(&#x27;outputBuffer===========>&#x27;, outputBuffer)&#xA;    });&#xA;})

    &#xD;&#xA;

    &#xD;&#xA;

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

    so while calling this API my app is crashing and i am getting error as :

    &#xA;

    &#xA;

    Error : ffmpeg exited with code 1 : pipe:0 : Invalid data found when&#xA;processing input

    &#xA;

    &#xA;

    Blockquote

    &#xA;

    If i am not using this statement :

    &#xA;

    &#xA;

    .writeToStream(bufferStream, end : true ) ;

    &#xA;

    &#xA;

    then able to save file but in local disk, which is not required in my case.

    &#xA;

    Please help me to understand what is wrong in this code, how i can resolve it.&#xA;Any type of help is appreciated.

    &#xA;