Recherche avancée

Médias (0)

Mot : - Tags -/objet éditorial

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

Autres articles (49)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

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

  • 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

Sur d’autres sites (8391)

  • Make Discord bot play sound from a direct url

    20 septembre 2020, par merctraider

    I want to make a discordpy bot that plays audio files from a specific link on the internet, rather than from a local directory. It seems that all the other examples use ytdl, but those are for video streaming sites. How should I go about doing this ?

    


        if(voice_channel != None):
        vc = await voice_channel.connect()

        vc.play(discord.FFmpegPCMAudio('http://website/001.mp3'), after=lambda e: print('done', e))
    else:
        await ctx.send("Join a voice channel first.")```


    


  • Ruby - Threads and Dir[] arrays

    17 mars 2016, par Lewis909

    I have built a ruby script that creates folders, moves a file into that new folder and then invokes a system() call to trigger FFMPEG. I have now turned this into 4 threads so that I can do 4 concurrent transcodes at a time.

    Here is an example with 2 threads (minus folder structure creation and file move functions) :

    def transcode_process_1

    Dir["path/file/source/*.mxf"].each do |f|

      random_folder = #code for random folder creation

      file_move = #code to move .mxf file to random_folder for processing

      system("FFMPEG -i #{random_folder} command 2> /path/file/#{random_filename}.txt")

      sleep(2)

    end
    end

    def transcode_process_2

    sleep(3)

    Dir["path/file/source/*.mxf"].each do |f|

      random_folder = #code for random folder creation

      file_move = #code to move .mxf file to random_folder for processing

      system("FFMPEG -i #{random_folder} command 2> /path/file/#{random_filename}.txt")

      sleep(4)

    end
    end

    transcode_thread_1 = Thread.new{transcode_process_1()}
    transcode_thread_2 = Thread.new{transcode_process_2()}

    transcode_thread_1.join
    transcode_thread_2.join

    This iterates through the Dir "path/file/source/" and processes any.mxf files it finds. The issue I am having is that when both threads are running they are adding the same files into the array. This results in FFMPEG stating it cannot locate the file (this is because another thread has processed it and moved it to the temp folder) and creating superfluous folders and log files, basically just making it messy.

    My question is how would I go about making sure transcode_thread_2 does not process files that transcode_thread_1 has added to it array ? Is there a way I can get the function to check that the file in the array is still exists ? If it does then carry out the process, if not move on to the next file ?

    Thanks

  • ffmpeg doesn't work in heroku using discord.py, how can i solve it ?

    20 septembre 2022, par empress

    I'm making a discord bot with python and it has a music cog. I've just hosted the bot, and everything works perfectly except this cog. Bassically, the problem is that even if the bot is ready with no errors, when I try to play something in one channel with the command !pl <search></search> the bot joins the channel, but it doesn't play anything.

    &#xA;

    I have already add the BuildPacks to heroku (opus, ffmpeg, python) and all the requirements are ready (The music cog worked on my pc when i was building it).

    &#xA;

    The output in terminal shows "discord.player : ffmpeg process 26 successfully terminated with return code of -11"

    &#xA;

    I'll upload a few part of my code, which explains it at all.

    &#xA;

    import discord&#xA;from discord.ext import commands&#xA;from youtube_dl import YoutubeDL&#xA;&#xA;class music_cog(commands.Cog):&#xA;    def __init__(self, bot):&#xA;        self.bot = bot&#xA;        self.is_playing = False&#xA;        self.is_paused = False&#xA;        self.music_queue = []&#xA;        self.YDL_OPTIONS = {&#x27;format&#x27;: &#x27;bestaudio&#x27;, &#x27;noplaylist&#x27;:&#x27;True&#x27;}&#xA;        self.FFMPEG_OPTIONS = {&#x27;before_options&#x27;: &#x27;-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5&#x27;, &#x27;options&#x27;: &#x27;-vn&#x27;}&#xA;        self.vc = None&#xA;&#xA;    def search_yt(self, item):&#xA;        with YoutubeDL(self.YDL_OPTIONS) as ydl:&#xA;            try: &#xA;                info = ydl.extract_info("ytsearch:%s" % item, download=False)[&#x27;entries&#x27;][0]&#xA;            except Exception: &#xA;                return False&#xA;        return {&#x27;source&#x27;: info[&#x27;formats&#x27;][0][&#x27;url&#x27;], &#x27;title&#x27;: info[&#x27;title&#x27;]}&#xA;&#xA;    def play_next(self):&#xA;        if len(self.music_queue) > 0:&#xA;            self.is_playing = True&#xA;            m_url = self.music_queue[0][0][&#x27;source&#x27;]&#xA;            self.music_queue.pop(0)&#xA;            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())&#xA;        else:&#xA;            self.is_playing = False&#xA;&#xA;    async def play_music(self, ctx):&#xA;        member = ctx.author&#xA;        if len(self.music_queue) > 0:&#xA;            self.is_playing = True&#xA;            m_url = self.music_queue[0][0][&#x27;source&#x27;]&#xA;            if self.vc == None or not self.vc.is_connected():&#xA;                self.vc = await self.music_queue[0][1].connect()&#xA;                if self.vc == None:&#xA;                    await ctx.send(f"you need to join a vc {member.mention} !!")&#xA;                    return&#xA;            else:&#xA;                await self.vc.move_to(self.music_queue[0][1])&#xA;            self.music_queue.pop(0)&#xA;            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())&#xA;        else:&#xA;            self.is_playing = False&#xA;&#xA;    @commands.command(name = "play", aliases = ["pl"])&#xA;    async def play(self, ctx, *args):&#xA;        query = " ".join(args)&#xA;        await ctx.send(f"Buscando en youtube seg&#xFA;n {query}...")&#xA;        member = ctx.author&#xA;        voice_channel = ctx.author.voice.channel&#xA;        if voice_channel is None:&#xA;            await ctx.send(f"you need to join a vc {member.mention} !!")&#xA;        elif self.is_paused&#xA;            self.vc.resume()&#xA;        else:&#xA;            song = self.search_yt(query)&#xA;            song_name = song.get("title")&#xA;            if type(song) == type(True):&#xA;                await ctx.send(f"There was an error {member.mention} !!")&#xA;            else:&#xA;                await ctx.send(&#x27;song in the queue "{song_name}" !!&#x27;)&#xA;                self.music_queue.append([song, voice_channel])&#xA;                await self.play_music(ctx)&#xA;

    &#xA;

    If anyone can help me I would appreciate it so much :(

    &#xA;