
Recherche avancée
Autres articles (82)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Possibilité de déploiement en ferme
12 avril 2011, parMediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)
Sur d’autres sites (7295)
-
heroku-22 stack discord.py bot doesn't play music
30 août 2022, par bon hoI'm making music bot with discord.py and using heroku. bot is playing music my localhost but heroku host is not playing music.


I found what cause a bug.
It working nicely in heroku-20, but not working in heroku-22 stack.


How can I use heroku-22 stack without error ?
What can I do ?


I'm sorry my english is bad.


my code :


import youtube_dl
import discord
from discord import app_commands,Interaction
import asyncio
import os

class MyClient(discord.Client):
 async def on_ready(self):
 await self.wait_until_ready()
 await tree.sync()
 print(f"login at {self.user}")
 
intents= discord.Intents.all()
client = MyClient(intents=intents)
tree = app_commands.CommandTree(client)

youtube_dl.utils.bug_reports_message = lambda: ''
ytdl_format_options = {
 'format': 'bestaudio/best',
 'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s',
 'restrictfilenames': True,
 'noplaylist': True,
 'nocheckcertificate': True,
 'ignoreerrors': False,
 'logtostderr': False,
 'quiet': True,
 'no_warnings': True,
 'default_search': 'auto',
 'source_address': '0.0.0.0', # bind to ipv4 since ipv6 addresses cause issues sometimes
}

ffmpeg_options = {
 'options': '-vn',
}
ytdl = youtube_dl.YoutubeDL(ytdl_format_options)
class YTDLSource(discord.PCMVolumeTransformer):
 def __init__(self, source, *, data, volume=0.5):
 super().__init__(source, volume)

 self.data = data

 self.title = data.get('title')
 self.url = data.get('url')

 @classmethod
 async def from_url(cls, url, *, loop=None, stream=True):
 loop = loop or asyncio.get_event_loop()
 data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))
 if 'entries' in data:
 # take first item from a playlist
 data=data['entries'][0]
 filename = data['url'] if stream else ytdl.prepare_filename(data)
 return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)
queue={}
@tree.command(name="play", description="play music")
async def playmusic(interaction:Interaction,url_title:str,playfirst:bool=False):
 await interaction.response.send_message("I'm looking for music!!")
 guild=str(interaction.guild.id)
 try:
 queue[guild]
 except KeyError:
 queue[guild]=[]
 if interaction.user.voice is None:
 await interaction.edit_original_response(content="you must join any voice channel")
 else:
 voice_client: discord.VoiceClient = discord.utils.get(client.voice_clients, guild=interaction.guild)
 if voice_client == None:
 await interaction.user.voice.channel.connect()
 voice_client: discord.VoiceClient = discord.utils.get(client.voice_clients, guild=interaction.guild)
 player = await YTDLSource.from_url(url_title, loop=None)
 if playfirst and len(queue[guild])>1:
 queue[guild].insert(1,player)
 else:
 queue[guild].append(player)
 if not voice_client.is_playing():
 voice_client.play(player,after=None)
 await interaction.edit_original_response(content=f"{player.title} playing!!")
 else:
 await interaction.edit_original_response(content=f"{player.title} enqueued!")
 await asyncio.sleep(7)
 await interaction.delete_original_response()

client.run(token)



-
how can I convert a stack of PNGs with transparency to a video playable with Keynote
29 juin 2022, par John SmithI used to convert a stack of PNGs with alpha transparency using ffmpeg :


ffmpeg -i frame_%03d.png -vcodec png output.mov



I have an old
mov
where this worked. Now I tried to do that again a while later (on an M1 Mac now). Now it doesn't work anymore. Here are the file properties :






 property 

old movie (works) 

new movie (does not work) 







 resolution 

378 × 378 

1600 × 1000 




 codec 

Apple ProRes 4444 

PNG 




 alpha channel 

yes 

? 




 color profile 

SD (6-1-6) 

? 




 software 

Lavf57.41.100 

Lavf59.16.100 









The
?
shows that I cannot open the new file in Quicktime, nor import it in Keynote. Any idea how I can useffmpeg
to convert my image stack to a file with transparency that works in Keynote / Quicktime ?

-
[MPV][FFMPEG] stack two videos to play them synchronously without re-encoding, but with a rotation (from metadata) applied to one of them
10 juin 2022, par publicIDII have 3 videos with the same resolution (1920x1080), but one of them has the rotation property set in the metadata while the two others are reencoded in the correct orientation.


I would like to stack them horizontally to compare their quality without re-encoding.
I know how to dynamically stack and display them with MPV, but not when one of them has a rotation metadata property :


Two videos in parallel


mpv --lavfi-complex="[vid1][vid2]hstack[vo];[aid1][aid2]amix[ao]" "v1_metadata.mp4" --external-file="v2.mp4"



Three videos in parallel


mpv --lavfi-complex="[vid1][vid2][vid3]hstack=inputs=3[vo];[aid1][aid2][aid3]amix=inputs=3[ao]" "v1_metadata.mp4" --external-files="v2.mp4;v3.mp4"



Precisions


v1_metadata.mp4 : rotation in the metadata




v2.mp4, v3.mp4 : no metadata rotation




How can I "apply" the rotation to the first video (v1_metadata.mp4) in order to display it stacked with the others ?


Thanks,