def uploader(file_Queue, db):
while True:
filename, foreground = file_Queue.get()
# make sure filename extension is mp4
filename = filename[:-3] + 'mp4'
upload_to_s3(BUCKET_NAME, "videos/"+filename[8:], filename[8:])
#print filename + ", " + filename[8+len(RPiName)+1:-4]
# extract the timestamp from the filename
timestamp = float(filename[8+len(RPiName)+1:-4])
# convert float array to strings as needed for Dynamo
fg_data = {'data': [str(item) for item in foreground]}
db.create_item(RPiName, BUCKET_NAME, 'videos/'+filename[8:], timestamp, fg_data)
# delete the files once we've uploaded them
os.remove(filename[8:])
os.remove(filename[8:-3]+"motion")
return
motionDetectionPiMultiProcessing_COM_LiveFeed.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录