The AMD-Xilinx Video SDK [1] is a complete software stack solution enabling video streaming developer to seamlessly leverage the hardware accelerated features of the Video Codec Units (VCU) on Alveo U30 card [2, 3, 4]. In reference [5] the Alveo U30 video transcoding card installation, operating functionalities and custom video streaming pipeline configuration were discussed. This tutorial describes the video codec quality measurements. The Alveo U30 offers a high video quality transcoding compared to other solutions in the market, but at lower bit rate, thus Alveo U30 video acceleration card offers operating cost saving.
Video QualityThe Video encoder quality can be determined quantitively by several methods:
· Peak Signal to Noise Ratio (PSNR)· Structural Similarity Index Metric (SSIM)· Video Multimethod Assessment Fusion (VMAF)The VMAF is an objective full-reference video quality metric measurement algorithm developed by Netflix [6]. The metric can be used to evaluate the quality of different video codecs. The VMAF video quality measurement is widely used in the industry.
For video quality assessment, it is highly recommended to perform encoding on a raw video clip, clips that have not undergone transformation of compression and encoding before. This ensoures that the clips are in a known state to compare encoders farly. Alternatively video clip can be decoded before encoding it, the result will remain accurate as long as the same pre-encoded file is used accross all encoders under test.
The VMAF crowd run graph highlights the video quality of U30 solution compared to alternative solutions in the market. The bit rate distortion curves show objective video quality measure VMAF across a range of data rates. The video quality of Alveo U30 is shown in a red line, and it is very closely correlated to H.264 (HVCE) deployment on multi core x86 server. For the same video quality level U30 performs better than the competitor solutions. The U30 offers higher video quality at lower bit rate, offering operating cost saving. The VMAF video quality measurement was done on a single clip of crowed run, which is very complex clip used by many in the industry.
Objective Quality MeasurementAMD-Xilinx provided objective quality script for calculate maximum objective scoring (PSNR, SSIM, VMAF). It accepts a clip that is already decoded or a RAW YUV file.
Due to licensing reasons, the FFmpeg binary delivered in Video SDK package does not include plugins required for measuring video quality. The video quality measurement functionalities are available in the general FFmpeg release. For this version of AMD-Xilinx video SDK (1.5), ffmpeg-4.4 version “ffmpeg-4.4-amd64-static.tar.xz” [7], is downloaded and installed under tool/ffmpeg folder as shown below.
The Codec video quality measurement is performed in the following steps:
1. First copy the input big bunny video file “ bbb_1080p_30fps_normal.mp4” [8] into /dev/shm/ folder (RAM for faster read and write operations).
2. Source the setup script each time you open a new terminal on your system. This is required for the environment to be correctly configured. The script detects one Alveo U30 card and loads the video SDK software stack been into Zynq MPSoC devices.
3. For measuring codec video quality, ideally raw YUV file should be used, but for the purpose of this test, raw YUV file is generated by using “ffmpeg_decode_only” script, to decode the input “big bunny” video file as per the following script. Where the generated raw output YUV file is “xil_dec_out.yuv”.
avnet@u30server:~/alveo_u30/video-sdk/examples/ffmpeg/tutorials$ ./o1_ffmpeg_decode_only.sh /dev/shm/bbb_1080p_30fps_normal.mp4
4. Next using “h264_objective.sh” script, which takes raw “xil_dec_out.yuv” YUV video input file and performs h.264 encoding. The script also sets a number of flags [1] to optimize the generated h.264 encoded file for measuring the h.264 encoder video quality ( at next step) at a bit rate of 3500 kbps.
avnet@u30server:~/alveo_u30/video-sdk/examples/ffmpeg/quality_analysis$ ./h264_objective.sh ~/tmp/xil_dec_out.yuv 3500
The script generates h.264 encoded output video file. ‘xil_dec_out.yuv_3500_objective.264'
5. The video quality VMAF score is measured using “measure_vq.sh” script. The video quality measurement is performed on the h.264 encoded video file (xil_dec_out.yuv_3500_objective.264) at 3500 kbps and 1920x1080 resolution as per step 4, in comparison with the raw YUV video input file (xil_dec_out.yuv). The video quality VMAF measurement is performed by the installed FFmpeg in “/tools/ffmpeg” folder as per script command parameters.
avnet@u30server:~/alveo_u30/video-sdk/examples/ffmpeg/quality_analysis$./measure_vq.sh ~/tmp/xil_dec_out.yuv_3500_objective.264 1920x1080 30 ~/tmp/xil_dec_out.yuv ~/tools/ffmpeg
The VMAF score for the h.264 encoder in this test is “94.545597”. This high VMAF score indicates the quality of h.264 encoder. The VMAF score in this test is higher score compared to the h.265 encoder VMAF score of approximately 53 (as shown in the above graph) for crowd run clip. In this test, “big bunny” video clip was used, which is much simpler video file compared to the crowed run video clip, and also not real raw YUV input file was used in this experiment.
References:
[1]: https://xilinx.github.io/video-sdk/v1.5/index.html
[2]: https://www.xilinx.com/products/boards-and-kits/alveo/u30.html
[3]: https://www.xilinx.com/content/dam/xilinx/support/documents/data_sheets/ds970-u30.pdf
[4]: https://www.xilinx.com/content/dam/xilinx/publications/solution-briefs/u30-sdk-solution-brief.pdf
[5]: https://www.hackster.io/bhashimi/introduction-to-alveo-u30-video-transcoding-000ea1
[6]: https://en.wikipedia.org/wiki/Video_Multimethod_Assessment_Fusion
[7]: https://www.johnvansickle.com/ffmpeg/old-releases/
[8]: https://test-videos.co.uk/bigbuckbunny/mp4-h264
RevisionHistory
11/05/2022 - initial version
Acknowledgments
Thanks to Sergei Storogev from AMD-Xilinx for his in depth knowledge and help.
Comments
Please log in or sign up to comment.