-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_recording.py
More file actions
50 lines (40 loc) Β· 1.45 KB
/
Copy pathtest_recording.py
File metadata and controls
50 lines (40 loc) Β· 1.45 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
"""
Test basic recording with current settings on Hero 12 Black
"""
from gopro_usb import GoProUSB
import time
SN = "C3504224682139"
gopro = GoProUSB(SN)
print("π Testing basic recording on Hero 12 Black\n")
gopro.power_on()
time.sleep(1)
# Check current settings
state = gopro.get_state()
print(f"π Current Resolution: {gopro._get_resolution_name(state['settings'].get('2', 'N/A'))}")
print(f"π¬ Current FPS: {gopro._get_fps_name(state['settings'].get('3', 'N/A'))}")
print(f"π Current Lens: {gopro._get_lens_name(state['settings'].get('121', 'N/A'))}")
print(f"π Battery: {state['status'].get('70', 'N/A')}%")
print(f"πΎ SD free: {state['status'].get('54', 'N/A')} MB\n")
print("="*60)
print("Testing recording with current settings")
print("="*60)
# Try to record for 5 seconds
print("\nπ΄ Starting recording...")
if gopro.record_start():
print("β
Recording started successfully!\n")
# Monitor for 5 seconds
for i in range(5):
time.sleep(1)
state = gopro.get_state()
is_recording = state['status'].get('10', 0) == 1
print(f" β±οΈ {i+1}s - Recording: {'YES' if is_recording else 'NO'}")
print("\nβΉοΈ Stopping recording...")
if gopro.record_stop():
print("β
Recording stopped successfully!\n")
else:
print("β Failed to stop recording\n")
else:
print("β Failed to start recording\n")
print("="*60)
print("β
Basic recording test complete")
print("="*60)