Skip to content

Commit

Permalink
Worked on StabVideo more
Browse files Browse the repository at this point in the history
- Added libraries to gitignore
- Created a lightweight version of vidstab at
  gh://RobRoseKnows/python_video_stab.
- Removed non-free algorithms from the template.yaml
- Added code to download and upload the video to/from buckets in
  lambda_function.py.
  • Loading branch information
RobRoseKnows committed Sep 16, 2018
1 parent 817ff94 commit ecbc860
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 5 additions & 0 deletions stabVideo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
*.egg-info/
*.dist-info/
cv2/
numpy/
imutils/
vidstab/
bin/
5 changes: 3 additions & 2 deletions stabVideo/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def lambda_handler(event, context):
raise VIDSTAB_ERROR

try:

in_path = download_file(bucket, key)
out_path = "/tmp/out_{}".format(key)
head_response = s3.head_object(Bucket=bucket, Key=key)
size = head_response['ContentLength']
content_type = head_response['ContentType']
Expand All @@ -78,7 +79,7 @@ def lambda_handler(event, context):
stabilizer.stabilize(input_path=in_path,
output_path=out_path,
border_type=BORDER_TYPE)

return upload_file(OUTPUT_BUCKET, key, out_path)
else:
raise IOError("Object {} from bucket {} ".format(key, bucket) +
"is not a video.")
Expand Down
5 changes: 1 addition & 4 deletions stabVideo/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ Parameters:
- HARRIS
- MSER
- ORB
- SIFT
- SURF
- STAR
Description: Which method
Resources:
Expand Down Expand Up @@ -56,8 +54,7 @@ Resources:
ObjectCreatedBucketEvent:
Type: S3
Properties:
Bucket:
Ref: WatchBucket
Bucket: !Ref WatchBucket
Events:
- 's3:ObjectCreated:*'

Expand Down

0 comments on commit ecbc860

Please sign in to comment.