Skip to content

exploreshaifali/aws_s3_video_compress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

aws_s3_video_compress

A simple utility that allows to upload video on AWS Simple Storage Service(S3), provide specifications(video resolution and its audio frequency) to compress video and store compressed video as well on S3 such that next who want to see the video will able to download the compressed videos.

It uses postgreSQL as database, AWS S3 to store videos, ffmpeg to compress videos and redis for caching compress task.

##How it works?

  1. User upload video and provide specifications to compress it.
  2. Uncompressed video get saved on S3.
  3. At the same time it also get save on server disk.
  4. After that a task(that contain specification given by user, video name and primary key of above stored object) is send to queue(amqp) to compress video .
  5. Video gets compress using ffmpeg library.
  6. Lastly compressed video gets saved on S3 and same object is updated in database.

##Setup for developers

  1. Make sure you have installed Python 2.7.6, pip and virtualenv.
  2. Make sure you have PostgreSQL, Redis, ffmpeg installed.
  3. Make sure you have a bucket on AWS S3 and keys to access it.
  4. Clone the repo -https://github.com/exploreshaifali/aws_s3_video_compress.git and cd into the aws_s3_video_compress directory.
  5. Create a virtual environment with Python 2 and install dependencies:
$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
  1. Create video_compress_db database, where video_compress_db might be any suitable name.
  2. Fill in the database details in aws_s3_video_compress/settings.py.
  3. Run export SECRET_KEY=foobarbaz in your terminal, ideally the secret key should be 40 characters long, unique and unpredictable. Optionally to set the shell variable every time you activate the virtualenv, edit venv/bin/activate and add to the bottom the export statement.
  4. Similarly set DEFAULT_FILE_STORAGE, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_STORAGE_BUCKET_NAME for your AWS S3 in aws_s3_video_compress/settings.py and update BROKER_URL, CELERY_RESULT_BACKEND for django-celery. Default celery settings will be 'redis://127.0.0.1:6379/0' .
  5. Run python manage.py migrate.
  6. Run python manage.py createsuperuser to create a superuser for the admin panel. Fill in the details asked.
  7. Run python manage.py runserver to start the development server.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published