HEVC/H.265 Encoder – Bitrate Optimized Edition (Early Access Release)


ngcodec-logo-color

Application Summary

NGCodec's RealityCodec is a distribution broadcast-quality transcoder for H.265/HEVC, supporting ABR and running on both on-premises Alveo cards and in FPGA instances in the cloud.

Vendor Modified Size Container Version
 Xilinx June 16, 2020 1.64 GB hevc_u200_v1.3
July 1, 2020 1.64 GB hevc_u50_v1.3

If you should have additional questions and/or want to report an issue with your user experience, please send your inquiry to alveo_video_ea@xilinx.com


Deployment Options

This application is containerized and can be easily run in a few minutes in the cloud, or on-premises.

Cloud Services
Nimbix U200
  • Xilinx Runtime: 2019.2
  • Target Platform: nx5u_xdma_201830_2
Nimbix U50
  • Xilinx Runtime: 2020.1
  • Target Platform: nx_u50_202010_a
On Premises
U50
  • Xilinx Runtime: 2020.1
  • Target Platform: xilinx_u50_gen3x4_xdma_base_2

Free Evaluation in 10 Minutes

1-start

1. Obtain Access Key

2-select

2. Setup Host (On-Premises)

3-instructions

3. Run the Application


 


Start Evaluation

Follow the instructions based on your deployment method.

Nimbix U200

1.

Obtain Evaluation Access Key

An access key "cred.json" may be obtained through the Xilinx Acceleration Application Store.


1.1 Login to the Xilinx Acceleration Application Store

  • Create and account if you do not already have one.
  • Order “Xilinx AppStore Free Eval Plan” 

1.2 Create Access Key and Download it as “cred.json” File


2.

Sign up for Nimbix Service

  • Go to Nimbix Cloud site to sign up for a free Alveo Trial: 

https://www.nimbix.net/alveotrial

  • Once the sign-up form has been submitted, you will will recieve an e-mail with instructions for setting up your Nimbix account.
  • Complete setting up your Nimbix account for the free trial.

3.

Application Execution


3.1 Select the Application on the Nimbix Platform

Sign-in to the Nimbix Platform:

https://platform.jarvice.com/?page=compute&name=HEVC%20DRM%20U200

  • Upload the cred.json you got from Accelize to Nimbix.
    • See here for instructions to upload/download files on Nimbix.

  • Click on “Desktop Mode” button in the lower left of the pop-up window for an interactive shell.
    • "Desktop Mode” is to explore HEVC using an interactive shell. 
    • Go to step 3.2.1 for the next step.

  • Click on “Single Command” button in the lower left of the pop-up window.
    • Single Command” for a quick demo & visual inspection using a sample 1080p input file.
    • Note that because each command you run this way can run on a different fpga, this may lead to drm issues. If you are going to run multiple commands back to back, we recommend using “Desktop Mode."
    • Go to step 3.2.2 for the next step.

3.2 Run the Application

You can either run a single command or launch an interactive shell where you can run many commands.


3.2.1 Run in 'Desktop Mode'

Use the following parameters and click on "Submit” button.

Machine:

  • Machine Type: nx5u_xdma_201830_2
  • Cores: 16

Click on submit & launch via vnc or ssh (note that initializing the instance can take some time) 

To connect via vnc, click on the desktop preview

To connect via ssh, ssh nimbix@[address provided] and use the password provided.

 


Open a terminal and cd drmapp/


Copy the previously generated cred.json to the current directory. You can use the below methods.


Unlock the fpga by typing ./drmapp.exe


Now open a second terminal and you can run ffmpeg commands. 
Sample scripts are located in /home/nimbix/scripts/ 

If an argument is not specified, the scripts will use /samples/in.mp4 by default.

Transfer the video back and play it. ( https://support.nimbix.net/hc/en-us/articles/208083526-How-do-I-transfer-files-to-and-from-JARVICE- )


3.2.2 Run 'Single Command'

Use the following parameters and click on "Submit” button.

Machine:

  • Machine Type: nx5u_xdma_201830_2
  • Cores: 16

Parameters:

  • Access Key: Select the "cred.json" file downloaded earlier on your computer.
  •  FFMPEG arguments:
    -y -i /samples/in.mp4 -c:v NGC265 -b:v 1000K -vf fps=60 -f rawvideo /data/out.265 

4.

Results

Once your job is complete, an “out.265” HEVC encoded sample will be available on the Nimbix FTP.  You can download it and use your video player software to display it.

You can now use your own input video file by:

  • Uploading it on Nimbix FTP
  • Replacing “-i /samples/in.mp4” with “-i /data/{YourFileName}” in the FFMPEG arguments
Nimbix U50

1.

Obtain Evaluation Access Key

An access key "cred.json" may be obtained through the Xilinx Acceleration Application Store.


1.1 Login to the Xilinx Acceleration Application Store

  • Create and account if you do not already have one.
  • Order “Xilinx AppStore Free Eval Plan” 

1.2 Create Access Key and Download it as “cred.json” File


2.

Sign up for Nimbix Service

  • Go to Nimbix Cloud site to sign up for a free Alveo Trial: 

https://www.nimbix.net/alveotrial

  • Once the sign-up form has been submitted, you will will recieve an e-mail with instructions for setting up your Nimbix account.
  • Complete setting up your Nimbix account for the free trial.

3.

Application Execution


3.1 Select the Application on the Nimbix Platform

Sign-in to the Nimbix Platform:

https://platform.jarvice.com/?page=compute&name=HEVC%20DRM%20U50

  • Upload the cred.json you got from Accelize to Nimbix.
    • See here for instructions to upload/download files on Nimbix.

  • Click on the "HEVC DRM U50" application tile. 
  • Click on “Desktop Mode” button in the lower left of the pop-up window for an interactive shell.
    • "Desktop Mode” is to explore HEVC using an interactive shell.
    • Go to step 3.2.1 for the next step.

  • Click on “Single Command” button in the lower left of the pop-up window.
    • Single Command” for a quick demo & visual inspection using a sample 1080p input file.
    • Note that because each command you run this way can run on a different fpga, this may lead to drm issues. If you are going to run multiple commands back to back, we recommend using “Desktop Mode."
    • Go to step 3.2.2 for the next step.

3.2 Run the Application

You can either run a single command or launch an interactive shell where you can run many commands.


3.2.1 Run in 'Desktop Mode'

Use the following parameters and click on "Submit” button.

Machine:

  • Machine Type: nx_u50_202010_a
  • Cores: 16

Click on submit & launch via vnc or ssh (note that initializing the instance can take some time) 

To connect via vnc, click on the desktop preview

To connect via ssh, ssh nimbix@[address provided] and use the password provided.


Open a terminal and cd drmapp/


Copy the previously generated cred.json to the current directory. You can use the below methods.


Unlock the fpga by typing ./drmapp.exe


Now open a second terminal and you can run ffmpeg commands. 
Sample scripts are located in /home/nimbix/scripts/ 

If an argument is not specified, the scripts will use /samples/in.mp4 by default.


3.2.2 Run 'Single Command'

Use the following parameters and click on "Submit” button.

Machine:

  • Machine Type: nx_u50_202010_a
  • Cores: 16

Parameters:

  • Access Key: Select the "cred.json" file downloaded earlier on your computer.
  •  FFMPEG arguments:
    -y -i /samples/in.mp4 -c:v NGC265 -b:v 1000K -vf fps=60 -f rawvideo /data/out.265

4.

Results

Once your job is complete, an “out.265” HEVC encoded sample will be available on the Nimbix FTP.  You can download it and use your video player software to display it.

You can now use your own input video file by:

  • Uploading it on Nimbix FTP
  • Replacing “-i /samples/in.mp4” with “-i /data/{YourFileName}” in the FFMPEG arguments
On Premises U50

1.

Obtain Evaluation Access Key

An access key "cred.json" may be obtained through the Xilinx Acceleration Application Store.


1.1 Login to the Xilinx Acceleration Application Store

  • Create and account if you do not already have one.
  • Order “Xilinx AppStore Free Eval Plan” 

1.2 Create Access Key and Download it as “cred.json” File


2.

Host Setup

The Xilinx Runtime (XRT) host application is supported on CentOS 7.x.  With sudo access, use the following command to download and run the setup script:

 


2.1 Clone GitHub Repository for Xilinx Base Runtime

    git clone https://github.com/Xilinx/Xilinx_Base_Runtime.git && cd Xilinx_Base_Runtime 

2.2 Run the Host Setup Script

    ./host_setup.sh -v 2020.1 -p alveo-u50 –skip-shell-flash


Note: 

  • Please wait for the installation to complete.  During this time you may need press [Y] to continue the host setup. 
  • The script for host setup can be used to setup other versions XRT and shell. Please check https://github.com/Xilinx/Xilinx_Base_Runtime for more details.

 


2.3 U50 Gen3x4 Shell Installation:

The U50 gen3x4 shell is available in Xilinx lounge at: https://www.xilinx.com/member/alveo-platform.html

Download the respective deployment target platform package, untar and install the sc, cmc and xdma base packages:

CentOS:

sudo yum remove -y xilinx-cmc-u50 xilinx-sc-fw-u50
sudo yum install ./<cmc rpm package>
sudo yum install ./<sc rpm package>
sudo yum install ./<xdma validate rpm package>
sudo yum install ./<xdma base rpm package>

sudo /opt/xilinx/xrt/bin/xbmgmt flash --update --shell xilinx_u50_gen3x4_xdma_base_2

Once the FPGA is flashed with new shell, do a cold reboot of the machine.


2.4 Install Docker (If not installed yet)

With sudo access, use the following command to run the utility script to install docker.


Go to Xilinx_Base_Runtime utilities directory

    cd Xilinx_Base_Runtime/utilities 

Run the Docker installation script

    ./docker_install.sh 


If docker is already installed, enable it:
systemctl restart docker
systemctl enable docker


2.5 Install Docker Image

Download Docker Image here.

Install

docker load --input [downloaded_docker_image.tar.gz]


3.

Application Execution

Enter the following commands in a terminal window to run the application:


3.1 Setup Environment Variables by script from Xilinx_Base_Runtime

    source Xilinx_Base_Runtime/utilities/xilinx_docker_setup.sh 


Make sure docker has write permissions in the output directory (/dev/shm by default)
chmod 777 /dev/shm/


3.2 Run the Docker Image

You can either run a single command or launch an interactive shell where you can run many commands.


3.2.1 Single command

    docker run -v /tmp/cred.json:/cred.json -v /dev/shm:/data $XILINX_DOCKER_DEVICES xilinxatg/dcg_video_nimbix:HEVC_U50_Centos7 /cred.json "-y -i /samples/in.mp4 -c:v NGC265 -vf fps=60 -b:v 5M -f rawvideo /data/1080p60_5mbs.265"

Description of command arguments:

  • -v /tmp/cred.json:/cred.json  - Map local cred.json dir : container dir
  • -v /dev/shm:/data -  Map the local dir : container dir for the generated output file
  • $XILINX_DOCKER_DEVICES  - Environment variable set by the host setup script 
  • /cred.json - Letting the runtime script know where to find the cred.json
  • -y -i /samples/in.mp4 -c:v NGC265 -vf fps=60 -b:v 5M -f rawvideo /data/1080p60_5mbs.265 - ffmpeg commandline arguments
  • "0" – Optional argument specifying which device id to unlock. "0 1" to unlock devices 0 and 1.

3.2.2 Interactive shell

    docker run -u alveo -v /tmp/cred.json:/cred.json -v /dev/shm:/data $XILINX_DOCKER_DEVICES --entrypoint bash -it xilinxatg/dcg_video_nimbix:HEVC_U50_Centos7

Description of command arguments:

  • -v /tmp/cred.json:/cred.json  - Map local cred.json dir : container dir
  • -v /dev/shm:/data -  Map the local dir : container dir for the generated output file
  • $XILINX_DOCKER_DEVICES  - Environment variable set by the host setup script 
  • /cred.json - Letting the runtime script know where to find the cred.json
  • --entrypoint bash -it  - Launch into a bash session and make it interactive

Unlock the fpga 

cd drmapp/

cp /cred.json .

./drmapp.exe &

This unlocks device 0 on the fpga. To unlock multiple, do ./drmapp.exe 0 1 &

cd ~/scripts/  

Run ffmpeg. You can use the sample scripts as an example. A sample input mp4 file can be found in /samples 

./1080p60_5mbs.cmd

Stop the DRM 

kill %1 

 


4.

Results

Once your job is complete, the output file(s) will be stored in /dev/shm/