Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (32)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (7211)

  • Pycord Music Bot : AttributeError : 'FFmpegAudio' object has no attribute '_process'

    5 juin 2022, par Steven Mao

    I've made a discord Cog that should be able to queue up and play music, but I'm getting an error from FFmpeg when I actually try to play the URL. I have found an identical question on StackOverflow, but this user's problem was a random typo. The inputs should all be correct, so I am not sure if the problem is my code or my package.

    


    What have I done wrong ?

    


    class MusicClass(commands.Cog):
    #universal attributes
    YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist': 'True'}
    FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}

    def __init__(self, bot):
        self.bot = bot
        self.is_playing = False
        self.music_queue = [[],''] #[[music1, music2, music3...], channel_obj]
        self.vc = ''

    @commands.command()
    async def join(self, ctx):
        if not ctx.message.author.voice:
            await ctx.send("{} is not connected to a voice channel".format(ctx.message.author.name))
            return
        else:
            channel = ctx.message.author.voice.channel
        await channel.connect()

    @commands.command()
    async def leave(self, ctx):
        voice_client = ctx.message.guild.voice_client
        if voice_client.is_connected():
            await voice_client.disconnect()
        else:
            await ctx.send("The bot is not connected to a voice channel.")
    
    #rtype: list[dict{str:}]
    #params: search string/web URL, top number of results to show
    #returns list of top 5 queries and their information
    def search_yt(self, search_query, num_results = 3):
        with YoutubeDL(self.YDL_OPTIONS) as ydl:
            try:
                top_results = ydl.extract_info(f"ytsearch{num_results}:{search_query}", download=False)['entries'][0:{num_results}]
                for i in range(len(top_results)):
                    top_results[i] = {
                        'title': top_results[i]['title'],
                        'source': top_results[i]['formats'][0]['url'],
                        'channel': top_results[i]['channel'],
                        'duration': top_results[i]['duration'],
                        'url': top_results[i]['webpage_url']
                    }
            except:
                print(f'SEARCH_YT ERROR\t search="{search_query}"')
                return False
            return top_results
    
    #rtype: None
    #looks at queue, decides whether to play the next song in queue or stop
    def play_next(self):
        print('called play_next')
        if len(self.music_queue) > 0:
            self.is_playing = True
            #assigns url AND removes from queue
            music_url = self.music_queue[0][0]['source']
            self.music_queue[0].pop(0)
            self.vc.play(discord.FFmpegAudio(music_url, **self.FFMPEG_OPTIONS), after = lambda e: self.play_next())
        else:
            self.is_playing = False

    #rtype: None
    #similar to play_next but optimized for first-time playing
    #checks if a song in queue + checks if bot's connected, then begins to play
    async def play_now(self):
        print('called play_now, queue:', self.music_queue[0])
        if len(self.music_queue) > 0:
            self.is_playing = True
            music_url = self.music_queue[0][0]['source']
            if self.vc == '' or not self.vc.is_connected():
                self.vc = await self.music_queue[1].connect()
            else:
                print('moving to new channel')
                self.vc = await self.bot.move_to(self.music_queue[1])
            self.music_queue[0].pop(0)

            #######################################################################################################
            print('ERROR HAPPENS RIGHT HERE')
            self.vc.play(discord.FFmpegAudio(music_url, **self.FFMPEG_OPTIONS), after = lambda e: self.play_next())
            #######################################################################################################
            
        else:
            self.is_playing = False

    @commands.command()
    #dynamically checks for URL link or search query, then attempts to play
    async def p(self, ctx, *args):
        voice_channel = ctx.author.voice.channel

        if voice_channel == None: #not in a VC
            await ctx.send('You have to be in a voice channel first')
            return
        else: #set channel, search and play music
            if self.music_queue[1] != voice_channel:
                self.music_queue[1] = voice_channel
            if args[0].startswith('https://www.youtube.com/watch'): #search URL
                #search web_url directly and send object to music queue
                with YoutubeDL(self.YDL_OPTIONS) as ydl:
                    try:
                        print('attempting to extract URL:', args[0])
                        music_obj = ydl.extract_info(args[0], download=False)
                        music_obj = {
                        'title': music_obj['title'],
                        'source': music_obj['formats'][0]['url'],
                        'channel': music_obj['channel'],
                        'duration': music_obj['duration'],
                        'url': music_obj['webpage_url']
                        }
                        print('music object:', music_obj)
                        print('appending URL song queue')
                        self.music_queue[0].append(music_obj)
                    except:
                        print('URL search failed. URL =', args[0])
            else: #search query, display search results, ask for which one, then add to queue
                num_results = args[len(args)-1] if args[len(args)-1].isdigit() else 3
                song_list = self.search_yt(' '.join(args), num_results)
            
            if not self.is_playing:
                await self.play_now()


    


    Now my error message...

    


    Exception ignored in: <function at="at" 0x7ff4b0a5b5e0="0x7ff4b0a5b5e0">&#xA;Traceback (most recent call last):&#xA;  File "/home/stevenmao/.local/lib/python3.8/site-packages/discord/player.py", line 127, in __del__&#xA;    self.cleanup()&#xA;  File "/home/stevenmao/.local/lib/python3.8/site-packages/discord/player.py", line 247, in cleanup&#xA;    self._kill_process()&#xA;  File "/home/stevenmao/.local/lib/python3.8/site-packages/discord/player.py", line 198, in _kill_process&#xA;    proc = self._process&#xA;AttributeError: &#x27;FFmpegAudio&#x27; object has no attribute &#x27;_process&#x27;&#xA;</function>

    &#xA;

  • FFMPEG creating video which have blinking opacity overlay

    13 juillet 2020, par Nikhil Solanki

    I am creating video which has an overlay of black color which is continuously changing opacity from 0.0 to 1.0(which means blinking). So, I am setting color as input and set it with blend=all_mode=&#x27;overlay&#x27;:all_opacity=0.5 full command :

    &#xA;

    ffmpeg -i combine2.mp4 -loop 1 -i image1.png -i song.mp3 -f lavfi -i "color=black:s=540x960" -t 20 -filter_complex "[0]split=2[color][alpha]; [color]crop=iw/2:ih:0:0[color]; &#xA;[alpha]crop=iw/2:ih:iw/2:ih[alpha]; [color][alpha]alphamerge[v1];&#xA;[1]scale=540:960, setsar=1[v2];&#xA;[3]scale=540:960, format=yuv420p, loop=-1:size=2048, fade=t=out:st=1:d=1[b];&#xA;[v2][b]blend=all_mode=&#x27;overlay&#x27;:all_opacity=0.5[out];&#xA;[2]showfreqs=s=540x50:mode=line:ascale=log:colors=red:win_size=540[v3];&#xA;[out][v3] overlay=main_w-overlay_w:main_h-overlay_h-10, trim=0:20[v4];&#xA;[v4][v1] overlay=1" output_video2.mp4 -y&#xA;

    &#xA;

    Using this command I am trying looping opacity but, its not work. Also fade=t=out is useless here ! So, what to do for blinking the layer black with opacity ?

    &#xA;

  • How to stream M4A files correctly ?

    3 novembre 2017, par NineCattoRules

    I would like to stream an M4A audio file but for some reason the player starts to play the song only after downloaded the entire file.

    <audio controls="controls">
     <source src="https://php-test-easybreazy.c9users.io/music/1021785690_1171244514_239291028.m4a" type="audio/mpeg">
    Your browser does not support the audio element.
    </source></audio>

    In my Ubuntu server I used FFMPEG to encode my audio file.

    The only thing I can think of is a metadata/encode issue.

    Why the player starts playing only after downloaded the entire file audio ?