Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFmpeg won't compile #622

Closed
Metaphorce812 opened this issue Nov 2, 2017 · 21 comments
Closed

FFmpeg won't compile #622

Metaphorce812 opened this issue Nov 2, 2017 · 21 comments

Comments

@Metaphorce812
Copy link
Contributor

Metaphorce812 commented Nov 2, 2017

logs.zip
I'm getting the following error when trying to compile a full build of FFmpeg:
ERROR: schannel requested, but some conflicting dependencies are unsatisfied: openssl gnutls
From what I can tell, openssl and gnutls seem to serve the same function. Could the issue be that FFmpeg can only be compiled with one - not both - of them? But if that's the case I don't understand why it's just now failing to compile since I haven't changed any options.

@wiiaboo
Copy link
Member

wiiaboo commented Nov 2, 2017

Yes, you can't use schannel, openssl, or gnutls with each other. They're all implementations of TLS.
The script used to auto disable schannel if openssl or gnutls are enabled and if non-free or LGPL it would disable gnutls since openssl is usually preferred.
I don't know what changed meanwhile in FFmpeg.

@wiiaboo
Copy link
Member

wiiaboo commented Nov 2, 2017

d2fbc6d should fix it.

@wiiaboo wiiaboo closed this as completed Nov 2, 2017
@Metaphorce812
Copy link
Contributor Author

logs.zip
Thanks for the explanation. Unfortunately when I downloaded and ran the new build I got this error:

┌ ffmpeg git ........................................ [Recently updated]
├ Changing options to comply to nonfree...
├ Compiling static FFmpeg...
├ Running configure...
├ Running make...
Likely error:
Z:/Media-AB_Suite/build/ffmpeg-git/libavformat/tls_openssl.c:275:5: error: implicit declaration of function 'BIO_meth_set_create'; did you mean 'BIO_gethostbyname'? [-Werror=implicit-function-declaration]
     BIO_meth_set_create(p->url_bio_method, url_bio_create);
     ^~~~~~~~~~~~~~~~~~~
     BIO_gethostbyname
Z:/Media-AB_Suite/build/ffmpeg-git/libavformat/tls_openssl.c:276:5: error: implicit declaration of function 'BIO_meth_set_destroy'; did you mean 'ff_mutex_destroy'? [-Werror=implicit-function-declaration]
     BIO_meth_set_destroy(p->url_bio_method, url_bio_destroy);
     ^~~~~~~~~~~~~~~~~~~~
     ff_mutex_destroy
cc1.exe: some warnings being treated as errors
make: *** [/build/ffmpeg-git/ffbuild/common.mak:60: libavformat/tls_openssl.o] Error 1
make failed. Check Z:/Media-AB_Suite/build/ffmpeg-git/build-static-64bit/ab-suite.make.log
This is required for other packages, so this script will exit.

@wiiaboo
Copy link
Member

wiiaboo commented Nov 2, 2017

That's an FFmpeg issue, ask them.

@hydra3333
Copy link
Contributor

hydra3333 commented Nov 2, 2017

I wonder if it's related to ffmpeg changing some variables eg from ff_ to av_
which also stopped L-SMASH-Works from building, eg
VFR-maniac/L-SMASH-Works#75
and which requires an upstream patch to work ?
the error message seems along those lines, even telling you which variable.
it is in libavformat so it may be possible i suppose.

OTOH, I use gnutls and my build process, which I ran just now, works ok, so who knows.

edit no, discount the above rubbush after all.

@LigH-de
Copy link
Contributor

LigH-de commented Nov 2, 2017

Reported in ffmpeg trac as ticket #6801.
__

Reply from heleppkes:

Browsing around in the script, it appears to use LibreSSL, and not OpenSSL. LibreSSL is not currently supported by FFmpeg. We only support OpenSSL or any of its forks that are actually version and binary compatible. LibreSSL typically claims to be OpenSSL in a very recent version, but not actually offer its full API.

@LigH-de
Copy link
Contributor

LigH-de commented Nov 3, 2017

Surprising for me, the ffmpeg options set file "ffmpeg_options.txt" (I selected ffmpegChoice=1) contains the Zeranoe compatible option "--enable-gnutls".

ffmpeg_options.txt

@Metaphorce812
Copy link
Contributor Author

Metaphorce812 commented Nov 5, 2017

I think the default "ffmpeg_options.txt" created by MABS needs to be changed. Here's the configuration for Zeranoe's ffmpeg builds. It includes "--enable-gnutls" but not "--enable-openssl" (which makes sense because they're incompatible). So "--enable-openssl" shouldn't be included in the "# Zeranoe" section. I also recommend adding a comment that openssl and gnutls are incompatible, so only one should be enabled.

I also compared MABS' options for a Zeranoe-style build and noticed a lot of differences.
Options included in MABS but not in Zeranoe:

--enable-decklink
--enable-frei0r
--enable-gcrypt
--enable-libbs2b
--enable-libcaca
--enable-libfribidi
--enable-libgme
--enable-libgsm
--enable-libilbc
--enable-libmodplug
--enable-libopencore-amrnb
--enable-libopencore-amrwb
--enable-librtmp
--enable-libspeex
--enable-libvo-amrwbenc
--enable-libxavs
--enable-libxvid
--enable-openssl

Options included in Zeranoe but not in MABS:

--enable-bzlib
--enable-d3d11va
--enable-dxva2
--enable-gmp
--enable-iconv
--enable-libshine
--enable-libxml2
--enable-lzma
--enable-nvenc
--enable-sdl2
--enable-version3
--enable-zlib

So I'm curious what all these differences mean - especially the options included in Zeranoe's build but not in MABS', and if MABS could add more functionality to its ffmpeg build by including them.

@wiiaboo
Copy link
Member

wiiaboo commented Nov 5, 2017

Most of those are auto-enabled by default. libsnappy is in the zeranoe-like list, last I saw. libxml2 is a recent addition. gmp is used if gcrypt isn't and schannel or gnutls are enabled. libshine looks to be a fixed-point mp3 encoder, useless nowadays imo.

@Metaphorce812
Copy link
Contributor Author

Metaphorce812 commented Nov 5, 2017

Whoops, you're right about "--enable-libsnappy" being in MABS' Zeranoe-like list. "--enable-gpl" is as well (I edited my previous post to reflect that).
I'm totally confused about GPL. FFmpeg's legal page says that if you're compiling a commercial version

Compile FFmpeg without "--enable-gpl" and without "--enable-nonfree"

Since I'm assuming the vast majority of MABS users are compiling ffmpeg for personal use, they'd want the opposite of that (i.e., including "--enable-gpl" and "--enable-nonfree") so that they could include any external libraries they want. However, according to ffmpeg's wiki

The license of libfdk_aac is not compatible with GPL, so the GPL does not permit distribution of binaries containing incompatible code when GPL-licensed code is also included. Therefore this encoder have been designated as "non-free", and you cannot download a pre-built ffmpeg that supports it. This can be resolved by compiling ffmpeg yourself.

That implies to me that you wouldn't want GPL enabled since it isn't compatible with some libraries such as libfdk_aac. But then later in that wiki entry it says that compiling ffmpeg with libfdk_aac

requires ffmpeg to be configured with --enable-libfdk-aac (and additionally --enable-nonfree if you're also using --enable-gpl).

So apparently you can compile ffmpeg with libfdk_aac while GPL is enabled (even though they aren't compatible) as long as you also include "--enable-nonfree"... Clearly I don't understand the licensing details, but based on all the above information, am I correct in assuming that the best configuration for a personal build of ffmpeg that can use any library would include "--enable-gpl" and "--enable-nonfree"?

Are "--enable-d3d11va" "--enable-dxva2" and "--enable-nvenc" auto-enabled by MABS?

@ghost
Copy link

ghost commented Nov 5, 2017

Just run ffmpegs ./configure --help and check the output for [autodetect] ...

@wiiaboo
Copy link
Member

wiiaboo commented Nov 5, 2017

[everything regarding licenses]
The suite option asking about non-free, GPL, GPLv3, etc. already deals with the needed --enable options in FFmpeg, depending on whether the asked external libs need them : https://github.com/jb-alvarado/media-autobuild_suite/blob/master/build/media-suite_helper.sh#L660-L739

@Metaphorce812
Copy link
Contributor Author

@schmidthubert I can view and edit the "configure" file in "/build/ffmpeg-git" but I can't figure out how to actually run the script. However I did use PowerShell to run "ffmpeg -buildconf" and got this output

  configuration:
    --enable-avisynth
    --enable-gcrypt
    --enable-libmp3lame
    --enable-libopus
    --enable-libvorbis
    --enable-libvpx
    --enable-libx264
    --enable-libx265
    --enable-cuda
    --enable-cuvid
    --enable-decklink
    --enable-fontconfig
    --enable-frei0r
    --enable-gnutls
    --enable-libass
    --enable-libbluray
    --enable-libbs2b
    --enable-libcaca
    --enable-libfreetype
    --enable-libfribidi
    --enable-libgme
    --enable-libgsm
    --enable-libilbc
    --enable-libmfx
    --enable-libmodplug
    --enable-libopencore-amrnb
    --enable-libopencore-amrwb
    --enable-libopenjpeg
    --enable-librtmp
    --enable-libsoxr
    --enable-libspeex
    --enable-libtheora
    --enable-libtwolame
    --enable-libvidstab
    --enable-libvo-amrwbenc
    --enable-libwavpack
    --enable-libwebp
    --enable-libxavs
    --enable-libxvid
    --enable-libzimg
    --enable-libsnappy
    --enable-gpl
    --enable-opengl
    --enable-libcdio
    --enable-libfdk-aac
    --enable-libkvazaar
    --enable-librubberband
    --enable-libssh
    --enable-libtesseract
    --enable-libzvbi
    --enable-chromaprint
    --enable-libopenh264
    --enable-libopenmpt
    --enable-libzmq
    --enable-libmysofa
    --enable-libflite
    --extra-cflags=-fopenmp
    --extra-libs=-lgomp
    --extra-cflags=-DLIBTWOLAME_STATIC
    --extra-libs=-lstdc++
    --extra-cflags=-DLIBSSH_STATIC
    --extra-ldflags='-Wl,--allow-multiple-definition'
    --extra-cflags=-DCACA_STATIC
    --extra-cflags=-DMODPLUG_STATIC
    --extra-cflags=-DCHROMAPRINT_NODLL
    --extra-libs=-lstdc++
    --extra-cflags=-DZMQ_STATIC
    --extra-libs=-lpsapi
    --disable-w32threads
    --extra-cflags=-DPTW32_STATIC_LIB
    --extra-libs=-lpthread
    --extra-libs=-lwsock32
    --extra-cflags=-DKVZ_STATIC_LIB
    --enable-version3
    --enable-nonfree
    --enable-filter=frei0r
    --disable-debug

Out of the 12 options included in Zeranoe's configuration but not listed in MABS' "ffmpeg_options.txt"
(which I listed above), "--enable-version3" is the only one that's listed in this output. But there are a lot of things that are listed in this output that aren't included in "ffmpeg_options.txt" (e.g., --extra-libs, --extra-cflags, --extra ldflags, etc.), so I'm still not sure.

@Metaphorce812
Copy link
Contributor Author

@wiiaboo Got it - thanks for clearing that up.

@ghost
Copy link

ghost commented Nov 5, 2017

But there are a lot of things that are listed in this output that aren't included in "ffmpeg_options.txt"

See my reply in this question as well ... At the end you'll have to ask yourself "what do I need", "what does NOT work" etc before you blow up your binary with functions you never need ...

@ghost
Copy link

ghost commented Nov 5, 2017

but I can't figure out how to actually run the script.

You shouldn't do that, that's exactly what the suite is for ...

@ghost
Copy link

ghost commented Nov 5, 2017

And don't use Powershell to run configure. There is a mingw64.exe in msys64 folder to open a shell, for instance ... Then cd to the build/ffmpeg-git folder ...

@Metaphorce812
Copy link
Contributor Author

@schmidthubert you said

Just run ffmpegs ./configure --help and check the output for [autodetect] ...

What I meant by my response was that I didn't know how to do that, even though I know where the configure file is. I didn't use Powershell to run the configure file, I used it to run ffmpeg's buildconf option. I tried to run ./configure --help using msys2.exe before and it didn't work. After reading your reply, I used mingw64.exe and got it to work. I see a long list of options, but how am I supposed to know what components/external libraries are/aren't included in my ffmpeg build based on options that say [autodetect] in their descriptions?

@ghost
Copy link

ghost commented Nov 6, 2017

You know what IS included by running "ffmpeg -h full > help.txt" and then read the file, then you know what's included. Did you even try running ffmpeg -h (without full switch) at all and READ the output to start with?

@Metaphorce812
Copy link
Contributor Author

Metaphorce812 commented Nov 6, 2017

Yes, I did run ffmpeg -h and I did READ the output. Did you even READ my earlier posts? How do you think I got all the information I included? What I've been trying to figure out is if all the options included in Zeranoe's configuration are also in MABS' configuration, even if they're not specifically listed. I figured out by running ffmpeg -hwaccels that [in my build at least] d3d11va and dxva2 are. But I still don't know about a lot of the others like zlib for example. And it's not exactly like the full help printout is very helpful. Mine's 10,410 lines long, and searching for zlib didn't find any results. But for all I know, maybe its functions/components are in my ffmpeg build. If I knew all the ins and outs of ffmpeg and everything related to building it, I wouldn't need MABS and wouldn't be asking questions about it here.

@ghost
Copy link

ghost commented Nov 6, 2017

All these questions are irrelevant. The only relevant question is does the program work for you or not. If not go to the ffmpeg users list and ask there for help ...

wiiaboo added a commit that referenced this issue Dec 23, 2017
Sorta requested in #622
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants