
Recherche avancée
Médias (91)
-
Head down (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Echoplex (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Discipline (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Letting you (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
1 000 000 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
999 999 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (72)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
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 -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (10327)
-
Discord.py - IndexError : list index out of range
23 novembre 2020, par itsnexnHello i start to learn python and i make bot for practie but i got this error


Ignoring exception in command play:
Traceback (most recent call last):
 File "C:\Users\sinad\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
 ret = await coro(*args, **kwargs)
 File "d:\Projects\discord\musicbot.py", line 147, in play
 player = await YTDLSource.from_url(queue[0], loop=client.loop)
IndexError: list index out of range



and i use ffmpeg to convert audio
and i write this bot in youtube and discord.py documentation
itswork well without music commend but if i use that i got error and isnt working idk why ...
this is my first python project so this is happening and its normal
and this is my code :


import discord
from discord.ext import commands, tasks
from discord.voice_client import VoiceClient

import youtube_dl

from random import choice

from youtube_dl.utils import lowercase_escape

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=False):
 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)


client = commands.Bot(command_prefix='.')

status = ['']
queue = []

#print on terminal when is bot ready
@client.event
async def on_ready():
 change_status.start()
 print('Bot is online!')

#Welcome message
@client.event
async def on_member_join(member):
 channel = discord.utils.get(member.guild.channels, name='general')
 await channel.send(f'Welcome {member.mention}! Ready to jam out? See `.help` command for details!')

#ping
@client.command(name='ping', help='This command returns the latency')
async def ping(ctx):
 await ctx.send(f'**Ping!** Latency: {round(client.latency * 1000)}ms')

@client.event
async def on_message(message):

 if message.content in ['hello', 'Hello']:
 await message.channel.send("**wasaaaaaap**")

 await client.process_commands(message)


#join
@client.command(name='join', help='This command makes the bot join the voice channel')
async def join(ctx):
 if not ctx.message.author.voice:
 await ctx.send("You are not connected to a voice channel")
 return

 else:
 channel = ctx.message.author.voice.channel

 await channel.connect()

#queue
@client.command(name='queue', help='This command adds a song to the queue')
async def queue_(ctx, url):
 global queue

 queue.append(url)
 await ctx.send(f'`{url}` added to queue!')

#remove
@client.command(name='remove', help='This command removes an item from the list')
async def remove(ctx, number):
 global queue

 try:
 del(queue[int(number)])
 await ctx.send(f'Your queue is now `{queue}!`')

 except:
 await ctx.send('Your queue is either **empty** or the index is **out of range**')

#play
@client.command(name='play', help='This command plays songs')
async def play(ctx):
 global queue

 server = ctx.message.guild
 voice_channel = server.voice_client

 async with ctx.typing():
 player = await YTDLSource.from_url(queue[0], loop=client.loop)
 voice_channel.play(player, after=lambda e: print('Player error: %s' % e) if e else None)

 await ctx.send('**Now playing:** {}'.format(player.title))
 del(queue[0])

#pause
@client.command(name='pause', help='This command pauses the song')
async def pause(ctx):
 server = ctx.message.guild
 voice_channel = server.voice_client

 voice_channel.pause()

#resune
@client.command(name='resume', help='This command resumes the song!')
async def resume(ctx):
 server = ctx.message.guild
 voice_channel = server.voice_client

 voice_channel.resume()

#viow
@client.command(name='view', help='This command shows the queue')
async def view(ctx):
 await ctx.send(f'Your queue is now `{queue}!`')

#leave
@client.command(name='leave', help='This command stops makes the bot leave the voice channel')
async def leave(ctx):
 voice_client = ctx.message.guild.voice_client
 await voice_client.disconnect()

#stop
@client.command(name='stop', help='This command stops the song!')
async def stop(ctx):
 server = ctx.message.guild
 voice_channel = server.voice_client

 voice_channel.stop()

@tasks.loop(seconds=20)
async def change_status():
 await client.change_presence(activity=discord.Game(choice(status)))

client.run("my_secret")



-
avformat : add demuxer for argonaut games' ASF format
26 janvier 2020, par Zane van Iperenavformat : add demuxer for argonaut games' ASF format
Adds support for the custom ASF container used by some Argonaut Games'
games, such as 'Croc ! Legend of the Gobbos', and 'Croc 2'.Can also handle the sample files in :
https://samples.ffmpeg.org/game-formats/brender/part2.zipSigned-off-by : Zane van Iperen <zane@zanevaniperen.com>
-
What resolution would be best for processing videos in firebase functions ? [closed]
11 janvier 2020, par NathanI’m making an app that is mainly used for sharing videos of maximum 30 seconds long. One video example could be a screen recording of someone’s computer screen or a game. I have this code that checks whether the uploaded video that has just been uploaded to firebase storage has been processed or not and if it hasn’t then I use ffmpeg to process the video (change the resolution etc.) with this command :
const promise = spawn('./ffmpeg', ['-i', tempFilePath, '-vf', 'scale=1280:720', targetTempFilePath]);
Now with these commands, the firebase function is giving me a timeout error when I upload 30 second clips since I’m only converting the video to 720. I was just wondering what compression settings would be sufficient enough for the video to :
- Be still a high enough quality in my app
- Not take ages processing the video in the function (10-20 second clips works perfectly well).
I know the better option would be to use Googles App engine or something similar to process videos but I’d prefer it to avoid that at the moment, if I can’t process videos to a good enough quality without sacrificing efficiency then I will go to something like Google’s App engine, just need some advice and some pointers for it otherwise.
EDIT :
I’ve seen instagram compresses their videos to a resolution of 640x640 ? Would that be reasonable or is it dependent on the original clip’s resolution ?
Thanks