Javernaut / ffmpeg-android-maker

Contains a script that assembles FFmpeg library for Android
MIT License
586 stars 173 forks source link

Fix pkgconfig path #84

Closed VioletXF closed 8 months ago

VioletXF commented 8 months ago

Ensures the pkg-config path is set to the correct directory. This will fix errors like ERROR: x264 not found using pkg-config in some environments.

Javernaut commented 8 months ago

@VioletXF

Thanks for the PR, but let me understand why do you consider this a fix.

To my experience the errors like "ERROR: x264 not found using pkg-config" (or any other library-dependency) frequently mean not exactly what they state. The FFmpeg's configure script performs a set of predefined tests including compilation and linking of test programs to examine if a library is properly accessible before the FFmpeg's own compilation/linking. If any test fail, the error message will be the same - just as you posted it about libx264.

The actual reason of a failure can be found in config.log file, which resides in ffmpeg-android-maker/sources/ffmpeg/ffmpeg-6.1.1/ffbuild/config.log. The version of FFmpeg may be different, of course. I would ask you to look at this file without the fix you did and see what the problem is there. Usually it is at the very end of the file. Additionally you can post the file here so I can have a look as well.

VioletXF commented 8 months ago

The real error was ld: error: unable to find library -lpthread. Fun fact is that if I set PKG_CONFIG_PATH to arbitrary value(even "/"), the issue is fixed and ffmpeg compiles with no problems. But strangely, after restarting my terminal, I can't reproduce it anymore. Maybe some of my environments were messed up for some reason.