Skip to content
Advertisement

Heroku : FFMpeg installed but php worker can’t find it

Context

I’ve a RabbitMQ’s queue that contains AMQPMessage, those messages are referencing a video that needs to be treated (cut essentially and encoded in x264 also)

Here’s the code that cause the issue (pretty straightforward)

JavaScript

Error Message

TL;DR : Error: "Unable to load FFProbe"

[2019-12-03 14:55:07] messenger.ERROR: Error thrown while handling message AppApiMessageAMQPvideoFFMPEG. Sending for retry #1 using 1000 ms delay. Error: “Unable to load FFProbe” {“message”:”[object] (AppApiMessageAMQPvideoFFMPEG: {})”,”class”:”AppApiMessageAMQPvideoFFMPEG”,”retryCount”:1,”delay”:1000,”error”:”Unable to load FFProbe”,”exception”:”[object] (SymfonyComponentMessengerExceptionHandlerFailedException(code: 0): Unable to load FFProbe at /app/vendor/symfony/messenger/Middleware/HandleMessageMiddleware.php:80, FFMpegExceptionExecutableNotFoundException(code: 0): Unable to load FFProbe at /app/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php:50, AlchemyBinaryDriverExceptionExecutableNotFoundException(code: 0): Executable not found, proposed : /usr/bin/ffprobe at /app/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php:160)”} []

Configuration & tests

On Heroku I’ve 2 dynos :

JavaScript

On this platform, I’ve also 3 buildpacks, look below, with this specific buildpack :

with a custom buildpack for ffmpeg

To make sure that all is available here’s the results of my checks :

JavaScript
JavaScript

All good !

Disclaimer

This code is working well on another platform (handled by kubernetes), so it may need some adjustments with heroku. But can’t find it.

Why this error since my configuration is not showing any missconfigurations? What am I missing here?

Advertisement

Answer

Change to:

JavaScript

You were using /usr/bin/, but your files were not located there.

  • The script edited your PATH to include $HOME/vendor/ffmpeg_bundle/ffmpeg/bin and --prefix is set to /app/vendor/ffmpeg, so I suspect this is the location of the files.

  • Run whereis ffmpeg. If ffmpeg is in your PATH it will give you the location.

  • Why use ffmpeg from 2014? Development is very active so you’re missing out on thousands of updates. Also, I recommend avoiding compiling without --disable-asm if possible (same for x264).

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement