-1

I’m on Ubuntu 12.04 LTS and I’m trying to write a script that will build FFmpeg from source; with the right flags of course. I’m following the instructions here. I’ve nailed most of it except the very first step titled “getting the dependencies.” Since this build is going to be automated I can’t ask for sudo privileges. I can’t ask people to edit their sudoers fie or Visudo either.

The reason I’m doing any of this—and not just giving people a binary—is that when they execute the binary they are told they are missing some libraries. How do the FFmpeg static builds work out of the box?

Answers to either are accepted.

7
  • Whats wrong with telling them to do that before running your script?
    – krowe
    Mar 17, 2015 at 6:33
  • I can't. It's supposed to just work as this will probably be fetched as a run time dependency and I can't have sudo calls then as it would block execution
    – Srini
    Mar 17, 2015 at 6:41
  • 1
    That is why I suggested that you don't include it. Installation require root privileges. The only way to get those is by sudo or being root. If you don't want to force users to log in as root to run your app then just tell them to have the prerequisites installed before they begin. If you wanted, you could provide that as a script as well but it'd still need perms (and it'd be relying on apt-get to work flawlessly which is why just giving them the commands is best).
    – krowe
    Mar 17, 2015 at 6:45
  • Fair enough. But how do the ffmpeg static builds available for download on the website work out of the box? When I compile ffmpeg it gives me a bin, the downloads are also bins. But if I distribute the downloaded ones they work fine, but if I distribute the ones I compiled it throws missing library errors
    – Srini
    Mar 17, 2015 at 6:47
  • My guess is...for one most of your requirements are actually requirements to build it. That isn't something a static library needs. They also, probably as often as not, rely on you already having very common libraries installed. If they can't expect users to have something then they probably either tell you to also install that or they include it with the build as a separate binary.
    – krowe
    Mar 17, 2015 at 6:53

1 Answer 1

1

There seems to be an XY problem in your approach. You really just want people to be able to run an ffmpeg build without additional dependencies. What you need is a static build, where all the external libraries (x264, etc.) are statically linked into the final binary, and not dynamically loaded from shared objects.

To do that, while configuring ffmpeg in the ./configure step, use these additional flags:

--enable-static --disable-shared

You can see a full example configuration line on this OS X static build download page.

Once configured with the above parameters, your final ffmpeg binary will be standalone.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .