Академический Документы
Профессиональный Документы
Культура Документы
(In Ubuntu).
Ill try to keep this documentation as simple as possible to be understood easily by novice.
I hope you understand the commands that are about to be used. If you dont understand,
dont worry; it doesnt matter. At any point of time if you get stuck, just Google it!
apt-get update
apt-get dist-upgrade
apt-get update
Now that if your NS2 installation didnt get any error, lets move ahead to set up
the environment variables. Enter gedit ~/.bashrc and edit the file by adding the
following lines at the end of file.
# LD_LIBRARY_PATH
OTCL_LIB=/ns-allinone-2.35/otcl-1.14/
NS2_LIB=/ns-allinone-2.35/lib/
USR_Local_LIB=/usr/local/lib/
export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$USR_Local
_LIB
# TCL_LIBRARY
TCL_LIB=/ns-allinone-2.35/tcl8.5.10/library/
USR_LIB=/usr/lib/
export TCL_LIBRARY=$TCL_LIBRARY:$TCL_LIB:$USR_LIB
# PATH
XGRAPH /ns-allinone-2.35/xgraph-12.2/:/ns-allinone-2.35/bin/:/ns-allinone2.35/tcl8.5.10/unix/:/ns-allinone-2.35/tk8.5.10/unix/
NS=/ns-allinone-2.35/ns-2.35/
NAM=/ns-allinone-2.35/nam-1.15/
export PATH=$PATH:$XGRAPH:$NS:$NAM
add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
apt-get update
apt-get install ffmpeg
apt-get install libssl0.9.8
(This would be installed automatically or would be available in different version).
apt-get update
apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
Now you can run ./psnr in evalvid folder which will show
command format if support libraries are successfully
installed. If youre getting No such file or directory error,
then your system is 64-bit and you need to verify that
youve followed above steps properly.
Congrats on getting Evalvid and NS2 to work successfully! Lets now
integrate them to work together!
Now lets start editing the files. Please follow the below steps:
Find double ts_arr_; and add the following lines after that line.
//add the following three lines
Find inline packet_t function and add the following lines after that line.
// add the following two lines
Find int defttl_; and add the following line after that line.
o Find ch->error() = 0; and add the following line after that line.
// add the following line
ch->frametype_= frametype_;
Download the support files here. Extract the myevalvid folder in the downloaded file to
/ns-allinone-2.35/ns-2.35/ directory.
myevalvid/myevalvid_sink.o \
myevalvid/myevalvid.o \
If you get any constructor call error, then replace Line 19 in ns-allinone-2.35/ns-
A yuv video sequence is a raw output of any camera or image recorder. Y stands for Luma
and UV stands for chrominance. For more info click here.
Download ffmpeg pre-compiled binary here. Place the ffmpeg file in /ns-allinone-2.35/ns2.35/evalvid directory.
Disable Malloc check to prevent any errors while execution using following command in
terminal:
export MALLOC_CHECK_=0
Goto /ns-allinone-2.35/ns-2.35/evalvid directory and execute the following commands. If
you get any error while executing any of these commands, it would be because your
system may not have support libraries. If you face any errors, then just google the required
file that Ubuntu asks you to know how to get that library installed.
o
./ffmpeg -s cif -r 30 -i bus_cif.yuv -c:v mpeg4 -b:v 64k -bt 32k -g 30 bus_cif.m4v
Create reference yuv file to evaluate with received yuv file at receiver:
./ffmpeg -i bus_cif2.mp4 bus_cif_ref.yuv
The Source_Video_Trace file is the video trace file which has the information
about each frame of the video and will be used by ns-2 as a traffic source. Create
the file by using:
./mp4trace -f -s 224.1.2.3 12346 bus_cif2.mp4 > Source_Video_Trace
o
o
Place the Evalvid.tcl file from the downloaded tar file in the myevalvid directory.
Now execute: ns Evalvid.tcl
After simulation, ns-2 will create two files, Send_time_file and Recv_time_file
(the filename as used in the tcl file), which record the sending time and received
time of each packet, respectively.
To reconstruct the transmitted video as it is seen by the receiver, the video and
trace files are processed by etmp4 (Evaluate Traces of MP4-file transmission):
./etmp4 -f -0 -c Send_time_file Recv_time_file Source_Video_Trace bus_cif2.mp4 bus_cif_recv.mp
PSNR is the Peak Signal to Noise Ratio which is calculated in dB which shows the
quality of pixel in image frame.