Sunday 21 April 2013

EvalVid on NS-3 on Ubuntu 12.04

Using EvalVid on ns-3 is pretty much the same as running it on ns-2 but no tcl script is required fo create the network topology, its all in the .cc code.

Download the EvalVid Module from GERCOM here.
Author: Billy Pinheiro <haquiticos@gmail.com>

Now the steps are quite similar to my previous post till the trace file is generated.

1. First we need to download a yuv sequence which has to be converted to a m4v file. This can be done using  'ffmpeg' It will create a compressed raw video. For example download highway_cif.yuv which is available online.
 
$ffmpeg -i highway_cif.yuv highway_cif.m4v
 
2. Next we need to get the .mp4 file. Following command lines create ISO MP4 files containing the video samples (frames) and a hint track which describes how to packetize the frames for the transport with RTP.
 
$./MP4Box -hint -mtu 1024 -fps 30 -add highway_cif.m4v highway_cif.mp4
 
3. Now that we have the mp4 file, we need to generate the trace file required to sent into the network. The mp4trace tool from EvalVid is able to send a hinted mp4-file per RTP/UDP to a specified destination host. The output of mp4trace will be needed later, so it should be redirected to a file. The trace file thus generated is st_a01.st
 
$./mp4trace -f -s 192.168.0.2 12346 highway_cif.mp4 > st_highway_cif.st
 
4. Unpack the evalvid.zip file inside the folder  ns-3.13/src/

5. Move the highway_cif.mp4 and st_highway_cif.st files to ns-3.13/

6. ./waf configure --enable-examples

7. execute ./waf build

8. execute ./waf --run "evalvid-client-server"

9. The two files sd_a01 and rd_a01 are generated. The next step is the reconstruction of the transmitted video as it is seen by the receiver. For this, the video and trace files are processed by etmp4 (Evaluate Traces of MP4-file transmission): 
 
$./etmp4 -f -0 sd_a01 rd_a01 st_highway_cif.st highway_cif.mp4 highway_out

This generates a possibly corrupt vido file in which the lost frames are deleted.
 
10. decode into the .yuv format and then calculate the psnr
 
$ffmpeg -i highway_out.mp4 highway_out.yuv
$./psnr 352 288 420 highway_cif.yuv highway_out.yuv
 
Done!
 
References :
 
Research in field done by:
Mr. Abhishek Thakur and team,
Department of CS & IS
BITS-Pilani, Hyderabad Campus,
India. 
 

No comments:

Post a Comment