Compressed PTTVideo Traffic

download Compressed PTTVideo Traffic

of 23

Transcript of Compressed PTTVideo Traffic

  • 8/13/2019 Compressed PTTVideo Traffic

    1/23

    Lab-Experiment # 05

    By

    Eng. Naveed A. Umrani

    Analyzing Compressed Video

    Traffic

  • 8/13/2019 Compressed PTTVideo Traffic

    2/23

    Outlines

    Purpose of the Lab

    What is Digital Video

    Advantage of Compression

    MPEG Encoder Group-of-Picture (GOP)

    VBR Video

    Exercises Tasks

    2 Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    3/23

    Purpose of the Lab

    In this lab, you will explore theproperties of a traffic flowthat consists

    of compressed digital video traffic.

    3 Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    4/23

    What is a Digital Video

    Digital video consists of a sequence ofvideo frames that are displayed at a rate

    of typically 30 frames per seconds.

    Assuming a frame size of 720 x 480

    pixels (a standard format used for digital

    video) and a depth of 24bits per pixel,this results in a data rate 240Mbps per

    video stream.

    4 Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    5/23

    Advantage of Compression

    Using modern compression methods,such as MPEGand H.264, the data rate

    can be drastically reduced to a few

    Mbps.

    5 Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    6/23

    MPEG Encoder

    An MPEG encoder (and most othercompression algorithms) generates

    three types of frames:

    Intra-coded (I), Inter-coded or predictive (P)

    bi-directional (B)

    6 Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    7/23

    MPEG Encoder

    Intra-Coded (I) Frames

    I frames are coded as still images

    Inter-coded or predictive (P)

    P frames encode the differences from

    the most recent I or P frame

    bi-directional (B) B are interpolations of the next and

    previous I or P frames.

    7 Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    8/23

    Group-of-Picture (GOP)

    An MPEG encoder generates theseframes (I,P,B) in a repeating pattern,

    called the Group-of-Picture (GOP)

    pattern.

    A typical GOP pattern of IBBPBBPBB,

    where the dependencies betweenframes is indicated by arrows, is shown

    in the following figure

    8Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    9/23

    Group-of-Picture (GOP)

    9 Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    10/23

    Group-of-Picture (GOP)

    As indicated in the figure, frame types havedifferent sizes, with I frames being the largest

    and B frames the smallest.

    Note that a B frame is constructed from tworeference frames of type I or P (e.g., Frame 3

    above depends on Frame 1 and Frame 4).

    Thus, to encode or decode a B frame the

    transmitter or receiver must have available thenext I or P frame.

    To account for this need, frames are

    transmitted in a different sequence than they

    are displayed.10 Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    11/23

    Group-of-Picture (GOP)

    In the above example, the display andtransmission sequence is as follows:

    Display sequence: 1 2 3 4 5 6 7 8 9 10

    Transmit sequence: 1 4 2 3 7 5 6 10 8 9

    11 Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    12/23

    Variable Bit Rate (VBR) Video

    Due to the different sizes of I, P, and Bframes, the data rate of an MPEG

    encoded video sources changes from

    frame to frame. For this reason,compressed video such as MPEG, is

    referred to a Variable Bit Rate (VBR)

    video.

    12 Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    13/23

    Exercises Download a VBR video trace

    Your first task is to download a file that contains a trace of a

    VBR video source. The file contains the frame sizes

    obtained from a compression of a picture movie. The size of

    the file is 2.6 MB.

    Content: Silence of the Lambs (~ 30 min)

    Source Format: DVD

    Frame size and rate: CIF 352x288 @30 fps

    (frames per second)

    Compression Algorithm: H.264/AVC (Full)

    Quantizer (compression factor): 10

    GoP Pattern: I B B B P B B P P B B B P B B B

    Number of Frames: ~5400013 Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    14/23

    Exercises

    Explore the content of the file. The file contains one line for each frame and has

    multiple columns. The first four columns are

    relevant for us:

    Column 1: Sequence number of the frame (intransmit sequence)

    Column 2: Display time of the frame

    Column 3: Frame type

    Column 4: Frame size in bytes

    Columns 5 7: not used

    14 Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    15/23

    Exercises

    [index, time, type_f, framesize_f, dummy1,dymmy2, dymmy3 ] = textread('movietrace.data',

    '%f %f %c %f %f %f %f');

    %Extracting the I,P,B frmes characteristics

    from the source file

    %frame size of I frames : framesize_I

    %frame size of P frames : framesize_p

    %frame size of B frames : framesize_B

  • 8/13/2019 Compressed PTTVideo Traffic

    16/23

    Exercisesa=0;b=0;

    c=0;

    for i=1:length(index)

    if type_f(i)=='I'

    a=a+1;

    framesize_I(a)=framesize_f(i);

    end

    if type_f(i)=='B'

    b=b+1;

    framesize_B(b)=framesize_f(i);

    endif type_f(i)=='P'

    c=c+1;

    framesize_P(c)=framesize_f(i);

    end

    end

  • 8/13/2019 Compressed PTTVideo Traffic

    17/23

    Exercises

    Compute the following properties of thevideo trace. Number of frames and total number of bytes;

    Size of the smallest frame, size of the largest frame, and

    mean frame size;

    Size of the smallest, largest and mean I, P, and B frame;

    Mean bit rate (Computed as the mean frame size

    divided by the frame duration);

    Peak bit rate (Computed as the max. frame size dividedby the frame duration);

    Ratio of the peak rate and the average rate. This peak-

    to-average rate ratio is often used as an indicator how

    bursty a traffic flow is. A flow with a peak-to-average ratio

    of 10 or higher is highly variable.17 Principles of Teletraffic Engineering

  • 8/13/2019 Compressed PTTVideo Traffic

    18/23

    Exercises

    %Hint1: You may use the MATLAB functions'length()','mean()','max()','min()'. which

    calculate the length, mean, max, min of a

    vector (for example max(framesize_P) will

    give you the size of largest P frame.

  • 8/13/2019 Compressed PTTVideo Traffic

    19/23

    Exercises

    Generate a set of graphs that show theproperties of the video trace:

    1. Generate a graph that shows the frame

    size as a function of the frame sequence

    number. (Use the sequence in which the

    frames are listed in the file, i.e., the transmit

    sequence.)2. Generate a graph that shows the

    distribution of I frames, P frames, and B

    frames. (x-axis is the frame size, y-axis is

    the relative frequency).

  • 8/13/2019 Compressed PTTVideo Traffic

    20/23

    Exercises

    %Hint2: Use the 'plot' function to graphthe framesize as a function of the frame

    sequence number.

    %Hint3: Use the function 'hist' to show thedistribution of the frames. Before that

    function type 'figure(2);' to indicate your

    figure number.

  • 8/13/2019 Compressed PTTVideo Traffic

    21/23

    Exercises

    Create three plots of the video traffic traceviewed at different scales. Each graph has

    100 data points.

    Plot 1: Generate a vector with 100 elements.

    Starting with Frame 1, each element stores the

    amount of data from 500 frames of the video

    sequence.

    1st element: #bytes from the first 500 frames

    (frames 1, 2, , 500).

    2nd element: #bytes from the frames 501,502, ,

    1000.

  • 8/13/2019 Compressed PTTVideo Traffic

    22/23

    Exercises

    initial_point=1;ag_frame=500;

    jj=initial_point;

    i=1;

    bytes_f=zeros(1,100);

    while i

  • 8/13/2019 Compressed PTTVideo Traffic

    23/23

    TasksPlot 2: Generate a vector with 100 elements. Starting with arandomly selected frame, each element stores the amount

    of data from 50 frames of the video

    sequence.

    o Pick a random starting point, e.g., frame 3000.

    o 1st element: #bytes from frames 3001, 3002, 3050.o 2nd element: #bytes from frames 3051, 3052, 3100.

    o .

    Plot 3: Generate a vector with 100 elements. Starting with arandomly selected frame, each element stores the amount

    of data from 5 frames of the video sequence.o Pick a random starting point, e.g., frame 5010.

    o 1st element: #bytes from frames 5010, 5011, 5015.

    o 2nd element: #bytes from frames 5016, 5017, 5018.

    o .