Compiling FFmpeg

As a learning exercise, I’m compiling FFmpeg on my laptop running Rocky Linux 9.2 and, following this guide, the process works fine.

The problem is that sometimes, using the resulting version of FFmpeg, I get this error:

https protocol not found, recompile FFmpeg with openssl, gnutls or securetransport enabled.

How should I modify the configure line in the guide:

PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \

to make the compiler use openssl or gnutls that are both already installed on my PC? Is that possible? I have even compiled from scratch a new version of openssl just to include that in the building process, but without luck.

(I understand that my question shows all my ignorance about the basic principles of compiling, so please be patient with me!)

Thanks a lot,

Have you tried the ffmpeg package from Rpmfusion? It might have the features you want so you don’t have to compile it yourself.

Well, I’m sure that the package there has the --enable-openssl option, but as I said it is above all a learning exercise: I would like to better understand the compiling process.

Thanks anyway!

I’ve used that guide successfully in the past. It’s worked for me, though I haven’t tried on Rocky 9.2. I don’t know when i’ll get a chance to try it. I’d try adding an --enable line, I do see, on my ffmpeg on FreeBSD, it has --disable-openssl and --enable-gnutls.

By the way, to put all the info into a text file, you can just do
ffmpeg 2 >out.txt
as (I’ve forgotten the reason) the result of just typing ffmpeg is considered STDERR, not STDOUT.

Anyway, looking at the guide, my guess would be tryi adding --enable-openssl when you compile ffmpeg at the end. I should add that I’m definitely not very knowledgeable about this, and when I did it, I just followed the guide’s directions.

Guideline #1: Compile with regular account, never as ‘root’.

The root has privileges to mess up the entire system. That is a “learning experience” too, but for another day.

The FFmpeg guide seems to do it “right”.

A traditional build has three steps:

  1. configure : Generates instructions into ‘Makefile’
  2. make : program ‘make’ does use Makefile to run compiler
  3. make install : program ‘make’ does use Makefile to copy result into “production”

The configure looks at your system to check what it can see. What it does find, it does use in the instructions.
The project may have some must have requirements. If they are not found, then configure fails.
The project may have some optional requirements. If they are found, then configure adds a feature to program.
You can give configure options, like --with-mpi, --prefix=somepath, etc. The project defines what options can be used. The with/without options allow to require require that are not ‘must have’ by default, or leave out features even when they could be built in.

That guide for FFmpeg shows that its configure does have --extra-xyz and --enable-xyz style options.
You can probably see the list of possible options with:

./configure --help

I’d look for ssl/tls-related options from it.

Compilation (of C/C++ source to executable) has steps:

  1. Preprocessor prepares “translation units” by expanding macros and directives, such as #include
  2. Compiler generates object file from each translation unti
  3. Linker combines object files into executable binary

The compiler needs declarations of functions and definitions of types in order to compile source code that does refer to those external types and functions. The definitions are in header files.

The linker needs object code of external libraries that inmplements the external functions.

The configure most likely seeks files (headers and library shared objects) from a set of directories.

The openssl is in two packages: openssl and openssl-devel. The first has the library that running programs use. The second has the headers, etc that the compilation does need.

If you don’t have the ‘openssl-devel’ installed, then your configure won’t find openssl.


Thanks for your help.

The guide works all right for me as well, but without openssl.

I did add --enable-openssl but always getting “openssl not found” right at the beginning of the process.


I haven’t retried it yet with 9.2, but do you have the package openssl-devel?

1 Like

Hey, thanks a lot @jlehtone for this “introduction to compiling”!

I’ll check a few details once I’m back home and I’ll be very careful with my root account, I promise.

I think I’ve installed that, but I’ll check later this evening. Thanks again for your help.

Right, I hadn’t actually installed openssl-devel; with that package, as you both explained, the compiler has been able to find openssl and I’m now happy with a perfectly functional FFmpeg.

Thanks to all for your patience.

@jlehtone : I’ve printed your guide and I’m studying it with much interest. I really appreciate the time you dedicated to that.

Glad to hear it’s working. I just follwed the guide to install on a VirtualBox machine and was about to report back that it was working for me.