Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (48)

  • 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

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (8081)

  • Discord FFMPEG audio wont play from yt-dlp

    19 mars 2023, par user21236822

    My question is this : Why isn't my bot playing audio ?

    


    I want the bot to join, play audio from queue, then disconnect without downloading an mp3 file.

    


    I tried using youtube-dl, but I switched to the yt-dlp library after getting errors I couldn't fix.
I am running on Windows 10 locally. All my libraries are up to date.

    


    Here are my ydl_opts and FFMPEG_OPTS :

    


    ydl_opts = {
    'format': 'bestaudio/best',
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '192',
    }],
}

FFMPEG_OPTIONS = {
    'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
    'options': '-vn'
} 


    


    Here is where I believe the problem is.

    


    async def play():
    print("Play Called")
    musicPlay()
    # Get message object from initial request
    message = ytLinkQue.get()
    print(f"Message object recieved: {message}")
    voiceChannel = message.author.voice.channel
    vc = await voiceChannel.connect()
    songsPlayed = 0
    
    while not ytLinkQue.empty():
        # Get current song
        currentSong = ytLinkQue.get()[0]
        print(f"Current song: {currentSong}")

        # Get song from Youtube
        with yt_dlp.YoutubeDL(ydl_opts) as ydl:
            # song = ydl.download(currentSong)
            info = ydl.extract_info(currentSong, download=False)
            song = info['formats'][0]['url']

        # Play Song
        vc.play(discord.FFmpegPCMAudio(song, **FFMPEG_OPTIONS), after=lambda e: print('Song done'))

        # Wait until the song has finished playing
        while vc.is_playing():
            print("playing rn")
            await asyncio.sleep(1)
    
    await vc.disconnect()
    musicStop()


    


    When play() is called, here is the output in terminal with my annotations as **** text **** :

    


    >python main.py&#xA;2023-02-17 15:21:09 INFO     discord.client logging in using static token&#xA;2023-02-17 15:21:10 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: 60b9fce14faa5daa4aed9eb6db01a74d).&#xA;Max que: 50&#xA;Text Channel: 828698708123451434&#xA;Testing Bot#4591 is ready.&#xA;Passing message object&#xA;**** play() funciton is called ****&#xA;Play Called&#xA;Message object recieved: <message channel="<TextChannel" position="7" nsfw="False" news="False"> type= author=<member discriminator="&#x27;0199&#x27;" bot="False" nick="&#x27;Fragnk7?&#x27;" guild="<Guild" chunked="True">> flags=<messageflags value="0">>&#xA;2023-02-17 15:21:16 INFO     discord.voice_client Connecting to voice...&#xA;2023-02-17 15:21:16 INFO     discord.voice_client Starting voice handshake... (connection attempt 1)&#xA;2023-02-17 15:21:17 INFO     discord.voice_client Voice handshake complete. Endpoint found seattle2004.discord.media&#xA;Current song: https://www.youtube.com/watch?v=vcAp4nmTZCA&#xA;[youtube] Extracting URL: https://www.youtube.com/watch?v=vcAp4nmTZCA &#xA;[youtube] vcAp4nmTZCA: Downloading webpage &#xA;[youtube] vcAp4nmTZCA: Downloading android player API JSON &#xA;**** Does not play any audio ****&#xA;Playing rn&#xA;Song done&#xA;2023-02-17 15:21:18 INFO     discord.player ffmpeg process 20700 successfully terminated with return code of 1.&#xA;2023-02-17 15:21:19 INFO     discord.voice_client The voice handshake is being terminated for Channel ID 400178308467392513 (Guild ID 261601676941721602)&#xA;2023-02-17 15:21:19 INFO     discord.voice_client Disconnecting from voice normally, close code 1000.&#xA;</messageflags></member></message>

    &#xA;

    On Discord's end, the bot successfully connects then disconnects after 2 second.

    &#xA;

    Note : I've only included code I think is relevant. Please let me know if I should add anything else to the post, otherwise, here is the github for the project. Code is in main.py.&#xA;https://github.com/LukeLeimbach/wallMomentMusic

    &#xA;

    Thank you in advance !

    &#xA;

    I've applied the advice from these posts but it still will not play audio :

    &#xA;

    -https://stackoverflow.com/questions/45770016/how-do-i-make-my-discord-bot-play-audio-from-youtube

    &#xA;

    -https://stackoverflow.com/questions/66070749/how-to-fix-discord-music-bot-that-stops-playing-before-the-song-is-actually-over?newreg=c70dd786cf5844e490045494223c0381

    &#xA;

    -https://stackoverflow.com/questions/57688808/playing-music-with-a-bot-from-youtube-without-downloading-the-file

    &#xA;

  • voice_client.play doesn't continue loop (Discord)

    19 mars 2023, par Razurio
    songs = asyncio.Queue(maxsize=0)&#xA;currently_playing = False&#xA;&#xA;&#xA;@client.command()&#xA;async def play(ctx, url):&#xA;    global songs&#xA;    global currently_playing&#xA;    if currently_playing:&#xA;        with yt_dlp.YoutubeDL({"format": "bestaudio", "outtmpl": "Queue_Download/%(title)s.%(ext)s"}) as ydl:&#xA;            info = ydl.extract_info(url, download=True)&#xA;            filename = ydl.prepare_filename(info)&#xA;            await songs.put({"file": filename, "info": video_info(url)})&#xA;            # print("test 1")&#xA;    else:&#xA;        with yt_dlp.YoutubeDL({"format": "bestaudio", "outtmpl": "Queue_Download/%(title)s.%(ext)s"}) as ydl:&#xA;            info = ydl.extract_info(url, download=True)&#xA;            filename = ydl.prepare_filename(info)&#xA;            await songs.put({"file": filename, "info": video_info(url)})&#xA;            # print("test 2")&#xA;        asyncio.create_task(queue(ctx))&#xA;&#xA;&#xA;&#xA;async def queue(ctx):&#xA;    global songs&#xA;    global currently_playing&#xA;    currently_playing = True&#xA;    while True:&#xA;        if songs.empty():&#xA;            currently_playing = False&#xA;            await ctx.reply("Queue is now empty")&#xA;            await ctx.voice_client.disconnect()  # disconnect from voice channel when queue is empty&#xA;            break&#xA;        else:    &#xA;            song = await songs.get()&#xA;            filename = song["file"]&#xA;            voice_channel = ctx.author.voice.channel&#xA;            if not ctx.voice_client:  # check if bot is not already connected to a voice channel&#xA;                await voice_channel.connect()&#xA;&#xA;            await ctx.reply(&#x27;playing&#x27;)&#xA;            await ctx.voice_client.play(discord.FFmpegPCMAudio(filename))&#xA;&#xA;@client.command()&#xA;async def stop(ctx):&#xA;    global songs&#xA;    await ctx.voice_client.disconnect()&#xA;    await empty_queue(songs)&#xA;    await ctx.reply(&#x27;Stopped&#x27;)&#xA;&#xA;async def empty_queue(songs):&#xA;    while not songs.empty():&#xA;        songs.get_nowait()&#xA;

    &#xA;

    I have problems with the "await ctx.voice_client.play(discord.FFmpegPCMAudio(filename))" which doesn't continue after finishing.

    &#xA;

    I know you can use a after= parameter in voice_client.play() but I didn't manage to get it to work to recursivly call queue()

    &#xA;

  • ffmpeg play short video during playing another video

    10 mai 2016, par Szymek Świderski

    I want put and play scrap of short video during play another video in ffmpeg. I use this : ffmpeg -i 0.mp4 -i "prawo.mp4" -filter_complex "blend=all_mode='heat':all_opacity=0.3" output.mp4

    and i get this :

    First input link top parameters (size 1280x720, SAR 0:1) do not match the corresponding second input link bottom parameters (1920x1080, SAR 1:1)

    What should i do ? Any help ?