Recherche avancée

Médias (1)

Mot : - Tags -/ogv

Autres articles (44)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

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

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

Sur d’autres sites (7248)

  • Check if user is in a voice channel discord.py

    21 octobre 2024, par Max McCarthy

    I am making a bot that will play sounds in a vc. I have made the code to join the call, play the mp3, then leave the call but when the user is not in a call I get this error :

    


    Ignoring exception in command ring:
Traceback (most recent call last):
  File "C:\Users\max\AppData\Roaming\Python\Python39\site-packages\discord\ext\commands\core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "C:\Users\max\OneDrive\Desktop\Code\DiscordBots\Nokia\Nokia.py", line 91, in ring
    channel = ctx.author.voice.channel
AttributeError: 'NoneType' object has no attribute 'channel'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\max\AppData\Roaming\Python\Python39\site-packages\discord\ext\commands\bot.py", line 903, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\max\AppData\Roaming\Python\Python39\site-packages\discord\ext\commands\core.py", line 859, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\max\AppData\Roaming\Python\Python39\site-packages\discord\ext\commands\core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'channel'


    


    This is my code that I have so far :

    


    @client.command()
async def ring(ctx):
    channel = ctx.author.voice.channel
    vc = await channel.connect()
    vc.play(discord.FFmpegPCMAudio("Audio/NokiaRingtone.mp3"))
    time.sleep(5)
    await ctx.voice_client.disconnect()


    


    If anyone could help me check if the user is in a voice channel that would be great.

    


  • discord.py music bot can't play next song

    6 décembre 2020, par bork

    I'm making a discord music bot using ffmpeg and youtube-dl. I have a premade playlist of urls that would play the list of songs once a user chooses it.
    
this is my code for playing the audio

    


    ydl_opts = {
            'format': 'bestaudio', 
            'noplaylist':'True',
            'youtube_include_dash_manifest': False
            }
FFMPEG_OPTIONS = {
            'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
            'options': '-vn'
            }

songs = url[playlist]
dur_min = 0
pre_dur_sec = 0
with YoutubeDL(ydl_opts) as ydl:
    for i in songs:
        info = ydl.extract_info(i, download = False)
        dur = info['duration']
        playlist_songs.append(info)

playlist_songs_copy = playlist_songs.copy()
for i in playlist_songs_copy:
    info = playlist_songs.pop(0)
    URL = info['formats'][0]['url']
    player = FFmpegPCMAudio(URL, **FFMPEG_OPTIONS)
    q.append(player)
    q_playlist.append(playlist)

if not voice.is_playing():
    source = q.pop(0)  
    playlist = q_playlist.pop(0)
    dur_min = duration_min.pop(0)
    dur_sec = duration_sec.pop(0)  
    voice.play(source, after = lambda e: play_next(ctx, source))      
    voice.is_playing()
    await ctx.send(f'```nim\n*Now Playing:*\nplaylist {playlist}: {name[playlist]}\n\n{content[playlist]}\n\ntotal duration: {dur_min}:{dur_sec}```')


    


    and this is my code for playing the next song

    


    def play_next(ctx, source):
    voice = get(client.voice_clients, guild = ctx.guild)
    if len(q) >= 1:
        try:
            del combine_q[0]
            source = q.pop(0)
            playlist = q_playlist.pop(0)
            dur_min = duration_min.pop(0)
            dur_sec = duration_sec.pop(0)

        except:
            pass

        voice.play(source, after = lambda e: play_next(ctx, source))
        try:
            asyncio.run_coroutine_threadsafe(ctx.send(f'```nim\n*Now Playing:*\nplaylist {playlist}: {name[playlist]}\n\n{content[playlist]}\n\ntotal duration: {dur_min}:{dur_sec}```'), client.loop)
        
        except:
            asyncio.run_coroutine_threadsafe(ctx.send('```nim\nPlaying the next song...```'), client.loop)
        
    else:
        time.sleep(30) 
        if not voice.is_playing():
            asyncio.run_coroutine_threadsafe(voice.disconnect(), client.loop)
            asyncio.run_coroutine_threadsafe(ctx.send("```nim\nNo more songs in queue.```"),client.loop)
            voice.is_paused()


    


    Up till today, it's been working fine. But I was using the bot just now and instead of playing the song and sending the message "Playing the next song..." as usual, it just stopped and spammed the message for about 30 times before it disconnected. When I checked the logs, it showed
socket.send() raised exception
, which was also spammed in the terminal. When I tried making the bot reconnect, it joined my voice channel but didn't respond to any commands and would keep making the discord "connecting" noise. It wouldn't even leave with my .leave command unless I completely turned it off via the script.

    


    The same connecting problem would continue even after I reran the script and would only stop after I restarted my VS Code which is really odd...

    


    After some testing I found out that as of now, the bot is only able to play two songs before breaking. I really need help as this just happened randomly and I'm unable to find anything online about the problem.

    


  • ffmpeg output file is shorter then it should be when recording through python subprocess

    14 décembre 2020, par dahan raz

    I have this code

    


        def startVideoRecording(self, filename):
            webcam_name = "c922 Pro Stream Webcam"
            webcam_mic_name="Microphone (C922 Pro Stream Webcam)"
            buffer_size="100M"
            self.videoFilename = filename
            cmd = f'ffmpeg -f dshow -rtbufsize {buffer_size} -i video="{webcam_name}":audio="{webcam_mic_name}" -vf format=yuv420p {filename}'
            self.video_process = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
                                                  stderr=subprocess.PIPE)
        def stopVideoRecording(self):
            if self.video_process:
                self.video_process.communicate(b'q')
                time.sleep(2)
                self.video_process.wait()



    


    First I am calling the startVideoRecording func and after something like 15 seconds or even more I call the stopVideoRecording function, But no matter what I tried the file length I am getting at the end is 3 seconds, but when I try to do this from cli it works well and I get the full file size so I am guessing its something to do with how I kill the process ?