From 8081a5520a441b43a8a7a73f3a90c7aacfaa8e10 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 24 Feb 2019 21:05:27 +0100 Subject: Move everything one level up --- .../tasks/vlc_stream_rtp/howtos/en/index.html | 94 ------------------ .../tasks/vlc_stream_rtp/howtos/images/1.png | Bin 8681 -> 0 bytes .../vlc_stream_rtp/howtos/images/playlist.PNG | Bin 48064 -> 0 bytes .../vlc_stream_rtp/howtos/images/stream_finish.PNG | Bin 57437 -> 0 bytes .../vlc_stream_rtp/howtos/images/stream_menu.png | Bin 80030 -> 0 bytes .../vlc_stream_rtp/howtos/images/stream_open.PNG | Bin 62759 -> 0 bytes .../vlc_stream_rtp/howtos/images/stream_output.PNG | Bin 53770 -> 0 bytes .../howtos/images/stream_transcoding.PNG | Bin 88906 -> 0 bytes .../tasks/vlc_stream_rtp/howtos/si/index.html | 93 ----------------- kpov_judge/tasks/vlc_stream_rtp/task.py | 110 --------------------- 10 files changed, 297 deletions(-) delete mode 100644 kpov_judge/tasks/vlc_stream_rtp/howtos/en/index.html delete mode 100644 kpov_judge/tasks/vlc_stream_rtp/howtos/images/1.png delete mode 100644 kpov_judge/tasks/vlc_stream_rtp/howtos/images/playlist.PNG delete mode 100644 kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_finish.PNG delete mode 100644 kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_menu.png delete mode 100644 kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_open.PNG delete mode 100644 kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_output.PNG delete mode 100644 kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_transcoding.PNG delete mode 100644 kpov_judge/tasks/vlc_stream_rtp/howtos/si/index.html delete mode 100644 kpov_judge/tasks/vlc_stream_rtp/task.py (limited to 'kpov_judge/tasks/vlc_stream_rtp') diff --git a/kpov_judge/tasks/vlc_stream_rtp/howtos/en/index.html b/kpov_judge/tasks/vlc_stream_rtp/howtos/en/index.html deleted file mode 100644 index c9e2714..0000000 --- a/kpov_judge/tasks/vlc_stream_rtp/howtos/en/index.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - -

Summary

- -
    -
  1. Set up a virtual machine
  2. -
  3. Install VLC
  4. -
  5. Create RTP video stream
  6. -
  7. Make sure the stream is accessible from the internet
  8. -
- -

Instructions

- -
    -
  1. -

    Set up a virtual machine

    -

    Use disk simpleArbiter. You can get it here.

    -
  2. - -
  3. -

    Install VLC

    -

    - In file /etc/apt/sources.list replace wheezy with - testing or if missing, add rows: -

    -

    - - deb http://ftp.at.debian.org/debian wheezy main contrib non-free
    - deb-src http://ftp.at.debian.org/debian wheezy main contrib non-free -
    -

    - slika-01 -

    - Check for updates and install VLC with the following commands: -

    -

    - - apt-get update
    - apt-get install vlc -
    -

    -
  4. - -
  5. -

    Create a new stream

    - -

    - Open VLC. In Media menu select Stream. -

    - menu -

    - Here we choose stream source. This can be a file, a network stream or a capture device.
    - For this excercise, add one or more video file by clicking Add ... Continue with a click on button Stream. -

    - stream source -

    - We must also choose the stream destination. For this excercise, choose RTP/MPEG Transport Stream and click Add. - You can configure multiple destinations simultaneously. -

    -

    - Configure destination settings. Enter address and stream name. -

    - stream destination -

    - Next, we can set transcoding, encapsulation, audio and video codecs and also subtitles. When you finish, click Save and Next. -

    - stream settings -

    - In the last step, it is important to check option Stream all elementary streams. - In the text area, we can see the string that can be used to run the stream from a command line. - This is useful if you want to run stream from a computer without graphic interface. -

    - -
  6. - -
  7. -

    Open stream

    -

    - We can now play the stream from another device using VLC. -

    - play stream -
  8. -
- - - - \ No newline at end of file diff --git a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/1.png b/kpov_judge/tasks/vlc_stream_rtp/howtos/images/1.png deleted file mode 100644 index 903be70..0000000 Binary files a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/1.png and /dev/null differ diff --git a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/playlist.PNG b/kpov_judge/tasks/vlc_stream_rtp/howtos/images/playlist.PNG deleted file mode 100644 index b815098..0000000 Binary files a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/playlist.PNG and /dev/null differ diff --git a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_finish.PNG b/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_finish.PNG deleted file mode 100644 index f429a9b..0000000 Binary files a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_finish.PNG and /dev/null differ diff --git a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_menu.png b/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_menu.png deleted file mode 100644 index 01f52c6..0000000 Binary files a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_menu.png and /dev/null differ diff --git a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_open.PNG b/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_open.PNG deleted file mode 100644 index 772ffe8..0000000 Binary files a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_open.PNG and /dev/null differ diff --git a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_output.PNG b/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_output.PNG deleted file mode 100644 index c3dc2a7..0000000 Binary files a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_output.PNG and /dev/null differ diff --git a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_transcoding.PNG b/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_transcoding.PNG deleted file mode 100644 index 1fbc9f3..0000000 Binary files a/kpov_judge/tasks/vlc_stream_rtp/howtos/images/stream_transcoding.PNG and /dev/null differ diff --git a/kpov_judge/tasks/vlc_stream_rtp/howtos/si/index.html b/kpov_judge/tasks/vlc_stream_rtp/howtos/si/index.html deleted file mode 100644 index c94044b..0000000 --- a/kpov_judge/tasks/vlc_stream_rtp/howtos/si/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - -

Naloga na hitro

- -
    -
  1. Postavi navidezni računalnik
  2. -
  3. Naloži VLC
  4. -
  5. Ustvari RTP video tok
  6. -
  7. Poskrbi, da bo tok dostopen na internetu
  8. -
- -

Navodila

- -
    -
  1. -

    Postavi navidezni računalnik

    -

    Uporabi disk simpleArbiter. Dobiš ga lahko tu.

    -
  2. - -
  3. -

    Naloži VLC

    -

    - V /etc/apt/sources.list v spodnjih vrsticah zamenjaj wheezy z - testing oziroma dodaj vrstice če niso napisane: -

    -

    - - deb http://ftp.at.debian.org/debian wheezy main contrib non-free
    - deb-src http://ftp.at.debian.org/debian wheezy main contrib non-free -
    -

    - slika-01 -

    - Poglej za posodobitve in nato naloži VLC z naslednjimi ukazi: -

    -

    - - apt-get update
    - apt-get install vlc -
    -

    -
  4. - -
  5. -

    Ustvari nov tok

    - -

    - Odpri VLC. V meniju Media izberi Stream. -

    - Meni -

    - V oknu "Open Media" izberemo vir toka. Ta je lahko datoteka, že obstoječ omrežni tok ali pa snemalne naprave.
    - Za namen te naloge lahko z klikom na gumb Add ... dodamo eno ali več video datotek. Nadaljujemo z klikom na Stream. -

    - Vir toka -

    - Določiti moramo tudi destinacijo toka. Za to nalogo izberemo RTP/MPEG Transport Stream in kliknemo Add. - Možno je nastaviti več destinacij hkrati. -

    -

    - Nato izpolnimo nastavitve destinacije z naslovom in imenom toka. -

    - Destinacija toka -

    - V naslednjem koraku lahko nastavimo kodiranje, enkapsulacijo, avdio in video nastavitve ter podnapise. -

    - Nastavitve Toka -

    - V zadnjem koraku je pomembno obkljukati možnost Stream all elementary streams. - V spodnjem tekstovnem polju dobimo niz, ki ga lahko uporabimo za zagon toka iz ukazne vrstice. -

    - -
  6. - -
  7. -

    Odpri tok

    -

    - Na drugem računalniku lahko ustvarjen video tok predvajamo z VLC. -

    - Predvajanje toka -
  8. -
- - - - \ No newline at end of file diff --git a/kpov_judge/tasks/vlc_stream_rtp/task.py b/kpov_judge/tasks/vlc_stream_rtp/task.py deleted file mode 100644 index 427fc0e..0000000 --- a/kpov_judge/tasks/vlc_stream_rtp/task.py +++ /dev/null @@ -1,110 +0,0 @@ -# kpov_util should be imported by add_assignment.py - -# Postavi nek film na Internet tako, da ga bodo lahko ostali videli. -# TODO: finish this - -instructions = { - 'si': '''\ -

-Postavi navidezni računalnik SimpleArbiter in StudentVLC. Poskrbi, da bosta na istem omrežju, od koder bosta imela dostop tudi do interneta. - -

-Na StudentVLC posodobi datoteko /etc/apt/sources.list, preveri posodobitve in naloži VLC. - -

-Posnemi ali kako drugače ustvari film ter poskrbi, da bo film dostopen na lokalnem omrežju prek RTP z imenom toka {{TOK}} na naslovu {{NASLOV}}, vrata {{PORT}}. Računaj, da bodo film lahko videli tvoji sošolci. Kršenje avtorskih pravic je pri reševanju te naloge strogo prepovedano. -''', - 'en': '''\ -

-Set up a virtual computer called SimpleArbiter using the simpleArbiter disk and -a virtual computer called StudentVLC using the student-VLC disk. Make sure they -are on the same network and that they have access to the Internet. - -

-On StundentVLC, update /etc/apt/sources.list, check the for updates and install VLC. - -

-Record or otherwise create a movie and make sure the movie is avaliable on your local network via RTP with the name of the stream {{TOK}} at the address {{NASLOV}} on port {{PORT}}. Take into account that the movie may be seen by your classmates. Copyright infrigement while solving this task is strictly prohibited. -''', -} - -computers = { - 'SimpleArbiter': { - 'disks': [ - { 'name': 'simpleArbiter', - }, - ], - 'network_interfaces': [{'network': 'test-net'}], - 'flavor': 'm1.tiny', - 'config_drive': False - }, - 'StudentVLC': { - 'disks': [ - { 'name': 'student-VLC', - }, - ], - 'network_interfaces': [{'network': 'test-net'}], - 'flavor': 'm1.tiny', - 'config_drive': False - } - -} - -networks = { 'test-net': {'public': True} } - -params_meta = { - 'NASLOV': {'descriptions': {'si': 'RTP multicast IP naslov'}, 'w': False, 'public':True, 'type': 'stream_name', 'generated': True}, - 'PORT': {'descriptions': {'si': 'RTP VRATA'}, 'w': False, 'public':True, 'type': 'port', 'generated': True}, - 'TOK': {'descriptions': {'si': 'Naslov (ime) toka'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True}, -} - -def task(NASLOV, TOK): - import pexpect - results = dict() - results['ps'] = pexpect.run('ps xa') - results['tcpdump_hex'] = pexpect.run('sudo /usr/sbin/tcpdump -x -c 2 dst host 239.255.255.255 and port 9875'.format(NASLOV)) - results['tcpdump'] = pexpect.run('sudo /usr/sbin/tcpdump -c 8 dst host {}'.format(NASLOV)) - return results - -def gen_params(user_id, params_meta): - params = dict() - r = random.Random(user_id) - net = kpov_util.IPv4_net_gen(r, min_hosts = 16, - local=True, multicast=True) - params['NASLOV'] = kpov_util.IPv4_addr_gen(r, net, 1)[0] - params['PORT'] = str(r.randint(5000, 6000)) - params['TOK'] = kpov_util.hostname_gen(r) - return params - -def task_check(results, params): - import re - score = 0 - hints = [] - p1_s = "" - sname = "" - try: - packs = results['tcpdump_hex'].split('> 239.255.255.255.9875: UDP, length') - p1 = packs[1] - p1_l = p1.split('\n') - p1_d = p1_l[1:-1] - p1_s = "" - for i in p1_d: - p1_s = p1_s + "".join([j.strip() for j in i.split(' ')[1:]]) - sname = "".join([hex(ord(i))[2:] for i in params['TOK']]) - except: - hints.append("problem parsing RTP stream capture result") - if p1_s.find(sname) > 2: - score += 5 - else: - hints.append("stream name not found in stream announcement") - s = "IP [^ ]* > {}.{}: UDP, length [0-9]+".format( - re.escape(params['NASLOV']), - params['PORT']) - if re.search(s, results['tcpdump']): - score += 5 - else: - hints.append("RTP stream not detected in " + results['tcpdump']) - return score, hints - -def prepare_disks(templates, task_params, global_params): - write_default_config(templates['simpleArbiter'], global_params) -- cgit v1.2.1