Performance Evaluation of HEVC video transmission over mininet

 

[Goal]

        In this lab, I will show how to use ffmpeg to encode the video in H.265 format and transmit the encoded video stream over mininet environment.

 

[Preparation]

1.      If you use Ubuntu, please refer to https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu to install ffmpeg.

2.      If you use CentOS, please refer to https://trac.ffmpeg.org/wiki/CompilationGuide/Centos to install ffmpeg.

3.      After installation, if you can not find ffplay. You have to install SDL and SDL2. (https://www.libsdl.org/download-1.2.php, https://www.libsdl.org/download-2.0.php). After installing SDL and SDL2, run the  configure and make again for ffmpeg.

4.      Install HM h.265 reference software.

Step 1: svn checkout https://hevc.hhi.fraunhofer.de/svn/svn_HEVCSoftware/trunk/

       Step 2: build the software.

5.      Please refer to https://gpac.wp.mines-telecom.fr/2015/07/29/gpac-build-mp4box-only-all-platforms/  to install GPAC

 

[Encoding]

You can go to https://media.xiph.org/video/derf/. There are some video sequences in the uncompressed YUV4MPEG format.

 

Encode the video. (Here I use foreman_cif.yuv as an example)

TAppEncoderStatic: Encoder

-i : indicate the input file

-wdt: width

-hgt: height

-fr: frame rate

-f: the total number of video frames

-c: refers to the coding file to bbe used

-b: indicate the output file name

(After encoding, you will see similar result as the following figure.)

 

Compare the file size of original video and encoded video. You can see amazing compression rate.

 

Use ffplay to display the encoded video.

 

[Decoding]

Use the following command to decompress the encoded video.

 

Obtain the PSNR by comparing the original video and decompress video.

 

Average PSNR: 34.4661

 

[Preprocessing]

Before transmitting the video over mininet, we have to encapsulate the HEVC bitstream in a MP4 file. Then transfer to MPEG2 Transport Stream (mpeg2ts). After that we can use ffmpeg to do video streaming.

 

Encapsulate the HEVC bitstream in a MP4 file.

 

To MPEG2TS format.

………………………………………………………………………………………………………………………………………………………

 

Then we have output.ts. Now we can transmit the video stream over mininet.

 

[mininet]

#!/usr/bin/python

 

"""

Script created by VND - Visual Network Description (SDN version)

"""

from mininet.net import Mininet

from mininet.node import Controller, RemoteController, OVSKernelSwitch, IVSSwitch, UserSwitch

from mininet.link import Link, TCLink

from mininet.cli import CLI

from mininet.log import setLogLevel

 

def topology():

 

    "Create a network."

    net = Mininet( controller=Controller, link=TCLink, switch=OVSKernelSwitch )

 

    print "*** Creating nodes"

    h1 = net.addHost( 'h1', mac='00:00:00:00:00:01', ip='10.0.0.1/8' )

    h2 = net.addHost( 'h2', mac='00:00:00:00:00:02', ip='10.0.0.2/8' )

    s3 = net.addSwitch( 's3', listenPort=6673, mac='00:00:00:00:00:03' )

    c6 = net.addController( 'c6' )

 

    print "*** Creating links"

    net.addLink(s3, h2)

    net.addLink(h1, s3, loss=1)

 

    print "*** Starting network"

    net.build()

    c6.start()

    s3.start( [c6] )

 

    print "*** Running CLI"

    CLI( net )

 

    print "*** Stopping network"

    net.stop()

 

if __name__ == '__main__':

    setLogLevel( 'info' )

    topology()

 

[Execution]

 

H2(receiver)

 

H1(sender)

 

After transmitting. (use ctrl+c to terminal the receiving process)

 

Compare the file size. We can find the received file size is smaller than original output.ts (Some packets are lost during transmission)

 

Decompress the received file.

 

Get the PSNR.  We can see that the average PSNR is 30.99 ( 30.99 vs. 34.466).

 

Dr. Chih-Heng Ke (smallko@gmail.com)

Department of Computer Science and Information Engineering,

National Quemoy University, Kinmen, Taiwan.