Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

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

Autres articles (39)

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

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

Sur d’autres sites (6683)

  • matroskadec : partly revert "demux relevant subtitle packets after a seek"

    26 novembre 2016, par Rainer Hochecker
    matroskadec : partly revert "demux relevant subtitle packets after a seek"
    

    This reverts parts of c16582579b1c6f66a86615c5808cd5b2bf17be73. The hard
    coded 30 seconds are a lot, and finishing the seek can takes several
    seconds when the source is on a network share. Remove this code
    entirely, because it does more bad than good.

    (Commit message provided by committer, based on the original messages
    by the patch author.)

    Signed-off-by : Rainer Hochecker <fernetmenta@online.de>
    Signed-off-by : wm4 <nfxjfg@googlemail.com>

    • [DH] libavformat/matroskadec.c
  • How do i properly setup ffmpeg and fix this "Permission Denied" error im getting ?

    8 décembre 2020, par ExaNori

    Error im getting&#xA;C:/Users/Motzumoto/Desktop/AGB/ffmpeg/bin: Permission denied

    &#xA;

    I already have ffmpeg installed to path on my windows 10 machine, but that didnt fix it, so i just tried to put ffmpeg in my bots directory, that didnt do it either.&#xA;Heres my music code if anyone can help&#xA;It uses a mixture of youtube-dl and ffmpeg&#xA;If there are also any errors that would stop this from working at all it'd be nice if you could show me them, im quite tired of this as of now and im honestly just about to scrap this idea and forget about it

    &#xA;

    I've tried linking the path to the ffmpeg.exe, that still didnt work, i got the same error, i have no idea what to do

    &#xA;

    import asyncio&#xA;import logging&#xA;import math&#xA;from urllib import request&#xA;&#xA;import discord&#xA;from discord.ext import commands&#xA;import youtube_dl&#xA;from utils.guilds import Guilds&#xA;import ffmpeg&#xA;from asyncio import run_coroutine_threadsafe as coroutine&#xA;&#xA;DOWNLOAD_PATH = "audio" # download path of the file&#xA;STREAM_INDICATOR_PREFIX = "${STREAM}:"&#xA;&#xA;&#xA;&#xA;&#xA;# options&#xA;ytdl_options = {&#xA;    "quiet": True,&#xA;    "forceipv4": True,&#xA;    "noplaylist": True,&#xA;    "no_warnings": True,&#xA;    "ignoreerrors": True,&#xA;    "nooverwrites": True,&#xA;    "restrictfilenames": True,&#xA;    "nocheckcertificate": True,&#xA;    "default_search": "auto",&#xA;    "format": "bestaudio/best",&#xA;}&#xA;ffmpeg_options = {&#xA;    "options": "-vn" # indicates that we have disabled video recording in the output file&#xA;}&#xA;&#xA;ytdl = youtube_dl.YoutubeDL(ytdl_options) # youtube_dl object&#xA;&#xA;# checks functions&#xA;def is_connected(ctx):&#xA;    """Check if the bot is connected to a voice channel."""&#xA;    &#xA;    if ctx.voice_client:&#xA;        return True&#xA;    &#xA;    return False&#xA;def is_same_channel(ctx):&#xA;    """Check if the bot and the user is in the same channel."""&#xA;    &#xA;    # try to get their voice channel id if there&#x27;s any&#xA;    try:&#xA;        bot_channel_id = ctx.voice_client.channel.id&#xA;        user_channel_id = ctx.author.voice.channel.id&#xA;    # if one of them is not connected to a voice channel then they&#x27;re not together&#xA;    except AttributeError:&#xA;        return False&#xA;    &#xA;    # check if their voice channel id is the same&#xA;    if bot_channel_id == user_channel_id:&#xA;        return True&#xA;    &#xA;    return False&#xA;async def checks(ctx):&#xA;    """Do some checking."""&#xA;    &#xA;    # check if the user and the bot is in the same channel&#xA;    if not is_same_channel(ctx):&#xA;        await ctx.send("I am not with you. How dare you to command me like that.")&#xA;        return False&#xA;    &#xA;    return True&#xA;&#xA;# other function&#xA;async def create_source(ctx, query):&#xA;    """Creates youtube_dl audio source for discord.py voice client."""&#xA;    &#xA;    try:&#xA;        async with ctx.typing(): # shows that the bot is typing in chat while searching for an audio source&#xA;            source = await YTDLSource.from_url(query, ctx.bot.loop) # creates a youtube_dl source&#xA;    except IndexError: # if found nothing&#xA;        await ctx.send("I found nothing with the given query..")&#xA;        return None&#xA;    &#xA;    return source&#xA;&#xA;class Music(commands.Cog, name="music"):&#xA;    def __init__(self, bot):&#xA;        self.bot = bot&#xA;        self.guilds = Guilds() # collection of some guilds that this bot is currently in&#xA;    &#xA;    async def cog_command_error(self, ctx, error):&#xA;        """Catch all errors of this cog."""&#xA;        &#xA;        # a check on a command has failed&#xA;        if isinstance(error, commands.CheckFailure):&#xA;            await ctx.send("I&#x27;m not connected to any voice channel.")&#xA;        # ignore this error because it is already handled at the command itself&#xA;        elif isinstance(error, commands.errors.BadArgument):&#xA;            pass&#xA;        # otherwise, log all the other errors&#xA;        else:&#xA;            music_logger.exception(error)&#xA;            await ctx.send(error)&#xA;    &#xA;    @commands.command()&#xA;    async def join(self, ctx):&#xA;        """Invite me to your voice channel."""&#xA;        &#xA;        try:&#xA;            async with ctx.typing(): # shows that the bot is typing in chat while joining the voice channel&#xA;                await ctx.author.voice.channel.connect()&#xA;                await ctx.send("Alright, I joined your voice channel.")&#xA;        # user is not yet connected to a voice channel&#xA;        except AttributeError:&#xA;            await ctx.send(f"You must be connected to a voice channel first {ctx.author.name}.")&#xA;        # bot is already connected to a voice channel&#xA;        except discord.ClientException:&#xA;            if is_same_channel(ctx):&#xA;                await ctx.send("I&#x27;m already with you.")&#xA;            else:&#xA;                await ctx.send("I&#x27;m already with somebody else.")&#xA;    &#xA;    @commands.command()&#xA;    @commands.check(is_connected)&#xA;    async def leave(self, ctx):&#xA;        """Kick me out of your voice channel."""&#xA;        &#xA;        # do some checking before executing this command&#xA;        if not await checks(ctx):&#xA;            return&#xA;        &#xA;        # reset some bot&#x27;s states&#xA;        self.guilds(ctx).has_played_voice = False # reset &#x27;has_played_voice&#x27; state&#xA;        self.guilds(ctx).queue.clear() # reset the queue&#xA;        &#xA;        # finally, stop and disconnect the bot&#xA;        ctx.voice_client.stop() # stop the bot&#x27;s voice&#xA;        await ctx.voice_client.disconnect() # disconnect the bot from voice channel&#xA;        await ctx.send("Ah, alright, cya.")&#xA;    &#xA;    async def play_source(self, ctx, vc, source):&#xA;        """Play an audio to a voice channel."""&#xA;        &#xA;        def play_next(error):&#xA;            """Executes when the voice client is done playing."""&#xA;            &#xA;            # log the errors if there is any&#xA;            if error:&#xA;                music_logger.exception(error)&#xA;                coroutine(ctx.send(error), self.bot.loop)&#xA;            &#xA;            # ensure that there is a song in queue&#xA;            if self.guilds(ctx).queue.queue:&#xA;                coroutine(ctx.invoke(self.bot.get_command("next")), self.bot.loop) # go to the next song&#xA;        &#xA;        vc.play(source, after=play_next) # play the voice to the voice channel&#xA;        await ctx.send(f"Now playing &#x27;{source.title}&#x27;.")&#xA;    &#xA;    @commands.command(aliases=("p", "stream"))&#xA;    async def play(self, ctx, *, query=""):&#xA;        """Play a song for you."""&#xA;        &#xA;        # check if the query argument is empty&#xA;        if not query:&#xA;            # if yes, cancel this command&#xA;            await ctx.send("What should I play?")&#xA;            return&#xA;        &#xA;        # check if this command is invoked using &#x27;stream&#x27; alias&#xA;        if ctx.invoked_with == "stream":&#xA;            SIP = STREAM_INDICATOR_PREFIX # put prefix to the title of the source that indicates that it must be streamed&#xA;        else:&#xA;            SIP = ""&#xA;        &#xA;        # ensure that the bot is connected a voice channel&#xA;        try:&#xA;            # connect the bot to the user voice channel&#xA;            await ctx.author.voice.channel.connect()&#xA;        except AttributeError:&#xA;            # user is not yet connected to a voice channel&#xA;            await ctx.send(f"You must be connected to a voice channel first {ctx.author.name}.")&#xA;            return&#xA;        except discord.ClientException:&#xA;            pass # just ignore if bot is already connected to the voice channel&#xA;        &#xA;        # do some other checking before executing this command&#xA;        if not await checks(ctx):&#xA;            return&#xA;        &#xA;        # create the audio source&#xA;        source = await create_source(ctx, SIP &#x2B; query)&#xA;        &#xA;        # ensure that there is actually a source&#xA;        if source:&#xA;            # initialize bot&#x27;s states if the the queue is still empty&#xA;            if not self.guilds(ctx).queue.queue:&#xA;                self.guilds(ctx).has_played_voice = True # this means that the bot has played in the voice at least once&#xA;                self.guilds(ctx).queue.enqueue(SIP &#x2B; source.title)&#xA;            &#xA;            # play the audio&#xA;            try:&#xA;                await self.play_source(ctx, ctx.voice_client, source)&#xA;            # enqueue the source if audio is already playing&#xA;            except discord.ClientException:&#xA;                self.guilds(ctx).queue.enqueue(SIP &#x2B; source.title)&#xA;                await ctx.send(f"&#x27;{source.title}&#x27; is added to the queue.")&#xA;    &#xA;    @commands.command()&#xA;    @commands.check(is_connected)&#xA;    async def volume(self, ctx, *, vol=None):&#xA;        """Adjust my voice volume."""&#xA;        &#xA;        # do some checking before executing this command&#xA;        if not await checks(ctx):&#xA;            return&#xA;        &#xA;        vc = ctx.voice_client # get the voice client&#xA;        &#xA;        # ensure that the bot is playing voice in order to change the volume&#xA;        if not self.guilds(ctx).has_played_voice:&#xA;            await ctx.send("I haven&#x27;t even started yet.")&#xA;            return&#xA;        elif vc.source is None:&#xA;            await ctx.send("I am not playing anything.")&#xA;            return&#xA;        &#xA;        # check if user has passed an argument&#xA;        if vol is None:&#xA;            await ctx.send("I expect an argument from 0 to 100.")&#xA;            return&#xA;        &#xA;        # cast string argument &#x27;vol&#x27; into a float&#xA;        try:&#xA;            vol = float(vol)&#xA;        # except if the argument is not a number&#xA;        except ValueError:&#xA;            await ctx.send("The argument must only be a number.")&#xA;            return&#xA;        &#xA;        # set the volume&#xA;        if vol >= 0 and vol &lt;= 100: # bound the volume from 0 to 100&#xA;            vc.source.volume = vol / 100&#xA;        else:&#xA;            await ctx.send("I expect a value from 0 to 100.")&#xA;    &#xA;    @commands.command()&#xA;    @commands.check(is_connected)&#xA;    async def pause(self, ctx):&#xA;        """Pause the song."""&#xA;        &#xA;        # do some checking before executing this command&#xA;        if not await checks(ctx):&#xA;            return&#xA;        &#xA;        vc = ctx.voice_client # get the voice client&#xA;        &#xA;        # ensure that the bot&#x27;s voice is playing in order to pause&#xA;        if vc.is_playing():&#xA;            vc.pause()&#xA;            await ctx.send("Alright, paused.")&#xA;        # the bot haven&#x27;t played yet&#xA;        elif not self.guilds(ctx).has_played_voice:&#xA;            await ctx.send("I haven&#x27;t even started yet.")&#xA;        # there is no song in queue&#xA;        elif not self.guilds(ctx).queue.queue:&#xA;            await ctx.send("I am not playing anything.")&#xA;        else:&#xA;            await ctx.send("I already paused.")&#xA;    &#xA;    @commands.command()&#xA;    @commands.check(is_connected)&#xA;    async def resume(self, ctx):&#xA;        """Resume the song."""&#xA;        &#xA;        # do some checking before executing this command&#xA;        if not await checks(ctx):&#xA;            return&#xA;        &#xA;        vc = ctx.voice_client # get the voice client&#xA;        &#xA;        # ensure that the bot&#x27;s voice is paused in order to resume&#xA;        if vc.is_paused():&#xA;            vc.resume()&#xA;            await ctx.send("Alright, song resumed")&#xA;        # the bot haven&#x27;t played yet&#xA;        elif not self.guilds(ctx).has_played_voice:&#xA;            await ctx.send("I haven&#x27;t even started yet.")&#xA;        # there is no song in queue&#xA;        elif not self.guilds(ctx).queue.queue:&#xA;            await ctx.send("I am not playing anything.")&#xA;        else:&#xA;            await ctx.send("I am not paused.")&#xA;    &#xA;    async def update_song(self, ctx):&#xA;        """Change the currently playing song."""&#xA;        &#xA;        vc = ctx.voice_client # get the voice client&#xA;        current = self.guilds(ctx).queue.current # get the current song in queue if there&#x27;s any&#xA;        &#xA;        # ensure that the queue is not empty&#xA;        if current:&#xA;            source = await create_source(ctx, current) # create the audio source&#xA;        # the bot haven&#x27;t played yet&#xA;        elif not self.guilds(ctx).has_played_voice:&#xA;            await ctx.send("I haven&#x27;t even started yet.")&#xA;            return&#xA;        else:&#xA;            vc.stop() # stop the voice just to be sure&#xA;            await ctx.send("No more songs unfortunately.")&#xA;            return&#xA;        &#xA;        # if voice client is already playing, just change the source&#xA;        if vc.is_playing():&#xA;            vc.source = source&#xA;            await ctx.send(f"Now playing &#x27;{source.title}&#x27;.")&#xA;        # otherwise, play the source&#xA;        else:&#xA;            await self.play_source(ctx, vc, source)&#xA;    &#xA;    @commands.command()&#xA;    @commands.check(is_connected)&#xA;    async def next(self, ctx):&#xA;        """Skip the current song."""&#xA;        &#xA;        # do some checking before executing this command&#xA;        if not await checks(ctx):&#xA;            return&#xA;        &#xA;        self.guilds(ctx).queue.shift(1) # shift the queue to the left&#xA;        await self.update_song(ctx) # change the current song&#xA;    &#xA;    @commands.command()&#xA;    @commands.check(is_connected)&#xA;    async def prev(self, ctx):&#xA;        """Go back to the previous song."""&#xA;        &#xA;        # do some checking before executing this command&#xA;        if not await checks(ctx):&#xA;            return&#xA;        &#xA;        self.guilds(ctx).queue.shift(-1) # shift the queue to the right&#xA;        await self.update_song(ctx) # change the current song&#xA;    &#xA;    @commands.command()&#xA;    @commands.check(is_connected)&#xA;    async def removesong(self, ctx, *, index=1):&#xA;        """Remove a song in the queue."""&#xA;        &#xA;        # do some checking before executing this command&#xA;        if not await checks(ctx):&#xA;            return&#xA;        &#xA;        index -= 1 # decrement the &#x27;index&#x27; to match the zero-based index of Python&#xA;        &#xA;        # if index is equal to 0, that means remove the currently playing song&#xA;        # do some extra stuff before removing the current song&#xA;        if index == 0:&#xA;            # try to remove a song in queue&#xA;            try:&#xA;                self.guilds(ctx).queue.dequeue() # dequeue a song in the queue&#xA;                self.guilds(ctx).queue.shift(-1) # shift the queue to the right so that the next song will be played instead of the next next song&#xA;                await ctx.invoke(self.bot.get_command("next")) # finally, play the next song&#xA;            # except when the queue is empty&#xA;            except IndexError:&#xA;                await ctx.send("I haven&#x27;t even started yet.")&#xA;        # otherwise, just remove a song in queue&#xA;        else:&#xA;            # try to remove the song in queue&#xA;            try:&#xA;                self.guilds(ctx).queue.pop(index)&#xA;                await ctx.send("Song removed")&#xA;            # except if the song is not in the queue&#xA;            except IndexError:&#xA;                # check if the bot has not started playing yet&#xA;                if not self.guilds(ctx).has_played_voice:&#xA;                    await ctx.send("I haven&#x27;t even started yet...")&#xA;                else:&#xA;                    await ctx.send(f"I can&#x27;t remove that {ctx.author.name} because it doesn&#x27;t exist.")&#xA;    @removesong.error&#xA;    async def remove_error(self, ctx, error):&#xA;        """Error handler for the &#x27;remove&#x27; command."""&#xA;        &#xA;        # check if the argument is bad&#xA;        if isinstance(error, commands.errors.BadArgument):&#xA;            await ctx.send(f"I can&#x27;t remove that {ctx.author.name}.")&#xA;            await ctx.send("The argument must only be a number or leave it none.")&#xA;    &#xA;    @commands.command()&#xA;    @commands.check(is_connected)&#xA;    async def stop(self, ctx):&#xA;        """Stop all the songs."""&#xA;        &#xA;        # do some checking before executing this command&#xA;        if not await checks(ctx):&#xA;            return&#xA;        &#xA;        vc = ctx.voice_client # get the voice client&#xA;        &#xA;        # ensure that the bot is connected to the voice client&#xA;        if vc.is_playing() or vc.is_paused():&#xA;            self.guilds(ctx).queue.clear() # reset the queue&#xA;            ctx.voice_client.stop() # stop the bot&#x27;s voice&#xA;            await ctx.send("Playback stopped")&#xA;        # the bot haven&#x27;t played yet&#xA;        elif not self.guilds(ctx).has_played_voice:&#xA;            await ctx.send("I haven&#x27;t even started yet.")&#xA;        else:&#xA;            await ctx.send("I already stopped.")&#xA;    &#xA;    @commands.command()&#xA;    @commands.check(is_connected)&#xA;    async def queue(self, ctx):&#xA;        """Show the queue of songs."""&#xA;        &#xA;        SIP = STREAM_INDICATOR_PREFIX # shorten the variable name&#xA;        &#xA;        # do some checking before executing this command&#xA;        if not await checks(ctx):&#xA;            return&#xA;        &#xA;        # try to send the songs in the queue&#xA;        try:&#xA;            # format the queue to make it readable&#xA;            queue = [&#xA;                f"{i}." &#x2B; (" (STREAM) " if q.startswith(SIP) else " ") &#x2B; q.split(SIP)[-1]&#xA;                for i, q in enumerate(self.guilds(ctx).queue.queue, 1)&#xA;            ]&#xA;            &#xA;            await ctx.send("\n".join(queue))&#xA;        # except if it is empty&#xA;        except HTTPException:&#xA;            await ctx.send("No songs in queue.")&#xA;&#xA;class YTDLSource(discord.PCMVolumeTransformer):&#xA;    """Creates a youtube_dl audio source with volume control."""&#xA;    &#xA;    def __init__(self, source, *, data, volume=1):&#xA;        super().__init__(source, volume)&#xA;        self.data = data&#xA;        self.title = data.get("title")&#xA;        self.url = data.get("url")&#xA;    &#xA;    @classmethod&#xA;    async def from_url(cls, url, loop):&#xA;        """Get source by URL."""&#xA;        &#xA;        # check if the URL is must be streamed&#xA;        if url.startswith(STREAM_INDICATOR_PREFIX):&#xA;            stream = True&#xA;        else:&#xA;            stream = False&#xA;        &#xA;        # get data from the given URL&#xA;        data = await loop.run_in_executor(&#xA;            None,&#xA;            (lambda:&#xA;                ytdl.extract_info(&#xA;                    url.split(STREAM_INDICATOR_PREFIX)[-1], # remove the prefix from the URL&#xA;                    download=not stream&#xA;                ))&#xA;        )&#xA;        ##$$$$ fix error somtimes&#xA;        # take the first item from the entries if there&#x27;s any&#xA;        if "entries" in data:&#xA;            try:&#xA;                data = data["entries"][0]&#xA;            except Exception as e:&#xA;                music_logger.exception(e)&#xA;                return None&#xA;        &#xA;        filepath = data["url"] if stream else ytdl.prepare_filename(data) # source url or download path of the file, depends on the &#x27;stream&#x27; parameter&#xA;        return cls(discord.FFmpegPCMAudio("C:/Users/Motzumoto/Desktop/AGB/ffmpeg/bin", **ffmpeg_options), data=data) # create and return the source&#xA;&#xA;def setup(bot):&#xA;    bot.add_cog(Music(bot))&#xA;&#xA;

    &#xA;

  • mpeg12dec : move setting first_field to mpeg_field_start()

    17 décembre 2016, par Anton Khirnov
    mpeg12dec : move setting first_field to mpeg_field_start()
    

    For field picture, the first_field is set based on its previous value.
    Before this commit, first_field is set when reading the picture
    coding extension. However, in corrupted files there may be multiple
    picture coding extension headers, so the final value of first_field that
    is actually used during decoding can be wrong. That can lead to various
    undefined behaviour, like predicting from a non-existing field.

    Fix this problem, by setting first_field in mpeg_field_start(), which
    should be called exactly once per field.

    CC : libav-stable@libav.org
    Bug-ID : 999

    • [DBH] libavcodec/mpeg12dec.c