Ffmpeg custom Makefile

Hi there,

ffmpeg, ffprobe, ffserver [and now ffplay, added necessary entries] can be built now in the custom version.

Ted Hess (thank you very much) sent me a Makefile for that purpose. I have adapted it to build a custom configuration that I needed. I also modified Config.in accordingly.

So far the Makefile works (with the variable DISPLAYMENUS=n). With DISPLAYMENUS=y the menus work very nice, but it has no function (it needs fixing, it would be nice having them working). I included for the menus a new file, FFmpeg.in. All these files belong to the ./feeds/packages/multimedia/ffmpeg/ folder.

The file Config.in (and Makefile) include some options for ffmpeg (programs and library), but not all. It would be nice to add the rest (I added the ones I needed).


Hi Ted,

Thank you very much for your help. I tried your Makefile with the existing custom options you put in it, and it worked first attempt

I'll start testing tomorrow, adjusting it to my needs. I'll let you know the results through the forum.

Again, thank you very much,


El 25/10/18 a les 19:18, Ted Hess ha escrit:

Hi Francesc -

Since you are not the first person to request for this type of configuration, I thought I'd take a stab at it. The attached Makefile will build the ffmpeg utilities (ffmpeg, ffserver & ffprobe) with a libffmpeg-custom dependency. What you are essentially missing in your attempt is that ffmpeg requires libavfiler and libswresample which are not part of the custom build configurations.

While this Makefile will build the packages you specify, I have no idea if ffmpeg will run or will do what you want - It is up to you to do the testing.

Please let me know how you make out. If this seems to be the right direction and you get something to work, we would all be better served if this discussion were moved to our forum (https://forum.openwrt.org) instead of personal emails.


I have a "one size fits all" which should be easy to adapt if you're interested. It uses ffmpeg 4.0.2 and works on PPC and ARM. It also compiles on MIPS (incl MIPS64) but I haven't run tested ffmpeg on those platforms.

Thank you very much. I have it solved (custom ffmpeg and libffmpeg-custom), with version 3.2.12, mips (HAME-MPR-A2 platform). I had a constraint in the size, the full version did not fit...
However, I am interested in your solution, to learn how you did the Makefile...

To slim it down (few examples):
Drop lame-lib, fdk-aac, libx264 (encoder)
Don't strip CFLAGS
Drop various decoders, encoders etc if not needed

The idea is to cover most media formats and containers you "actually" will come across and be able to do some kind of remuxing, transcoding etc. There are a few issues such as not being able to specify pixel format but that is only a concern if you're encoding. You get the idea (hopefully) :slight_smile:

I am in the process of adding a simple option to libffmpeg-custom configs to include the CLI programs in the build. Separate packages with a "-custom" suffix are created.

Currently staged pull-request which should be merged in a couple of days can be reviewed here: https://github.com/openwrt/packages/pull/7378