docker discord.py ffmpeg.exe was not found

My code works on windows fine I'm just stumped on how to migrate it to my docker server for stability reasons and my old vm shit the bed. bellow is my main playing loop

async def main_playing_loop(vc, ctx):
    global skip
    while len(queued[str(ctx.guild.id)]) > 0:
        try:
            print(vc.is_playing())
            while vc.is_playing() or vc.is_paused():
                await asyncio.sleep(2)
                skip_func(vc)
                pass

        except AttributeError:
            pass
        try:
            url = str(queued[str(ctx.guild.id)][0])
            download_video(ctx, url)
            vc.play(discord.FFmpegPCMAudio(executable="ffmpeg.exe", source=str(ctx.guild.id) + ".mp3"))
            del queued[str(ctx.guild.id)][0]
        except:
            break

log of what its doing

discord_main_1  | [youtube] dQw4w9WgXcQ: Downloading android player API JSON
discord_main_1  | [youtube] dQw4w9WgXcQ: Downloading webpage
discord_main_1  | stoping
discord_main_1  | [youtube] dQw4w9WgXcQ: Downloading android player API JSON
discord_main_1  | [info] dQw4w9WgXcQ: Downloading 1 format(s): 251
discord_main_1  | [download] Destination: 866270239342460930.mp3
[download] 100% of 3.28MiB in 00:00                  
discord_main_1  | Ignoring exception in command play:
discord_main_1  | Traceback (most recent call last):
discord_main_1  |   File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 85, in wrapped
discord_main_1  |     ret = await coro(*args, **kwargs)
discord_main_1  |   File "/usr/src/bot/main.py", line 125, in play
discord_main_1  |     vc.play(discord.FFmpegPCMAudio(executable="ffmpeg.exe", source=str(ctx.guild.id) + ".mp3"))
discord_main_1  |   File "/usr/local/lib/python3.10/site-packages/discord/player.py", line 225, in __init__
discord_main_1  |     super().__init__(source, executable=executable, args=args, **subprocess_kwargs)
discord_main_1  |   File "/usr/local/lib/python3.10/site-packages/discord/player.py", line 138, in __init__
discord_main_1  |     self._process = self._spawn_process(args, **kwargs)
discord_main_1  |   File "/usr/local/lib/python3.10/site-packages/discord/player.py", line 147, in _spawn_process
discord_main_1  |     raise ClientException(executable + ' was not found.') from None
discord_main_1  | discord.errors.ClientException: ffmpeg.exe was not found.
discord_main_1  | 
discord_main_1  | The above exception was the direct cause of the following exception:
discord_main_1  | 
discord_main_1  | Traceback (most recent call last):
discord_main_1  |   File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 939, in invoke
discord_main_1  |     await ctx.command.invoke(ctx)
discord_main_1  |   File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 863, in invoke
discord_main_1  |     await injected(*ctx.args, **ctx.kwargs)
discord_main_1  |   File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 94, in wrapped
discord_main_1  |     raise CommandInvokeError(exc) from exc
discord_main_1  | discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: ffmpeg.exe was not found.

i have still got the old exe for ffmpeg i was using on win but that doesn't work on Ubuntu. any help is appreciated thanks.

1 answer

  • answered 2022-05-07 04:20 vincentleoooo

    It seems like you are trying to use a Windows .exe executable on an Ubuntu Docker. This won't work as Windows applications will only work on Windows. You will therefore need to find a way to get the Docker container to install ffmpeg through the package manager (apt for Ubuntu).

    To do that, I hope this other thread helps.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum