Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (51)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (6810)

  • how to fix Error 'FFmpegPCMAudio' object has no attribute '_process'

    30 novembre 2023, par Ma Me
    from ast import alias
import discord
from discord.ext import commands
from youtubesearchpython import VideosSearch
from yt_dlp import YoutubeDL
import asyncio

class music_cog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
    
        #all the music related stuff
        self.is_playing = False
        self.is_paused = False

        # 2d array containing [song, channel]
        self.music_queue = []
        self.YDL_OPTIONS = {'format': 'bestaudio/best'}
        self.FFMPEG_OPTIONS = {'options': '-vn'}

        self.vc = None
        self.ytdl = YoutubeDL(self.YDL_OPTIONS)

     #searching the item on youtube
    def search_yt(self, item):
        if item.startswith("https://"):
            title = self.ytdl.extract_info(item, download=False)["title"]
            return{'source':item, 'title':title}
        search = VideosSearch(item, limit=1)
        return{'source':search.result()["result"][0]["link"], 'title':search.result()["result"][0]["title"]}

    async def play_next(self):
        if len(self.music_queue) > 0:
            self.is_playing = True

            #get the first url
            m_url = self.music_queue[0][0]['source']

            #remove the first element as you are currently playing it
            self.music_queue.pop(0)
            loop = asyncio.get_event_loop()
            data = await loop.run_in_executor(None, lambda: self.ytdl.extract_info(m_url, download=False))
            song = data['url']
            self.vc.play(discord.FFmpegPCMAudio(song, executable= "ffmpeg.exe", **self.FFMPEG_OPTIONS), after=lambda e: asyncio.run_coroutine_threadsafe(self.play_next(), self.bot.loop))
            
        else:
            self.is_playing = False

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

            m_url = self.music_queue[0][0]['source']
            #try to connect to voice channel if you are not already connected
            if self.vc == None or not self.vc.is_connected():
                self.vc = await self.music_queue[0][1].connect()

                #in case we fail to 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])
            #remove the first element as you are currently playing it
            self.music_queue.pop(0)
            loop = asyncio.get_event_loop()
            data = await loop.run_in_executor(None, lambda: self.ytdl.extract_info(m_url, download=False))
            song = data['url']
            self.vc.play(discord.FFmpegPCMAudio(song, executable= "ffmpeg.exe", **self.FFMPEG_OPTIONS), after=lambda e: asyncio.run_coroutine_threadsafe(self.play_next(), self.bot.loop,))
        else:
            self.is_playing = False

    @commands.command(name="play", aliases=["p","playing"], help="Plays a selected song from youtube")
    async def play(self, ctx, *args):
        query = " ".join(args)
        try:
            voice_channel = ctx.author.voice.channel
        except:
            await ctx.send("```You need to connect to a voice channel first!```")
            return
        if 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 another keyword. This could be due to playlist or a livestream format.```")
            else:
                if self.is_playing:
                    await ctx.send(f"**#{len(self.music_queue)+2} -'{song['title']}'** added to the queue") 
                else:
                    await ctx.send(f"**'{song['title']}'** 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()
        if self.is_paused:
            self.vc.resume()
            self.is_playing = True
            self.is_paused = False

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

    @commands.command(name="skip", aliases=["s"], help="Skips the current song being played")
    async def skip(self, ctx):
        if self.vc != None and self.vc:
            self.vc.stop()
            #try to play next in the queue if it exists
            await self.play_music(ctx)


    @commands.command(name="queue", aliases=["q"], help="Displays the current songs in queue")
    async def queue(self, ctx):
        retval = ""
        for i in range(0, len(self.music_queue)):
            retval += f"#{i+1} -" + self.music_queue[i][0]['title'] + "\n"

        if retval != "":
            await ctx.send(f"```queue:\n{retval}```")
        else:
            await ctx.send("```No music in queue```")

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

    @commands.command(name="stop", aliases=["disconnect", "l", "d"], help="Kick the bot from VC")
    async def dc(self, ctx):
        self.is_playing = False
        self.is_paused = False
        await self.vc.disconnect()
    
    @commands.command(name="remove", help="Removes last song added to queue")
    async def re(self, ctx):
        self.music_queue.pop()
        await ctx.send("```last song removed```")


    


    I think everything is good but there is no sound Can you give me some advice ?
    
it python code

    


  • fate/mov : force the native av1 decoder for the avif tests

    9 janvier 2024, par James Almer
    fate/mov : force the native av1 decoder for the avif tests
    

    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DH] tests/fate/mov.mak
    • [DH] tests/ref/fate/mov-avif-demux-still-image-1-item
    • [DH] tests/ref/fate/mov-avif-demux-still-image-multiple-items
  • Unable to extract KLV data from .mpg file

    2 novembre 2023, par Arjun Shastry

    I need to extract the klv data embedded in the following file :&#xA;https://samples.ffmpeg.org/MPEG2/mpegts-klv/Day%20Flight.mpg

    &#xA;

    Currently, I am doing it using ffmpeg and python.&#xA;The code works for .ts files like the example given below, but not the above mpg file. :&#xA;https://www.arcgis.com/home/item.html?id=55ec6f32d5e342fcbfba376ca2cc409a

    &#xA;

    I used the following python command, using subprocess, ffmpeg to extract klv data in a binary file and then using klvdata library to tranlate to a readable text file.

    &#xA;

    #Extract klv data and output as binary file&#xA;command=[&#x27;ffmpeg&#x27;, &#x27;-i&#x27;, input_video, &#x27;-map&#x27;, &#x27;d&#x27;,&#x27;-codec&#x27;,&#x27;copy&#x27;,&#x27;-f&#x27;, &#x27;data&#x27;,&#x27;out.bin&#x27;]&#xA;process=subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)&#xA;stdout, stderr = process.communicate()&#xA;&#xA;print(stdout)&#xA;print(stderr)&#xA;&#xA;#Open text file to write json data&#xA;outjson=open("./outjson.txt","w")&#xA;print("Flag 1")&#xA;&#xA;# Open the out.bin file for reading as binary&#xA;with open("./out.bin", "rb") as f:&#xA;    sample=[]&#xA;    cnt=0&#xA;    for packet in klvdata.streamparser.StreamParser(f):&#xA;        pack=[]&#xA;        metadata = packet.MetadataList()&#xA;        for i in (5,6,7,13,14,15,18,19,23,24,25,26,27,28,29,30,31,32,33):#Only extracting required data&#xA;            pack.append(metadata[i][-1])&#xA;        sample.append(pack)&#xA;    sampleLength=(len(sample))&#xA;    json.dump(sample,outjson,indent=4) # Convert the metadata to a string and write it to outtext.txt&#xA;

    &#xA;

    When doing it for "Day Flight.mpg", the following error occurs :

    &#xA;

    58. 19.100 / 58. 19.100\r\n  libavcodec     60. 26.100 / 60. 26.100\r\n  libavformat    60. 11.100 / 60. 11.100\r\n  libavdevice    60.  2.101 / 60.  2.101\r\n  libavfilter     9. 11.100 /  9. 11.100\r\n  libswscale      7.  3.100 /  7.  3.100\r\n  libswresample   4. 11.100 /  4. 11.100\r\n  libpostproc    57.  2.100 / 57.  2.100\r\n[mpegts @ 0000026bb99387c0] start time for stream 1 is not set in estimate_timings_from_pts\r\nInput #0, mpegts, from &#x27;C:/Users/ashastry/Downloads/Day Flight.mpg&#x27;:\r\n  Duration: 00:03:14.88, start: 10.000000, bitrate: 4187 kb/s\r\n  Program 1 \r\n  Stream #0:0[0x1e1]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720, 60 fps, 60 tbr, 90k tbn\r\n  Stream #0:1[0x1f1]: Data: klv (KLVA / 0x41564C4B)\r\nOutput #0, data, to &#x27;out.bin&#x27;:\r\n  Metadata:\r\n    encoder         : Lavf60.11.100\r\n  Stream #0:0: Data: klv (KLVA / 0x41564C4B)\r\nStream mapping:\r\n  Stream #0:1 -> #0:0 (copy)\r\nPress [q] to stop, [?] for help\r\nsize=       0kB time=00:00:00.00 bitrate=N/A speed=N/A    \rsize=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    \rsize=       1kB time=00:00:00.00 bitrate=N/A speed=   0x    \r[out#0/data @ 0000026bbb61b300] video:0kB audio:0kB subtitle:0kB other streams:1kB global headers:0kB muxing overhead: 0.000000%\r\nsize=       1kB time=00:00:00.00 bitrate=N/A speed=   0x    \r\n"&#xA;Flag 1&#xA;Traceback (most recent call last):&#xA;&#xA;  File C:\ProgramData\anaconda3\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec&#xA;    exec(code, globals, locals)&#xA;&#xA;  File c:\users\ashastry\desktop\gis\javascript\extract.py:34&#xA;    metadata = packet.MetadataList()&#xA;&#xA;AttributeError: &#x27;UnknownElement&#x27; object has no attribute &#x27;MetadataList&#x27;&#xA;

    &#xA;