Building libx264 on the NoMachine server host (v. 4)

Added on: 2013-10-01 Last Modified: 2015-09-25
ID: AR10K00695 Applies To: NoMachine Software

In order to enable H.264 codec in NoMachine it's necessary that you have a H.264 encoder on the server and a H.264 decoder on the client. On the client, follow the instructions here: https://www.nomachine.com/AR10K00696.

On the server, you will need to build and install the libx264 libraries which contain our optimizations and necessary modifications. This version includes changes for retrieving information about the quantizer used to encode frames. Such changes take advantage of all the encoding functionalities at their best and improve perfomance.

Download the libraries here:

https://www.nomachine.com/opensource

 

At present, the H.264 codec cannot be used for virtual desktop sessions in running in lightweight mode.

Prerequisites

- Ensure that you have an assembler installed like Yasm.

- To keep the best performances, we suggest to avoid compiling x264 with --disable-asm options.

- If you are compiling on Windows, be sure that your Cygwin environment matches these requirements:

1. Use Cygwin 32-bit (suggested version, tested with the procedure provided by this article is 1.7.25).

2. Install under the Cygwin compilation environment: gcc, mingw32, make and pkg-config (you just need to select such packages  in the Cygwin Setup and install them).


STEP 1

Download the latest libx264 from the Nomachine Web site: https://www.nomachine.com/opensource



STEP 2

Extract the archive.



STEP 3

Move to the x264 directory, run './configure' with options  listed below and  'make':

     * --disable-cli
     * --enable-shared
     * --disable-avs
     * --disable-swscale
     * --disable-lavf
     * --disable-ffms
     * --disable-gpac
     * --cross-prefix=i686-pc-mingw32- (for Windows only)
     * --enable-win32thread            (for Windows only)

     Linux:
     * --libdir=NX_INSTALLATION_DIR/lib

     Windows:
     * --libdir=NX_INSTALLATION_DIR/bin

     Mac:
     * --libdir=NX_INSTALLATION_DIR/Contents/Frameworks/lib

The --libdir option specifies where the x264 library will be installed. NX_INSTALLATION_DIR is path to the NoMachine installation directory, e.g. on Linux it's by default /usr/NX.


For example, to compile on Linux:


    ~: ./configure --disable-cli --enable-shared --disable-avs --disable-swscale --disable-lavf --disable-ffms --disable-gpac --libdir=/usr/NX/lib

    ~: make



STEP 4

When build completed successfully, install the x264 libraries by running 'make install'. This requires administrator privileges.

For example:

    ~: sudo make install


STEP 5

Verify that the x264 shared library has been copied into the installation directory provided with the --libdir configure option. Verify also that the library name is the same as below.

You should have the following:

On  Linux

NX_INSTALLATION_DIR/lib/libx264.so

On Windows

NX_INSTALLATION_DIR/bin/libx264.dll

On  Mac OS X

NX_INSTALLATION_DIR/Contents/Frameworks/lib/libx264.dylib


Finally, ensure that ownership and permissions of libx264 are the same as for the other libraries used by NoMachine.