libx264 for ndi2srt on Windows
==============================

What this is
------------
libx264-165.dll — the H.264 encoder ndi2srt loads at run time when it is asked
for software H.264, and the only software route to **interlaced (1080i)**
encoding on a machine with no NVIDIA card. ndi2srt ships nothing of x264 inside
itself; it looks for this library beside the executable, and runs without it
(progressive H.264 through the built-in OpenH264, and HEVC through NVENC).

Install
-------
1. Copy libx264-165.dll into the folder that holds ndi2srt.exe.
   The MSI installs to:  C:\Program Files\ndi2srt\
   A zip install is wherever you unpacked it.
2. Restart the ndi2srt service (Services, or: net stop ndi2srt && net start ndi2srt).

Check it took
-------------
    ndi2srt.exe --selftest

Look for:

    selftest: software interlaced H.264 - x264 build 165 (software interlaced, MBAFF TFF, runtime library)
    selftest:   bitstream says: interlaced - MBAFF frame pictures - 1920x1080, 0 field / 10 frame pictures

If it is not found you get a line naming every filename that was tried, which is
the usual way a wrong folder shows up.

Then, in the console, set the channel's video encoder to `x264` (or leave it on
`auto` and set scan to `interlaced`, which picks x264 automatically when there is
no NVENC).

What you get, and what you do not
---------------------------------
x264's interlaced mode is **MBAFF**: the sequence allows fields and macroblock
pairs are coded as fields, but each picture is still a frame picture. NVENC on a
Pascal-or-older NVIDIA card instead codes each field as its own picture (PAFF),
which is what broadcast contribution usually means by 1080i. Both are legal
interlaced H.264 and both sit inside the profiles an IRD claims when it says Main
or High. `GET /api/encoder/bitstream` on a running encoder says which one is
actually on the wire.

Software **HEVC** is a separate matter: libx265 needs the MinGW C++ runtime
beside it (libstdc++-6.dll and friends), so it is not in this zip. Ask and it
will be, or install MSYS2 and take them from there.

Licence and source
------------------
x264 is free software under the GNU General Public License version 2 or later —
the full text is in COPYING-GPLv2.txt. This DLL is an unmodified build of
upstream x264, taken from the MSYS2 package
`mingw-w64-x86_64-libx264-0.165.r3222.b35605a-3`, which builds x264 revision
r3222 (git b35605a) with no patches of ours.

  binary package:  https://repo.msys2.org/mingw/mingw64/
  upstream source: https://code.videolan.org/videolan/x264 (revision b35605a)
  build recipe:    https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-x264

The corresponding source is available at the addresses above, and Cloudcast
Systems will provide it on request for as long as this file is distributed.

x264 is licensed by VideoLAN under the GPL; a commercial licence is available
from them separately. Putting this DLL beside ndi2srt.exe is your choice to make:
ndi2srt loads it only if it is there.

  md5  fee97f3d953fe08ab2fb711f4a58bfd4  libx264-165.dll
  size 2,024,174 bytes
