forked from scivision/PyLivestream
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisual_tests.py
More file actions
executable file
·58 lines (48 loc) · 2.01 KB
/
Copy pathvisual_tests.py
File metadata and controls
executable file
·58 lines (48 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python
"""
plays several tests to localhost for testing.
"bunny" clip created by:
ffmpeg -ss 00:00:30 -i BigBuckBunny_DivX_HD720p_ASP.divx -t 7 -vf scale=-2:240 -c:v libx264 -c:a aac bunny.avi
"""
from pathlib import Path
import subprocess
R = Path(__file__).parent
VIDPATH = R / 'tests'
IMGPATH = R / 'doc'
HOST = 'localhost'
STATIC = IMGPATH / 'logo.png'
MOVING = VIDPATH / 'cc_land.gif'
VIDEO = VIDPATH / 'bunny.avi'
MUSIC = VIDPATH / 'orch.ogg'
def main():
print('these tests enable a user to visually confirm PyLiveStream code is working.')
print('the streaming is just on your own computer.')
print('\n\n press q in the terminal window to proceed to the next test. \n\n')
# %% Microphone
print('PyLivestream splash with live microphone audio')
subprocess.check_call(['MicrophoneLivestream', '-y', HOST, '-image', str(STATIC)])
print('1990s vector graphics with live microphone audio')
subprocess.check_call(['MicrophoneLivestream', '-y', HOST, '-image', str(MOVING)])
# %% Music
print('PyLivestream splash with orchestra music (caption)')
subprocess.check_call(['FileGlobLivestream', '-y', '-image', str(STATIC),
str(VIDPATH), HOST,
'-glob', 'orch.ogg'])
print('1990s vector graphics with orchestra music (NO caption')
subprocess.check_call(['FileGlobLivestream', '-y', '-image', str(MOVING),
str(MUSIC), HOST])
# video
print('Looping video')
subprocess.check_call(['FileGlobLivestream', '-y',
str(VIDEO), HOST])
# %% Screenshare
print('Screenshare + microphone')
subprocess.check_call(['ScreenshareLivestream', '-y', HOST])
# %% loop video
print('Looping video')
subprocess.check_call(['FileLoopLivestream', '-y', str(VIDEO), HOST])
# %% Webcam
print('Webcam test - will fail if no webcam present on your system')
subprocess.check_call(['WebcamLivestream', '-y', HOST])
if __name__ == '__main__':
main()