
Recherche avancée
Médias (91)
-
Les Miserables
9 décembre 2019, par
Mis à jour : Décembre 2019
Langue : français
Type : Textuel
-
VideoHandle
8 novembre 2019, par
Mis à jour : Novembre 2019
Langue : français
Type : Video
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
-
Un test - mauritanie
3 avril 2014, par
Mis à jour : Avril 2014
Langue : français
Type : Textuel
-
Pourquoi Obama lit il mes mails ?
4 février 2014, par
Mis à jour : Février 2014
Langue : français
-
IMG 0222
6 octobre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Image
Autres articles (69)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
Publier sur MédiaSpip
13 juin 2013Puis-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 -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.
Sur d’autres sites (9458)
-
Anomalie #4189 : extraire_multi mélange un /li /ul final avec le de langue ajouté par code_...
5 octobre 2018, par jluc -Plutôt
- <span class="CodeRay"><span class="local-variable">$mode</span> = <span class="predefined">preg_match</span>(<span class="string"><span class="delimiter">'</span><span class="content">,span><span class="delimiter">'</span></span> . _BALISES_BLOCS . <span class="string"><span class="delimiter">'</span><span class="content">)[>[:space:]],iS</span><span class="delimiter">'</span></span>, <span class="local-variable">$trad_propre</span>) ? <span class="string"><span class="delimiter">'</span><span class="content">div</span><span class="delimiter">'</span></span> : <span class="string"><span class="delimiter">'</span><span class="content">span</span><span class="delimiter">'</span></span>;
- <span class="keyword">if</span> (<span class="local-variable">$mode</span>==<span class="string"><span class="delimiter">'</span><span class="content">div</span><span class="delimiter">'</span></span> <span class="keyword">and</span> (<span class="predefined">substr</span>(<span class="predefined">rtrim</span>(<span class="local-variable">$trad_propre</span>), -<span class="integer">5</span>)==<span class="string"><span class="delimiter">'</span><span class="content"></span><span class="delimiter">'</span></span>))
- <span class="local-variable">$trad</span> .= <span class="string"><span class="delimiter">"</span><span class="char">\n</span><span class="char">\n</span><span class="delimiter">"</span></span>;
- <span class="local-variable">$trad</span> = code_echappement(<span class="local-variable">$trad</span>, <span class="string"><span class="delimiter">'</span><span class="content">multi</span><span class="delimiter">'</span></span>, <span class="predefined-constant">false</span>, <span class="local-variable">$mode</span>);
- </span></span>
-
Mixing video streams with a fade transition effect myself
28 mai 2013, par AsTeRI would like to make a a software setup that would let the user switch between two webcam feeds (or more but let's consider two). I would like a fade in/out effect while switching. My main problem is that I don't know how to start.
There seems to be some ffmpeg tool that could do the job (like libavfilter) but I don't get how I could setup it.
What should I consider to use if I want to access frame image to make the transition myself ? Is there some simpler way ?
I know that this question looks really poorly written, but I'm as lost as I look.
-
voice_client.play doesn't continue loop (Discord) (Solved)
19 mars 2023, par RazurioSOLVED see end


songs = asyncio.Queue(maxsize=0)
currently_playing = False


@client.command()
async def play(ctx, url):
 global songs
 global currently_playing
 if currently_playing:
 with yt_dlp.YoutubeDL({"format": "bestaudio", "outtmpl": "Queue_Download/%(title)s.%(ext)s"}) as ydl:
 info = ydl.extract_info(url, download=True)
 filename = ydl.prepare_filename(info)
 await songs.put({"file": filename, "info": video_info(url)})
 # print("test 1")
 else:
 with yt_dlp.YoutubeDL({"format": "bestaudio", "outtmpl": "Queue_Download/%(title)s.%(ext)s"}) as ydl:
 info = ydl.extract_info(url, download=True)
 filename = ydl.prepare_filename(info)
 await songs.put({"file": filename, "info": video_info(url)})
 # print("test 2")
 asyncio.create_task(queue(ctx))



async def queue(ctx):
 global songs
 global currently_playing
 currently_playing = True
 while True:
 if songs.empty():
 currently_playing = False
 await ctx.reply("Queue is now empty")
 await ctx.voice_client.disconnect() # disconnect from voice channel when queue is empty
 break
 else: 
 song = await songs.get()
 filename = song["file"]
 voice_channel = ctx.author.voice.channel
 if not ctx.voice_client: # check if bot is not already connected to a voice channel
 await voice_channel.connect()

 await ctx.reply('playing')
 await ctx.voice_client.play(discord.FFmpegPCMAudio(filename))

@client.command()
async def stop(ctx):
 global songs
 await ctx.voice_client.disconnect()
 await empty_queue(songs)
 await ctx.reply('Stopped')

async def empty_queue(songs):
 while not songs.empty():
 songs.get_nowait()



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


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


async def play_next(ctx):
global songs
global currently_playing
if songs.empty():
 currently_playing = False
 await ctx.reply("Queue is now empty")
 await ctx.voice_client.disconnect() # disconnect from voice channel when queue is empty
else: 
 song = await songs.get()
 filename = song["file"]
 voice_channel = ctx.author.voice.channel
 if not ctx.voice_client: # check if bot is not already connected to a voice channel
 await voice_channel.connect()

 def after(error):
 if error:
 print(f'Error in after callback: {error}')
 asyncio.create_task(play_next(ctx))

 await ctx.reply('playing')
 ctx.voice_client.play(discord.FFmpegPCMAudio(filename), after=after)



I tried using the after parameter like like but I just get an error in line 116, in after asyncio.create_task(play_next(ctx)) "no running event loop" ... "Calling the after function failed"


EDIT


async def play_next(ctx):
global loop
global songs
global currently_playing
global tasks
loop = asyncio.get_event_loop()
if songs.empty():
 currently_playing = False
 await ctx.reply("Queue is now empty")
 await ctx.voice_client.disconnect() # disconnect from voice channel when queue is empty
else:
 
 song = await songs.get()
 filename = song["file"]
 voice_channel = ctx.author.voice.channel
 if not ctx.voice_client: # check if bot is not already connected to a voice channel
 await voice_channel.connect()
 def after(error):
 if error:
 print("er")
 loop.create_task(queue(ctx))

 await ctx.reply('playing')
 ctx.voice_client.play(discord.FFmpegPCMAudio(filename), after=after)



using loop = asyncio.get_event_loop() and loop.create_task(queue(ctx)) made it finally work
took inspiration from this post