Thursday, April 14, 2022

[SOLVED] Getting avconv working with x265 on Linux Mint 17.1

Issue

I compiled and installed the x265 codec from multicoreware as suggested here: rel="nofollow">https://bitbucket.org/multicoreware/x265/wiki/Home and then manually installed libav with libx265 enabled as suggested here: https://wiki.libav.org/Encoding/hevc

Now, when I am trying to convert a x265 file to some other format using avconv (a tool that comes with libav) it is showing this error:

avconv: error while loading shared libraries: libx265.so.50: cannot open shared object file: No such file or directory

When I try to do whereis libx265.so.50, it gives me this:

libx265.so: /usr/local/lib/libx265.so /usr/local/lib/libx265.so.50

So, libx265 is indeed there but why isn't avconv/libav detecting it?

UPDATES:

  • Alternatively, you can simply answer how to get x265 working with avconv.
  • My system specs are: Linux Mint 17.1, based on Ubuntu 14.04

Solution

Okay. This works fine now. I was trying to convert an x265 video to an x264 video but there were a few things I was doing wrongly.

First, when I compiled my avconv manually, I only enabled the x265 codec and not the x264. Then, I was following wrong syntax for conversion in avconv. I will explain both here.

Let me tell it in plain steps:

  1. First, of all. Install x265 as explained here: https://bitbucket.org/multicoreware/x265/wiki/Home.
  2. Install missing x264 packages if they aren't installed:

    sudo apt-get install libx264-dev x264
    
  3. Then, manually compile avconv by downloading it from their website: https://www.libav.org/download.html. While compiling it, do it this way (this is the key):

    ./configure --enable-libx264 --enable-libx265 --enable-gpl

    make; sudo make install;

  4. Now the conversions can be done without fail:

    avconv -i Some.Movie.x265.mkv -c:v libx264 -c:a copy out.mkv
    

PS: That error error while loading shared libraries was perhaps due to some mistake I did previously while compiling avconv or maybe due to wrong avconv syntax. I don't exactly know what fixed it. But the point is, it should now work just fine if one follows the above steps carefully.



Answered By - shivams
Answer Checked By - Cary Denson (WPSolving Admin)