-
Notifications
You must be signed in to change notification settings - Fork 5
/
insta360-test
executable file
·58 lines (45 loc) · 1.5 KB
/
insta360-test
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 python3
import logging
import sys
import time
import insta360
# Choose logging level: NOTSET, DEBUG, INFO, WARNING, ERROR
logging.basicConfig(format='%(asctime)s %(levelname)-8s %(message)s')
logging.getLogger().setLevel(logging.DEBUG)
cam = insta360.camera(host='192.168.42.1', port=6666)
cam.Open()
seq = cam.SyncLocalTimeToCamera()
print('Sent packet SyncLocalTimeToCamera(): seq: %d' % (seq,))
time.sleep(1)
seq = cam.GetCameraInfo()
print('Sent packet GetCameraInfo(): seq: %d' % (seq,))
time.sleep(1)
seq = cam.GetNormalVideoOptions()
print('Sent packet GetNormalVideoOptions(): seq: %d' % (seq,))
time.sleep(1)
seq = cam.SetNormalVideoOptions()
print('Sent packet SetNormalVideoOptions(): seq: %d' % (seq,))
time.sleep(1)
seq = cam.StartCapture()
print('Sent packet StartCapture(): seq: %d' % (seq,))
time.sleep(20)
seq = cam.StopCapture()
print('Sent packet StopCapture(): seq: %d' % (seq,))
time.sleep(1)
seq = cam.TakePicture()
print('Sent packet TakePicture(): seq: %d' % (seq,))
time.sleep(1)
seq = cam.GetCameraFilesList()
print('Sent packet GetCameraFilesList(): seq: %d' % (seq,))
time.sleep(1)
# Live stream video seems to be embedded into the TCP socket data
# with header prefix '\x01\x00\x00', but the format is unknown.
#seq = cam.StartLiveStream()
#print('Sent packet StartLiveStream(): seq: %d' % (seq,))
#time.sleep(20)
#seq = cam.StopLiveStream()
#print('Sent packet StopLiveStream(): seq: %d' % (seq,))
#time.sleep(1)
# Wait messages eventually into the queue.
time.sleep(5)
cam.Close()