Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (71)

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

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (11356)

  • Discord.py music bot doesn't play next song in queue

    10 mai 2019, par Lewis H

    This is my code for the bot I’m trying to create, it plays the music fine.

    ytdl_options = {
       'format': 'bestaudio/best',
       'restrictfilenames': True,
       'noplaylist': True,
       'nocheckcertificate': True,
       'quiet':True,
       'ignoreerrors': False,
       'logtostderr': False,
       'no_warnings': True,
       'default_search': 'auto',
       'source_address': '0.0.0.0' # using ipv4 since ipv6 addresses causes issues sometimes
       }


           # ffmpeg options
    ffmpeg_options= {
       'options': '-vn'
       }



    @bot.command()
    async def play(ctx, url:str = None):
       queue = {}

       channel = ctx.author.voice.channel    
       if ctx.voice_client is not None:  
           await ctx.voice_client.move_to(channel)
       elif ctx.author.voice and ctx.author.voice.channel:      
           await channel.connect()

       if not url:
           await ctx.send("Try adding a URL. e.g. !play https://youtube.com/watch?v=XXXXXXXXX")

       if ctx.voice_client is not None:
           vc = ctx.voice_client #vc = voice client, retrieving it
           ytdl = youtube_dl.YoutubeDL(ytdl_options)


           loop = asyncio.get_event_loop()
           data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url))

           if 'entries' in data:
               data = data['entries'][0]
           svr_id = ctx.guild.id
           if svr_id in queue:
               queue[svr_id].append(data)

           else:
               queue[svr_id] = [data]
           await ctx.send(data.get('title') + " added to queue")

           source = ytdl.prepare_filename(queue[svr_id][0])
           def pop_queue():
               if queue[svr_id] != []:
                   queue[svr_id].pop(0)
                   data = queue[svr_id][0]
               else:
                   vc.stop()

           if not vc.is_playing():
               vc.play(discord.FFmpegPCMAudio(source, **ffmpeg_options), after=lambda: pop_queue())

    The next song downloads and queues it fine, but once the first song finishes, it doesn’t play the next one. I can’t figure out how to make it play after the first song has commenced. I have the after= set to remove the top item of the queue, but how do I get it to play again ? Thanks

  • Python ffmpeg kill a ffprobe process

    14 novembre 2017, par emanaltal

    I’m using ffmpeg with python & ubuntu, im going over a loop of url stream files & I’m sending ffprobe command first to read , if works fine, I will open another subprocess to take snapshot of stream.

    The issue is now the system hang because so many processes. I tried to kill the process using process.kill() and by specifying process PID but still not working

    My code is :

    command = 'ffprobe -v error -show_entries stream=width,height %s'%(url)
    process = subprocess.Popen(shlex.split(command),shell=False,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    print process.pid
    output = process.communicate()
    for i in output:
       if i !='':
           if '403 Forbidden' in i:
           #### update database
           elif  '401 Unauthorized' in i:
               #### update database
           else:
               screenshot = screenshots_path+  str(time.strftime("%Y%m%d%H%M%S",time.localtime()))
               play_command = """ffmpeg -i """+m3u_url+""" -vframes 1 -q:v 1  -vf drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf:x=(w-text_w)/2:y=(h-text_h-line_h): fontsize=24 :fontcolor=white@1.0 : text= \\'"""+str(m3u_url)+"""'"  %s.jpg -hide_banner"""%(screenshot)
               process = subprocess.Popen(shlex.split(play_command),shell=False,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
               process.kill()
  • Python ffmpeg kill a fprobe process

    13 novembre 2017, par emanaltal

    I’m using ffmpeg with python & ubuntu, im going over a loop of url stream files & im sending fprobe command first to read , if works fine i open another subprocess to take snapshot of stream.

    The issue is now the system hang because so many processes. I tried to kill the process using process.kill() and by specifying process PID but still not working

    My code is :

    command = 'ffprobe -v error -show_entries stream=width,height %s'%(url)
    process = subprocess.Popen(shlex.split(command),shell=False,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    print process.pid
    output = process.communicate()
    for i in output:
       if i !='':
           if '403 Forbidden' in i:
           #### update database
           elif  '401 Unauthorized' in i:
               #### update database
           else:
               screenshot = screenshots_path+  str(time.strftime("%Y%m%d%H%M%S",time.localtime()))
               play_command = """ffmpeg -i """+m3u_url+""" -vframes 1 -q:v 1  -vf drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf:x=(w-text_w)/2:y=(h-text_h-line_h): fontsize=24 :fontcolor=white@1.0 : text= \\'"""+str(m3u_url)+"""'"  %s.jpg -hide_banner"""%(screenshot)
               process = subprocess.Popen(shlex.split(play_command),shell=False,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
               process.kill()