Skip to content
This repository was archived by the owner on Jun 9, 2021. It is now read-only.

Commit b145524

Browse files
committed
remove video funcionality for now
1 parent 699582d commit b145524

File tree

4 files changed

+0
-24
lines changed

4 files changed

+0
-24
lines changed

README.md

-4
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ We use:
2424
* Raspberry Pi 2b or 3b
2525
* Official Raspberry Pi camera
2626
* Motion sensor ([we use this](https://www.amazon.co.uk/gp/product/B00NFXBPU8/))
27-
* LED Matrix ([we use this](https://www.amazon.co.uk/gp/product/B0714FVF3R/))
28-
* Keypad ([we use this](https://www.amazon.co.uk/gp/product/B00UB32C7U/))
2927

3028
## Run Bot
3129

@@ -59,8 +57,6 @@ Both commands respond with a confirmation of the operation.
5957

6058
* ```camera photo``` - Take a photo with a Raspberry Pi camera and send it back as an attached image.
6159

62-
* ```camera video [sec]``` - Shoot a video for *sec* seconds and send it back as an attached file.
63-
6460
### Subsription
6561

6662
* ```subscribe security``` - Add your current Spark account to a database to receive security updates. It includes sending you photos taken by camera, when the motion sensor fires up.

app/commands/camera.py

-14
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import picamera
22
import time
33

4-
54
camera = picamera.PiCamera()
65

76

87
def proc(command, message):
98
if command[0] == "photo":
109
return take_photo()
11-
elif command[0] == "video":
12-
return shoot_video()
1310
else:
1411
return {
1512
"data": {
@@ -35,14 +32,3 @@ def take_photo():
3532
},
3633
"response_required": True
3734
}
38-
39-
40-
def shoot_video(video_length):
41-
session_id = str(time.time())
42-
file_name_h264 = 'app/tmp/' + session_id + '.h264'
43-
file_name_mp4 = 'app/tmp/' + session_id + '.mp4'
44-
camera.start_recording(file_name_h264)
45-
camera.wait_recording(video_length)
46-
camera.stop_recording()
47-
# sudo apt-get install gpac
48-
# MP4Box -add filename.h264 filename.mp4

app/commands/help.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ def proc(command, message):
88
99
&#128247; camera controls<br>
1010
<b>camera photo</b>: I will take a photo and send it back<br>
11-
<b>camera video <i>sec</i></b>: I will shoot a <i>sec</i>-second long video (up to 10 seconds)<br><br>
1211
1312
&#128161; light controls<br>
1413
<b>lights on <i>color</i></b>: I will shine with the specified <i>color</i> (red, green, blue)<br>

app/main.py

-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
def on_motion_detected():
1717
room_data = event.get_subscribers("security")
18-
print(room_data)
1918
if len(room_data):
2019
photo_data = camera.take_photo()
2120
for room in room_data:
@@ -25,10 +24,6 @@ def on_motion_detected():
2524
def run_motion_detection():
2625
motion.detector_on(on_motion_detected)
2726

28-
29-
def run_flask_server():
30-
app.run(host='0.0.0.0', port=8181)
31-
3227

3328
@app.route("/", methods=["post"])
3429
def index():

0 commit comments

Comments
 (0)