GEC17Agenda/GettingStartedWithGENI_III_GIMI/Procedure/TrackIssues/vlc: vlc-210-exp.rb

File vlc-210-exp.rb, 4.4 KB (added by Cong, 11 years ago)
Line 
1defApplication('test:app:vlc', 'vlc') do |app|
2
3   app.path = "/root/vlc-2.1.0-git/bin/vlc-static"
4   app.version(2, 1, 0)
5   app.shortDescription = "VLC"
6   app.description = "VLC multimedia player and streamer"
7
8   app.defProperty("input", "Stream input (e.g. file or network address)", nil,
9                   {:type => :string, :dynamic => false})
10   app.defProperty("sout", "Stream output", "--sout",
11                   {:type => :string, :dynamic => false})
12   app.defProperty("intf", "Main interface module", "--intf",
13                   {:type => :string, :dynamic => false})
14   app.defProperty("extraintf", "Extra interface module(s). Use --extraintf omlstats to enable OML", "--extraintf",
15                   {:type => :string, :dynamic => false})
16   app.defProperty("mtu", "Specifies the MTU of the network interface", "--mtu",
17                   {:type => :string, :dynamic => false})
18   app.defProperty("quiet", " Deactivates all console messages", "--quiet",
19                   {:type => :boolean, :dynamic => false})
20#   app.defProperty("play-and-exit", "Exit VLC after playing all the items in the input stream list", "--play-and-exit",
21#                   {:type => :boolean, :dynamic => false})
22
23#   app.defMeasurement('audio') do |mp|
24#     mp.defMetric('i_decoded_audio_blocks',:int)
25#     mp.defMetric('i_played_audio_buffers',:int)
26#     mp.defMetric('i_lost_audio_buffers',:int)     
27#   end
28
29   # app.defMeasurement('video') do |mp|
30   #   mp.defMetric('i_decoded_video_blocks',:int)
31   #   mp.defMetric('i_played_video_frames',:int)
32   #   mp.defMetric('i_lost_video_frames',:int)
33   # end
34
35   # app.defMeasurement('input') do |mp|
36   #   mp.defMetric('i_read_packets',:int)
37   #   mp.defMetric('i_read_bytes',:int)
38   #   mp.defMetric('f_input_bitrate',:float)
39   #   mp.defMetric('i_demux_read_bytes',:int)
40   #   mp.defMetric('f_demux_bitrate',:float)
41   #   mp.defMetric('i_demux_corrupted',:int)
42   #   mp.defMetric('i_demux_discontinuity',:int)
43   # end
44
45   # app.defMeasurement('output') do |mp|
46   #   mp.defMetric('i_sent_packets',:int)
47   #   mp.defMetric('i_sent_bytes',:int)
48   #   mp.defMetric('f_send_bitrate',:float)
49   # end
50
51   app.defMeasurement('vlc_dashRateAdaptation') do |mp|
52     mp.defMetric('chosenRate_bps',:int)
53     mp.defMetric('empiricalRate_bps',:int)
54     mp.defMetric('decisionRate_bps',:int)
55     mp.defMetric('buffer_percent',:int)
56   end
57
58   app.defMeasurement('vlc_dashDlSession') do |mp|
59     mp.defMetric('chunkCount',:int)
60     mp.defMetric('readSession_B',:int)
61     mp.defMetric('readChunk_B',:int)
62     mp.defMetric('timeSession_s',:float)
63     mp.defMetric('timeChunk_s',:float)
64   end
65end
66
67defProperty('theOne','ubuntu','ID of sender node')
68
69#defProperty('packetsize', 128, "Packet size (byte) from the sender node")
70#defProperty('bitrate', 2048, "Bitrate (bit/s) from the sender node")
71#defProperty('runtime', 40, "Time in second for the experiment is to run")
72defProperty('graph', true, "Display graph or not")
73defProperty('duration', 10, "Duration of experiment")
74
75defGroup('Sender',property.theOne) do |node|
76  node.addApplication("test:app:vlc") do |app|
77    app.setProperty('quiet', true)
78#    app.setProperty('play-and-exit', false)
79    app.setProperty('intf', 'dummy')
80    app.setProperty('extraintf', 'omlstats')
81    app.setProperty('input', 'http://emmy9.casa.umass.edu/DASH_BuckBunny/www-itec.uni-klu.ac.at/ftp/datasets/mmsys12/BigBuckBunny/bunny_2s_480p_only/bunny_Desktop.mpd')
82#    app.setProperty('mtu', '1200')
83#    app.measure('audio', :samples =>1)
84#    app.measure('video', :samples =>1)
85#    app.measure('input', :samples =>1)
86#    app.measure('output', :samples =>1)
87    app.measure('vlc_dashRateAdaptation', :samples =>1)
88    app.measure('vlc_dashDlSession', :samples =>1)
89  end
90end
91
92
93onEvent(:ALL_UP_AND_INSTALLED) do |event|
94    info "starting"
95    wait 3
96#    allGroups.exec("ln -s /usr/local/bin/vlc /usr/bin/vlc")
97    allGroups.startApplications
98    info "All applications started..." 
99    wait property.duration
100    wait 3
101    allGroups.stopApplications
102    info "All applications stopped."
103    Experiment.done
104end
105
106#defGraph 'Throughput' do |g|
107#  g.ms('dashRateAdaptation').select {[oml_ts_client.as(:ts), :chosenRate_bps ]}
108#  g.caption "Packet length measurement."
109#  g.type 'line_chart3'
110#  g.mapping :x_axis => :ts, :y_axis => :chosenRate_bps
111#  g.xaxis :legend => 'time [s]'
112#  g.yaxis :legend => 'Chosen Rate [bps] ', :ticks => {:format => 's'}
113#end