Playing videos through S3 buckets (Wasabi, AWS, etc.) through client-side VideoJS player without incurring ingress/egree traffic on EC2 Instance.
Found plex as a solution, you've to install it, do local syncing using SSH tunnel, login with an account, create a local sync between the S3 bucket and the server hosting the solution. Plex also first downloads those files at server-side and then passes those to the user, this incurs both ingress and egress traffic cost. Other than that, S3 costs for downloading as well.
This script simply just establishes a connection with the bucket, lists objects and then plays the video at client-side (rather than downloading on server-side first). So no *additional ingress/egress cost for the application on EC2 server! Just the
S3 bucket as desired!
Tested On (OS & Python version)
- Ubuntu 20.04 LTS -- Python 3.8.5
- Windows 10 -- Python 3.9.5
- WSL [Ubuntu 20.04] -- Python 3.8.5
Downloading & Installation
Fill in the config.json file before running the script!
git clone https://github.com/Anon-Exploiter/S3VideoStreamer/ && \ cd S3VideoStreamer/ && \ pip3 install -r requirements.txt && \ python3 app.py runserver
authenticationfor public hosting
- Add public usage with
--no-sign-methodequivalent so public buckets can be used
- Make the application dynamic so bucket name and other information can be filled directly without
Make sure you know what service you're using and what it costs! AWS S3 costs a lot for transfer!!! Go with
Wasabi or some other
Feel free to file a issue or create a PR for that issue if you come across any.