How to evaluate MPEG video transmission using the NS2 simulator?
具体见:http://hpds.ee.ncku.edu.tw/~smallko/ns2/Evalvid_in_NS2.htm
I extended Jirka klaue’s work, EvalVid - . I wrote some codes to integrate researchers can easily experiment with MPEG video transmission using the NS2 simulator. On
Chih-Heng , An Evaluation Framework for More Realistic Simulations of MPEG Video Transmission”, Journal of Information Science and Engineering (accepted) (SCI, EI)
In the beginning, I describe how to integrate
p.s. If you want to use the codec provided by this tool-set, you must use windows system. I have no source co
(Video Demo: how to insert those codes into NS2)
Method 1:
1. Put a
Modify the file
struct
// packet type (see above)
size_; // simulated packet size
// unique id
error_; // error flag
// # of corrupted bits
// timestamp: for q-delay measurement // receiving interface (label) direction_; // direction: 0=none, 1=up, -1=down // source routing
//add the following three lines int frametype_; // frame type for MPEG video transmission (Henry) double unsigned long
2. Modify the file class void recv(Packet*, Handler*);
...... inline // add the following two lines inline void set_frametype(int type) { frametype_ = type; } // (Henry) inline void set_prio(int prio) { prio_ = prio; } // (Henry) protect // default
// add the following line int frametype_; // frame type for MPEG video transmission ...... private: void }; 3. Modify the file Agent::(packet_t
sizeframetype_(0),
channel
{ } ...... Agent::(Packet* p) const {
ch->uid() = uidcnt_++; ch->ptype() = type_; ch /*
// add the following line ch->
...... 4. Create a “myudp.cc, myudp.h, myudpsink2.cc, myudpsink2.h, and mytraffictrace2.cc in it. 5. modify the file Add the following two lines Agent/ Tracefile 6. Modify the
Put mympeg/myudp.o 7. Recomplie NS2 cd
make clean; make
Method 2:
Thanks for Guohan Lu’s help.
1. Download the patch file. (here)
2. Just put the file mympeg-patch-to-ns2.28.patch in ns-2.28/ and run the following command
patch -p1 < mympeg-patch-to-ns2.28.patch
3. Modify the
Put mympeg/myudp.o, mympeg/myudpsink2.o and mympeg/mytraffictrace2.o in the OBJ_CC list 4. Recomplie NS2 cd
make clean; make
[Example]
This example on
1. Encoding a http://megaera.ee.nctu.edu.tw/mpeg/ )
mpeg4encoder.exe
2. On
3. Use MP4.exe (from
MP4.exe –send 224.1.2.3 5555 1000
4. First, I use a simple topology to test the MPEG4 video delivery over a best-effort service network. The simulation environment is shown below. S1 will use the da
S1 ----> R1 --- >R2 ----> D1
ns2 be.tcl
5. After simulation, ns2 will create two files, sd_be and rd_be. The file sd_be is to record the sending time of each packet while the file rd_be is used to record the received time of each packet.
6. Using the tool et.exe (from Evalvid) to generate the received video (err.cmp).
et.exe sd_be rd_be st foreman_qcif.cmp err_be.cmp 1
7. Decode the received video to yuv format. I also put the status of decoding into a file df_be.
mpeg4decoder.exe err_be.cmp err_be 176 144 > df_be
8. I think there is something wrong with fixyuv.exe. Therefore I write a new program myfixyuv.exe to fix the decoded yuv sequence.
myfixyuv.exe df_be qcif 400 err_be.yuv myfix_be.yuv
9. Compute the PSNR. Use the psnr.exe (from Evalvid). But I modify the original psnr.c to add frame number id before the psnr of each frame.
psnr.exe 176 144 420 foreman_qcif.yuv myfix_be.yuv > psnr_myfix_be
10. Use the same topology above. But I frame packet is pre-marked with lowest drop probability in the application layer at source. P frame packet is pre-marked with middle drop probability and B frame packet is pre-marked with highest drop probability. R1 is implemented WRED. (See qos.tcl)
12. On
Overview
of The structure of the as follows.The main components of the evaluation framework are described as follows:
l Source: The video source can be either in the YUV QCIF (176 x 144) or in the YUV CIF (352 x 288) formats.
l Video Encoder and Video Decoder: Currently,
l VS (Video Sender): The VS component reads the compressed video file from the output of the video encoder, fragments each large video frame into smaller segments, and then transmits these segments via UDP packets over a real or simulated network. For each transmitted UDP packet, the framework records the timestamp, the packet id, and the packet payload size in the sender trace file with the aid of third-party tools, such as te=mailto:Artur%20Ziviani dateTime=2005-04-20T09:22>
where
k-1 and k = number of bits per pixel (luminance component). PSNR measures the error between a reconstructed image and the original onPossible PSNR to MOS conversion.
|
PSNR[dB] |
MOS |
|
>37 31-37 25-31 20-25 <20 |
5 (Excellent) 4 (Good) 3 (Fair) 2 (Poor) 1 (Bad) |
New network simulation agents
The following figure illustrates the connecting simulation agents, namely MyTrafficTrace, and are implemented between NS2 and . These interfaces are designed either to read the video trace file or to generate the da
MyTrafficTrace
The is employed to extract the frame type and the frame size of the video trace file generated from the output of the VS component of . Furthermore, this agent fragments the video frames into smaller segments and sends these segments to the lower UDP layer at the appropriate time according to the user settings specified in the simulation script file.
MyUDP
Essentially, the UDP agent. This new agent allows users to specify the output file name of the sender trace file and it records the timestamp of each transmitted packet, the packet id, and the packet payload size. The task of the
MyUDPSink
MyUDPSink is the receiving agent for the fragmented video frame packets sent by This agent also records the timestamp, packet ID, and payload size of each received packet in the user specified file.
Problem of the original YUV program
When the video transmission is over, the receiver trace file has to be sent back to the sender side for the video quality evaluation. Based on the video trace file, the sender trace file, and the receiver trace file, the lost frames can be indicated. If a frame is lost due to packet loss, the ET component sets the
Currently, no standard exists to define an appropriate treatment of Other decoders, such as This type of frame is referred to as
Based on these considerations, a requirement exists to design a new algorithm capable of solving the problem of i.e. reconstructed erroneous video sequence. If a frame is decodable, the improved FV component copies this decoded YUV frame da
[The projects or papers based on this toolset]
l Chih-Heng , "A Two Markers System for Improved MPEG Video Delivery in a DiffServ Network", IEEE Communications Letters, IEEE Press, ISSN: 1089-7798, vol. 9, no. 4, pp. 381-383, April 2005
l J. Adaptive Approach for QoS Support in IEEE 802.11e Wireless LAN," in IEEE International Conference on Wireless and Mobile Computing , Networking and Communications (
l H. Huang, J. , “Efficient Multimedia Transmission in Mobile Network by using PR-SCTP”, Communications and Computer Networks (CCN 2005), 10/24/2005 - 10/26/2005, Marina del
l A. Lo, G. Performance Evaluation of MPEG-4 Video Streaming over UMTS Networks using an Integrated Tool Environment", Proceedings SPECTS 2005, 2005 International Symposium on Performance Evaluation of Computer and Telecommunication Systems, Philadelphia, PA, USA, July 24-28, 2005.
l Vasos Pavlos Antoniou, Requirements for the Transmission of Streaming Video in Mobile Wireless Networks”, International Conference on Artificial Neural Networks (ICANN), Athens, Greece, September 10-14, 2006