wiki:GEC16Agenda/WiMAX-Tutorial/Video/04

Version 1 (modified by Fraida Fund, 6 years ago) (diff)

--

Previous

Writing the Experiment Script

Once all of the OMF application wrappers are installed on the OMF EC console, we can prepare the experiment script:

defProperty('res', 2, "First node")
defProperty('prefix', "omf.necwimax.node", "Prefix for node names")

# Video properties
defProperty('vlcport', 9001, "Port on node to send video stream to")
defProperty('duration', 30, "Length of time to save video for")
defProperty('bitrate', 100, "Bitrate of transcoded video")
defProperty('scale', 0.5, "Scale of transcoded video")
defProperty('vlcsenderbin', "/home/wimax/vlc-2.0.5/vlc", "Full path to VLC binary to run on sender")
defProperty('vlcsendargs', " -I dummy -V dummy --quiet --play-and-exit --run-time #{property.duration}", 
        "Arguments to pass to VLC sender")
defProperty('vlcsend', 
        ":sout=\'#transcode{vcodec=h264,vb=#{property.bitrate},scale=#{property.scale},acodec=none}:std{access=udp{ttl=1},mux=ts,dst=10.43.255.255:#{property.vlcport}}\'",
        "Text of VLC sout stanza for sender")
defProperty('vlcomlargs', "--extraintf omlstats --oml-exp-id #{Experiment.ID} --oml-server tcp:128.238.66.220:3008 --oml-id video-source",
        "OML arguments for VLC sender")

defGroup('receiver', "#{property.prefix}#{property.res}") do |node|
  node.net.t0.channel = "2590000,10"
  node.net.t0.mtu=1470
  node.net.t0.netmask = "255.255.0.0"
  node.net.t0.ip = "10.43.9.202"
  node.addApplication("wmxstat_universal") do |app|
    app.measure('status')
  end
  node.addApplication("vlc") do |app|
    app.setProperty('quiet', true)
    app.setProperty('play-and-exit', true)
    app.setProperty('intf', 'dummy')
    app.setProperty('extraintf', 'omlstats')
    app.setProperty('input', "udp://@:#{property.vlcport}")
    app.setProperty('sout', "''#standard{access=file,mux=ts,dst=/root/#{Experiment.ID}.mp4}''")
    app.measure('audio', :samples =>1)
    app.measure('video', :samples =>1)
    app.measure('input', :samples =>1)
    app.measure('output', :samples =>1)
  end

end
 
onEvent(:ALL_UP_AND_INSTALLED) do |event|
  system("/home/#{ENV['USER']}/getbsconf -i wimaxrf --oml-server tcp:localhost:3003 --oml-id console --oml-exp-id #{Experiment.ID}")
  wait 10
  allGroups.startApplications
  system("ssh wimax@128.238.38.83 \"#{property.vlcsenderbin} #{property.vlcsendargs} udp://@:9000 #{property.vlcsend} #{property.vlcomlargs}\"")
  wait property.duration
  allGroups.stopApplications
  wait 2
  allGroups.exec("/usr/local/bin/iput -f /root/#{Experiment.ID}.mp4 video")
  wait 5
  Experiment.done
end



Deconstructing the experiment script:
Every OMF-enabled node in the experiment (purple node) is represented by a "defGroup" stanza.
Every OML-enabled application that runs on an OMF node is represented by an "addApplication" stanza within the "defGroup"


Next