Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (48)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip 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, par

    Formulaire 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, par

    Pour 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 MST

    I 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 nadermx

    I’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&amp;source=youtube&amp;sparams=clen%2Cdur%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cnh%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&amp;upn=mwBuBq7HijI&amp;keepalive=yes&amp;nh=IgpwcjAzLmRmdzA2KgkxMjcuMC4wLjE&amp;expire=1462445495&amp;id=o-ADXLtGoWBQDEKqNcD9aFNT4IFc8EZ8gu_TwZfCshkmjs&amp;lmt=1453349484731934&amp;ip=142.91.200.197&amp;sver=3&amp;dur=264.382&amp;mv=u&amp;mt=1462423294&amp;ms=au&amp;mn=sn-q4f7snes&amp;signature=6DD5ED6A89A2FB8A30DD7EBAA87333EDDFF1D832.B5D0C233EA672891006D2993A745E7224F29BF02&amp;mm=31&amp;itag=140&amp;gir=yes&amp;clen=4199716&amp;mime=audio%2Fmp4&amp;ipbits=0&amp;requiressl=yes&amp;key=yt6&amp;fexp=9416126%2C9416891%2C9422596%2C9428398%2C9431012%2C9433096%2C9433946&amp;ratebypass=yes-acodeclibmp3lame-ss0-metadatatitle=Khong Duong no sugar Music Video-b:a128k-threads0-fmp3-&amp;{/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&amp;source=youtube&amp;sparams=clen%2Cdur%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cnh%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&amp;upn=mwBuBq7HijI&amp;keepalive=yes&amp;nh=IgpwcjAzLmRmdzA2KgkxMjcuMC4wLjE&amp;expire=1462445495&amp;id=o-ADXLtGoWBQDEKqNcD9aFNT4IFc8EZ8gu_TwZfCshkmjs&amp;lmt=1453349484731934&amp;ip=142.91.200.197&amp;sver=3&amp;dur=264.382&amp;mv=u&amp;mt=1462423294&amp;ms=au&amp;mn=sn-q4f7snes&amp;signature=6DD5ED6A89A2FB8A30DD7EBAA87333EDDFF1D832.B5D0C233EA672891006D2993A745E7224F29BF02&amp;mm=31&amp;itag=140&amp;gir=yes&amp;clen=4199716&amp;mime=audio%2Fmp4&amp;ipbits=0&amp;requiressl=yes&amp;key=yt6&amp;fexp=9416126%2C9416891%2C9422596%2C9428398%2C9431012%2C9433096%2C9433946&amp;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 Sushil

    I have written a small piece of code that downloads audios and videos from YouTube using YouTube-DL. Here is my code :

    &#xA;

    from __future__ import unicode_literals&#xA;import youtube_dl&#xA;&#xA;link = input("Enter the video link:")&#xA;&#xA;while True:&#xA;    choice = input("Enter a for audio file, v for video file:")&#xA;    if choice == "a" or choice == "v":&#xA;        break&#xA;&#xA;ydl_opts = {}&#xA;&#xA;if choice == "a":&#xA;    ydl_opts = {&#xA;        &#x27;format&#x27;: &#x27;bestaudio/best&#x27;,&#xA;        &#x27;postprocessors&#x27;: [{&#xA;            &#x27;key&#x27;: &#x27;FFmpegExtractAudio&#x27;,&#xA;            &#x27;preferredcodec&#x27;: &#x27;mp3&#x27;,&#xA;            &#x27;preferredquality&#x27;: &#x27;192&#x27;,&#xA;        }],&#xA;    }&#xA;else:&#xA;    ydl_opts = {&#x27;format&#x27;:137}&#xA;    &#xA;with youtube_dl.YoutubeDL(ydl_opts) as ydl:&#xA;    info_dict = ydl.extract_info(link, download=False)&#xA;    video_title = info_dict.get(&#x27;title&#x27;, None)&#xA;&#xA;if choice == "a":&#xA;    path = f&#x27;D:\\DwnldsYT\\{video_title}.mp3&#x27;&#xA;if choice == "v":&#xA;    path = f&#x27;D:\\DwnldsYT\\{video_title}.mp4&#x27;&#xA;&#xA;ydl_opts.update({&#x27;outtmpl&#x27;:path})&#xA;&#xA;with youtube_dl.YoutubeDL(ydl_opts) as ydl:&#xA;    ydl.download([link])&#xA;

    &#xA;

    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.

    &#xA;

    Code :

    &#xA;

    from pydub import AudioSegment&#xA;&#xA;song = AudioSegment.from_mp3("D:\\DwnldsYT\\Cartoon - On &amp; On (feat. Daniel Levi) [NCS Release].mp3")&#xA;

    &#xA;

    Output :

    &#xA;

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

    &#xA;

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

    &#xA;