-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtryclient.py
More file actions
executable file
·84 lines (77 loc) · 1.92 KB
/
tryclient.py
File metadata and controls
executable file
·84 lines (77 loc) · 1.92 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env python
import dbus
service = "ch.cett.misse.ffmpeg"
ffmpeg = dbus.Interface(dbus.SessionBus().get_object(service,"/"), service)
print 'Available commands are: \n'
print '1- start \n'
print '2- stop \n'
print '3- image_size_set \n'
print '4- image_size_get \n'
print '5- image_rate_set \n'
print '6- image_rate_get \n'
print '7- bit_rate_set \n'
print '8- bit_rate_get \n'
print '9- qscale_set \n'
print '10- qscale_get \n'
print '11- client_ip_set \n'
print '12- client_ip_get \n'
while True:
try:
x = int(raw_input("enter the number of the command: "))
except ValueError:
print "You didn't enter a number!"
continue
if x < 1:
exit()
elif x == 1:
print ffmpeg.start()
elif x == 2:
ffmpeg.stop()
elif x == 3:
try:
w = int(raw_input("the width of the frame is: "))
except ValueError:
print "You didn't enter a number!"
continue
try:
h = int(raw_input("the height of the frame is: "))
except ValueError:
print "You didn't enter a number!"
continue
print ffmpeg.image_size_set(w, h)
elif x == 4:
print ffmpeg.image_size_get()
elif x == 5:
try:
r= int(raw_input("the image rate is: "))
except ValueError:
print "You didn't enter a number!"
continue
print ffmpeg.image_rate_set(r)
elif x == 6:
print ffmpeg.image_rate_get()
elif x == 7:
try:
r = int(raw_input("the bit rate is: "))
except ValueError:
print "You didn't enter a number!"
continue
print ffmpeg.bit_rate_set (r)
elif x == 8:
print ffmpeg.bit_rate_get()
elif x == 9:
try:
r = int(raw_input("the qscale is: "))
except ValueError:
print "You didn't enter a number!"
continue
print ffmpeg.qscale_set (r)
elif x == 10:
print ffmpeg.qscale_get()
elif x == 11:
s=raw_input("the ip is: ")
print ffmpeg.client_ip_set(s)
elif x == 12:
print ffmpeg.client_ip_get()
else:
print 'invalid'