
Recherche avancée
Médias (3)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (48)
-
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 -
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
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 (11145)
-
discord.ext.commands.errors.CommandInvokeError : Command raised an exception : ClientException : ffmpeg was not found
22 juillet 2022, par MSTI made a music bot on Replit but, when running my code I get this error :
discord.ext.commands.errors.CommandInvokeError : Command raised an exception : ClientException : ffmpeg was not found.


Can someone help me fix this ?


main.py


import discord
from discord.ext import commands
import music

cogs = [music]

client = commands.Bot(command_prefix='!', intents = discord.Intents.all())

for i in range(len(cogs)):
 cogs[i].setup(client)


client.run("token")



music.py


import discord
from discord.ext import commands
import youtube_dl
import ffmpeg

class music(commands.Cog):
 def __init__(self,client):
 self.client = client

 @commands.command(name="join")
 async def join(self,ctx):
 if ctx.author.voice is None:
 await ctx.send("You are not in a Voice Channel!")
 voice_channel = ctx.author.voice.channel
 if ctx.voice_client is None:
 await voice_channel.connect()
 else:
 await ctx.voice_client.move_to(voice_channel)

 @commands.command(name="disconnect")
 async def disconnect(self,ctx):
 await ctx.voice_client.disconnect()

 @commands.command(name="play")
 async def play(self,ctx,url):
 ctx.voice_client.stop()
 FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
 YDL_OPTIONS = {'format':"bestaudio"}
 vc = ctx.voice_client

 with youtube_dl.YoutubeDL(YDL_OPTIONS) as ydl:
 info = ydl.extract_info(url, download=False)
 url2 = info['formats'][0]['url']
 source = await discord.FFmpegOpusAudio.from_probe(url2,**FFMPEG_OPTIONS)
 vc.play(source)


 @commands.command(name="pause")
 async def pause(self,ctx):
 await ctx.voice_client.pause()
 await ctx.send("Paused Playing Music!")

 @commands.command(name="resume")
 async def resume(self,ctx):
 await ctx.voice_client.resume()
 await ctx.send("Resumed Playing Music!")

def setup(client):
 client.add_cog(music(client))



So, The bot is able to join the Voice Channel but when I ask it to play a song, it gives this error :


[youtube] Pkh8UtuejGw: Downloading webpage
[youtube] Pkh8UtuejGw: Downloading player afeb58ff
Ignoring exception in command play:
Traceback (most recent call last):
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
 ret = await coro(*args, **kwargs)
 File "/home/runner/DiscordMusicBotTest/music.py", line 34, in play
 source = await discord.FFmpegOpusAudio.from_probe(url2,**FFMPEG_OPTIONS)
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/site-packages/discord/player.py", line 387, in from_probe
 return cls(source, bitrate=bitrate, codec=codec, **kwargs)
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/site-packages/discord/player.py", line 324, in __init__
 super().__init__(source, executable=executable, args=args, **subprocess_kwargs)
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/site-packages/discord/player.py", line 138, in __init__
 self._process = self._spawn_process(args, **kwargs)
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/site-packages/discord/player.py", line 147, in _spawn_process
 raise ClientException(executable + ' was not found.') from None
discord.errors.ClientException: ffmpeg was not found.

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

Traceback (most recent call last):
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
 await ctx.command.invoke(ctx)
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
 await injected(*ctx.args, **ctx.kwargs)
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/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: ClientException: ffmpeg was not found.



-
exec.Command not formating input correctly ?
20 mai 2016, par nadermxI’m having a bizzar issue. I have a ffmpeg I run as a subprocess
ffmpeg = exec.Command("nice", "-n", "10",
"ffmpeg",
"-http_proxy", RandomProxyAddress(),
"-i", fmt.Sprintf(`%s`, vi.GetUrl()),
"-acodec", "libmp3lame",
"-metadata", fmt.Sprintf(`title=%s`, vi.GetTitle()),
"-b:a", fmt.Sprintf("%s", vi.GetAudioQuality()),
"-threads", "0",
"-f", "mp3",
"-")But when I run this command I get
Server returned 403 Forbidden (access denied)
but when I run the command outside of go it functions correctly.
ffmpeg -http_proxy http://user:user@123.123.123.123:29842 -i 'https://r5---sn-uqx2-aphl.googlevideo.com/videoplayback?fexp=9405981%2C9414672%2C9416126%2C9416891%2C9422342%2C9422596%2C9423965%2C9425077%2C9428398%2C9431012%2C9432564%2C9433096%2C9433946%2C9434085%2C9435697%2C9435736%2C9435876%2C9437285%2C9437344&clen=3716608&itag=140&ipbits=0&upn=QpGXy0IIxmU&key=yt6&expire=1463728239&id=o-AIlDlUBTmu9UXu0yMp77VXR502YekQi98e6JpvbSzjo0&ms=au&gcr=pe&mv=m&source=youtube&mm=31&mn=sn-uqx2-aphl&pl=24&requiressl=yes&ip=190.234.105.134&mime=audio%2Fmp4&mt=1463706418&sparams=clen%2Cdur%2Cgcr%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&lmt=1458211566542818&gir=yes&keepalive=yes&sver=3&dur=233.964&initcwndbps=563750&signature=53A8732F8841FC6AC6D6737B35B4EF6FC000F2F0.59E11FB2D3DF96F4C00CE8D84C28D3A546E04F78&ratebypass=yes' -acodec 'libmp3lame' -metadata 'title=This awesome song' -b:a '128k' -threads '0' -f 'mp3' test.mp3
Does it have something to do with my string formatting or quotations in the exec.Command ?
Edit :
fmt.Print output
nice-n10ffmpeg-http_proxyhttp://user:user@1.1.1.1:29842-ihttps://r17---sn-q4f7snes.googlevideo.com/videoplayback?pl=21&source=youtube&sparams=clen%2Cdur%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cnh%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&upn=mwBuBq7HijI&keepalive=yes&nh=IgpwcjAzLmRmdzA2KgkxMjcuMC4wLjE&expire=1462445495&id=o-ADXLtGoWBQDEKqNcD9aFNT4IFc8EZ8gu_TwZfCshkmjs&lmt=1453349484731934&ip=142.91.200.197&sver=3&dur=264.382&mv=u&mt=1462423294&ms=au&mn=sn-q4f7snes&signature=6DD5ED6A89A2FB8A30DD7EBAA87333EDDFF1D832.B5D0C233EA672891006D2993A745E7224F29BF02&mm=31&itag=140&gir=yes&clen=4199716&mime=audio%2Fmp4&ipbits=0&requiressl=yes&key=yt6&fexp=9416126%2C9416891%2C9422596%2C9428398%2C9431012%2C9433096%2C9433946&ratebypass=yes-acodeclibmp3lame-ss0-metadatatitle=Khong Duong no sugar Music Video-b:a128k-threads0-fmp3-&{/usr/bin/nice [nice -n 10 ffmpeg -http_proxy http://user:user@1.1.1.1:29842 -i https://r17---sn-q4f7snes.googlevideo.com/videoplayback?pl=21&source=youtube&sparams=clen%2Cdur%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cnh%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&upn=mwBuBq7HijI&keepalive=yes&nh=IgpwcjAzLmRmdzA2KgkxMjcuMC4wLjE&expire=1462445495&id=o-ADXLtGoWBQDEKqNcD9aFNT4IFc8EZ8gu_TwZfCshkmjs&lmt=1453349484731934&ip=142.91.200.197&sver=3&dur=264.382&mv=u&mt=1462423294&ms=au&mn=sn-q4f7snes&signature=6DD5ED6A89A2FB8A30DD7EBAA87333EDDFF1D832.B5D0C233EA672891006D2993A745E7224F29BF02&mm=31&itag=140&gir=yes&clen=4199716&mime=audio%2Fmp4&ipbits=0&requiressl=yes&key=yt6&fexp=9416126%2C9416891%2C9422596%2C9428398%2C9431012%2C9433096%2C9433946&ratebypass=yes -acodec libmp3lame -metadata title=Khong Duong no sugar Music Video -b:a 128k -threads 0 -f mp3 -] [] <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>}
</nil></nil></nil></nil></nil></nil></nil></nil> -
Audio Files downloaded from YouTube-DL are corrupted
1er juin 2022, par SushilI have written a small piece of code that downloads audios and videos from YouTube using
YouTube-DL
. Here is my code :

from __future__ import unicode_literals
import youtube_dl

link = input("Enter the video link:")

while True:
 choice = input("Enter a for audio file, v for video file:")
 if choice == "a" or choice == "v":
 break

ydl_opts = {}

if choice == "a":
 ydl_opts = {
 'format': 'bestaudio/best',
 'postprocessors': [{
 'key': 'FFmpegExtractAudio',
 'preferredcodec': 'mp3',
 'preferredquality': '192',
 }],
 }
else:
 ydl_opts = {'format':137}
 
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
 info_dict = ydl.extract_info(link, download=False)
 video_title = info_dict.get('title', None)

if choice == "a":
 path = f'D:\\DwnldsYT\\{video_title}.mp3'
if choice == "v":
 path = f'D:\\DwnldsYT\\{video_title}.mp4'

ydl_opts.update({'outtmpl':path})

with youtube_dl.YoutubeDL(ydl_opts) as ydl:
 ydl.download([link])



This works fine. I am able to play the downloaded audio. But when I try to read the same audio file, it shows me an error.


Code :


from pydub import AudioSegment

song = AudioSegment.from_mp3("D:\\DwnldsYT\\Cartoon - On & On (feat. Daniel Levi) [NCS Release].mp3")



Output :


Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[mp3float @ 000001f2425c2500] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[abuffer @ 000001f242280300] Value inf for parameter 'time_base' out of range [0 - 2.14748e+09]
 Last message repeated 3 times
[abuffer @ 000001f242280300] Error setting option time_base to value 1/0.
[graph_0_in_0_0 @ 000001f242280e80] Error applying options to the filter.
Error reinitializing filters!
Error while filtering: Result too large
Finishing stream 0:0 without any data written to it.
[abuffer @ 000001f242280300] Value inf for parameter 'time_base' out of range [0 - 2.14748e+09]
 Last message repeated 3 times
[abuffer @ 000001f242280300] Error setting option time_base to value 1/0.
[graph_0_in_0_0 @ 000001f242280e80] Error applying options to the filter.
Error configuring filter graph
Conversion failed!



Is this because the audio downloaded is corrupted ? And how to solve this problem ? Any help would be appreciated. Thanks !