x265 not found using pkg-config

Issue #125 resolved
Former user created an issue

getting "x265 not found using pkg-config" error when enable libx265 with ffmpeg.

i have successfully compile libx265 in ffmpeg , but getting this error .

kindly help me please

Comments (37)

  1. Former user Account Deleted

    can you suggest me what should i do now ? where to check pkg-config ? ffmpeg is fully updated and othere compile are working fine, but i am unable to enable this

  2. Werner Robitza

    The issue is that in order for x265 to work with ffmpeg, it needs to be statically compiled, similar to the other libraries mentioned in the compilation guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

    It's definitely not a "bug" with x265—certainly it can be compiled any way you want—but a lack of documentation on FFmpeg's side on how to integrate it. Or a lack of documentation on x265 side.

    It's not entirely clear what specific steps need to be done to compile x265 so that it can be statically linked to ffmpeg.

  3. Werner Robitza

    You may want to change this issue and

    • set its priority to "normal"; it's certainly not critical
    • ask how to statically compile x265 to link it with ffmpeg

    This is as far as I got:

    cd ~/ffmpeg_sources
    hg clone https://bitbucket.org/multicoreware/x265
    cd x265
    cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME/ffmpeg_build source
    make
    make install
    

    But it does not create a static build.

  4. Former user Account Deleted

    @Cigaes : yes this is same my problem , but still didn't find how to fix this any help ?

  5. Former user Account Deleted

    @Werner Robitza : thank you for suggestion , but its not normal issue , i am trying to solve this from sunday but no luck yet so this is begin critical for me , and is there any guide about "how to statically compile x265" with ffmpeg ?

  6. Former user Account Deleted

    Learn how to administrate a Unix system and try again in two years. Sorry if this is harsh, but you have to understand that building software from source is inherently a complex task, you can not expect to get it working in a few minutes. Sometimes, you are lucky and someone already did exactly what you need, with step-by-step explanations. When you are not, you have to make efforts of your own. Or... I am sure you can find plenty of people that will make the effort for you... for a fee.

  7. Former user Account Deleted

    hahaha ,, you are blogging on a free codec forum and asking for a fee ? lol grow up man better open another blog where you ask to user for a fee to help them ,, SORRY IF THIS WAS HARSH FOR YOU yes that was :D

  8. Former user Account Deleted

    and yes if you known to fix it do it for me ,, i will pay you $100 for this or $200 will be better ,, think you are smart ?

  9. Former user Account Deleted

    I am not asking for a fee. I do not volonteer to do the work for you, be it for free or not. I am writing on this issue tracker to tell the x265 guys what kind of “issue” it is and that they can close it without remorse. Then I was sidetracked by trolling, but I will stop now. But you, you need to learn how Free Software works. It does not involve Free Software developers being at the beck and call of any user that does not want to make any effort learning. Free Software is an exchange: the developers provide the software at no financial cost in the hope that users will contribute useful patches, or at least smart bug reports. Users that do not want to play that game can hire a consultant.

  10. Former user Account Deleted

    This is a bug ! and i am reporting about this , if not i will be only guy to report about this but yes it is a bug with both ffmpeg and x265 because "[http://ffmpeg.org/pipermail/ffmpeg-user/2015-April/026026.html" guy also got this problem ,

    and if you want effort , i will come back with solution for this ,, and if you don't know how to help user on any topic just shut your mouth and watch this.

  11. djcj

    My ffmpeg builds on Launchpad are all linked against the libx265 shared library. And I didn't patch the x265 or ffmpeg sources. You can try to override the PKG_CONFIG_PATH environment variable (see man pkg-config for details) or you can try to hack ffmpeg's configure script.

  12. Lu Xinyue
    1. Reported by someone else != it's a bug. It could mean that there's another guy who has no idea how to compile this correctly.
    2. After you compile x265 and install it (cmake -DCMAKE_INSTALL_PREFIX=somewhere_to_install ../../source and make and make install), make sure there's a libx265.a file inside the directory, and a libx265.so file not be there. This forces ffmpeg to link to the static version.

    You can have a try and report back whether it works or not. We can then sort out what's going wrong.

  13. Steve Borho

    you would probably get more useful help at #ffmpeg on IRC, from people accustomed to building ffmpeg from source.

    So far I've seen zero indication x265 is doing anything wrong. On Linux, the libx265 static library is always compiled and installed. This problem is between you, pkg-config, and ffmpeg. pkg-config most likely needs x265 installed in the standard install locations in order to find it.

  14. Former user Account Deleted

    @Steve Borho i am working on this , would update if any luck

    there is a file already libx265.a in ffmpeg_build/lib and a file x265.pc under pkgconfig

  15. Former user Account Deleted

    @Steve Borho : i followed these steps :

    #hg clone https://bitbucket.org/multicoreware/x265
    #cd x265/build/linux
    #./make-Makefiles.bash
    i set --prefix="/root/ffmpeg_build and shared OFF
    #make
    #make install
    

    all above task done by super user on server in /root/ffmpeg_sources/ffmpeg directory

    there after i run this command to enable this : PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265

    and error : x265 not found using pkg-config

    may you tell am i wrong ?

  16. Werner Robitza

    If you can show a file listing and the output of the ffmpeg configure.log, then please ask that on the FFmpeg mailing list.

    As others have stated, this is not a bug with x265.

  17. Werner Robitza

    Try this:

    cd ~/ffmpeg_sources
    hg clone https://bitbucket.org/multicoreware/x265
    cd ~/ffmpeg_sources/x265/build/linux
    PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
    make
    make install
    

    Then, for ffmpeg itself (assuming you have all the other libs installed according to the guide):

    cd ~/ffmpeg_sources/ffmpeg
    PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
      --prefix="$HOME/ffmpeg_build" \
      --extra-cflags="-I$HOME/ffmpeg_build/include" \
      --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
      --bindir="$HOME/bin" \
      --pkg-config-flags="--static" \
      --enable-gpl \
      --enable-libass \
      --enable-libfdk-aac \
      --enable-libfreetype \
      --enable-libmp3lame \
      --enable-libopus \
      --enable-libtheora \
      --enable-libvorbis \
      --enable-libvpx \
      --enable-libx264 \
      --enable-libx265 \
      --enable-nonfree
    

    Then

    PATH="$HOME/bin:$PATH" make
    make install
    

    Worked for me on Linux Mint 17. Say thank you to Lou from FFmpeg for figuring this out.

    The -DENABLE_SHARED:bool=off part in particular is something that may be useful to mention on the x265 wiki.

  18. Werner Robitza

    Can you please elaborate?

    All other libs are built statically in the ffmpeg guide; I don't see why x265 would necessarily have to be a shared library, or why that'd be more helpful in the long run. (In fact, having a static build makes it much more portable… at least for my use cases.)

  19. Former user Account Deleted

    @Werner Robitza : thank You mate !! its work like a charm , thank you for your effort also thank to Lou from FFmpeg you are the real guy who change the world

    @Cigaes : don't make this complicated keep this simple ,all are not smart as you LOL

  20. Thomas Ahn

    I got a same issue to configure ffmpeg on Ubuntu 14.04 w/gcc4.9, but my case was not resolved with any suggested solution. After one day's try-and-error, I found a hint from config.log said: /home/thomas/ffmpeg_build/include/x265.h:103:5: error: unknown type name 'bool' bool bScenecut; So the culprit is 'bool', hahaha... To resolve above error, I just add following heder file at x265_config.h: #include <stdbool.h>

    And configure again, it works!! hope this help anybody facing the same problem.

  21. Former user Account Deleted

    Thomas Ahn: No, it is not the same issue.

    The problem with bool is a new one, introduced less than a week ago in x265.h by using the bool type without the corresponding error. It has nothing to do with the initial reported problem except it ends up with the same error message from FFmpeg's configure.

  22. Andreas Langberg

    Reporting same issue for me in Mint 17.2. Including <stdbool.h> in the header solved the problem.

    Love the incredibly rudeness of some member btw. Experience doesn't matter when asking for help. If you never get going with Linux because people refuse to help due to "lol inexperienced noob", then you'll just end up with fewer people using it enough to get good at it to begin with.

  23. Werner Robitza

    @nandaku2 This has nothing to do with the original issue. People just reported it here because the final error message was the same.

  24. Deepthi Nandakumar

    I know :), the original issue was fixed long ago.

    Usually, we insist on separate issue threads, but well - just not in the mood to do so now.

  25. Elwen

    @slhck Weiner Robtza thanks a lot for the solution! it works like a charm!

    But I didn't expect that I saw some incredibly marvelous comments here btw, new experience LOL

  26. Jordan Graham

    In my case, ffmpeg's 'configure' script was looking for x265.pc in a different directory from the one in which x265 put it.

    You could:

    • cd /

    • find . -name "x265.pc"

    • cp [path]/x265.pc [PKG_CONFIG_PATH that you're using in your ffmpeg 'configure' command]

  27. Pradeep Ramachandran Account Deactivated

    Or just export PKG_CONFIG_PATH=/path/with/x265.pc/:$PKG_CONFIG_PATH and then configure ffmpeg. Works for me every time.

  28. Log in to comment