Recherche avancée

Médias (2)

Mot : - Tags -/kml

Autres articles (111)

  • MediaSPIP Player : les contrôles

    26 mai 2010, par

    Les contrôles à la souris du lecteur
    En plus des actions au click sur les boutons visibles de l’interface du lecteur, il est également possible d’effectuer d’autres actions grâce à la souris : Click : en cliquant sur la vidéo ou sur le logo du son, celui ci se mettra en lecture ou en pause en fonction de son état actuel ; Molette (roulement) : en plaçant la souris sur l’espace utilisé par le média (hover), la molette de la souris n’exerce plus l’effet habituel de scroll de la page, mais diminue ou (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

Sur d’autres sites (15093)

  • Discord js music player bot suddenly leaves

    29 janvier 2024, par ImK

    So I made a music bot for discord js that uses discord player package. The command runs perfectly but in the middle song suddenly stops I tried searching everywhere nothing works and i think its an issue for ffmpeg but im not so sure

    


    bot.player = new Player(bot, {
    ytdlOptions: {
        quality: 'lowestaudio',
        highWaterMark: 1 >> 25
    },
})

const player = bot.player;

//play command 


bot.on('interactionCreate', async interaction =>{
    if(interaction.commandName === 'play') {

        const song = interaction.options.get('song').value;
        const res = await player.search(song, {
            searchEngine: QueryType.SPOTIFY_SONG
        });


        if (!res || !res.tracks.length) return interaction.reply({ content: `No results found ${interaction.member}... try again ? ❌`, ephemeral: true });

        const queue = await player.createQueue(interaction.guild)

        if (!queue.connection) await queue.connect(interaction.member.voice.channel);


        await interaction.channel.send({ content:`Loading your ${res.playlist ? 'playlist' : 'track'}... 🎧`});

        const track = await res.tracks[0]

        console.log(track)
        if(!track)  return interaction.channel.send({content: 'No song found'});

        queue.addTrack(track)

        queue.play();

    }
})


    


    After leaving the channel, other commands and bot work fine

    


  • Record and stream desktop to Youtube by ffmpeg with HD resolution

    1er juillet 2021, par Do Ngoc Tuan

    I want to record and stream desktop to Youtube live by FFmpeg. But the output resolution is very low, maximum 360.
What options I need to change ?

    



    ffmpeg  -framerate 30 -f x11grab -i :1 -f pulse -i default -c:v libx264 -s 1920x1080 -r 60 -b:v 5000k  -crf 10 -vf format=yuv420p -c:a aac -b:a 128k -f flv rtmp://a.rtmp.youtube.com/live2/stream_key


    


  • 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;