Step 1: Patching Linux Kernel

1.1) $git clone https://github.com/yongfengdu/transcoder-daemon

1.2) $cd transcoder-daemon/kernel

1.3) $./install-kernel.sh kontron

1.4) After kernel 4.4.0-mss is installed, please reboot manually

1.5) Verify Intel graphic device
&lspci
00:02.0 Display controller: Intel Corporation Device 193a (rev 09)

1.6) Check /dev/dri is populated (e.g. renderD128)
$ls /dev/dri/
card0  card1  controlD64  controlD65  renderD128

1.7) Check i915 driver
$lsmod | grep i915
i915                 1273856  1
drm_kms_helper        135168  2 ast,i915
drm                   356352  7 ast,ttm,i915,drm_kms_helper
i2c_algo_bit           16384  3 ast,igb,i915
video                  40960  1 i915

Step 2: Build docker container with Intel Media SDK
p/s: Step 2 can be skipped because the k8s installation in the later step will pull an exising pre-built image from Docker Hub.

2.1) $cd transcoder-daemon/docker

2.2) Build the docker image with the Dockerfile
$sudo docker build -t transcoder-daemon:latest .

Step 3: Install Kubernetes for the transcoder application

3.1) $cd transcoder-daemon/k8s

3.2) Run k8s 
$./runk8s.sh
p/s: This step includes ./install-k8s.sh implicitly.

Step 4: Execute transcoding task

4.1) Copy the media file to /opt/media/$type directory to transcode
$type can be h265, h264, mpeg2, mvc, jpeg, raw.

This container will create several destination dir, like "h264", "mpeg2", 
under /opt/media dir. 

For example, to transcode a media file to mpeg2 format, cp the file
to /opt/media/mpeg2 directory. The transcoder daemon will monitor the
directory for new file and then automatically trigger the transcoding
process and save the transcoded mpeg2 file in the same directory.