By Ingo
Hi all,
maybe someone can point me in the right direction. I have developed a Laravel PHP project which allows people to upload and watch large video files (as well as audio files). Those files are confident and specific to a group of users, i.e. they shall not be publicly accessible. For now, the PHP code takes care of the permissions as to who can upload a video for which group and who can watch a video. It’s also important that those videos can be streamed in a speedy fashion for the users who are authorized to watch them.
If I think about the traditional way, managing such files requires me to e.g. offer a “resume upload” function, ideally converting the file to the best format (MP4 or such) to conserve storage space, then storing the file in a file directory under a unique name, and finally offering it for download or viewing in the authorized user’s browser. But I’m not sure if this will scale and it seems very old school to handle it all in PHP.
I heard about Azure Media Services which might help with handling such large video files but I would like to try something like this on DO first (sensing better documentation and community support since I’m new to all this).
Here are my specific questions:
Ideally, I would like to use an endpoint which takes care of uploads (including resuming of uploads), compilation of the video files, naming them in a unique fashion, storing them, and streaming them. The only info I would require is the name of the file and a URL that can be given to the authorized user to watch the video.
Many thanks in advance!
Cheers, Ingo
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Which DO file storage can be recommended for storing and accessing large video files (several GB per file and easily quite a few TB overall)?
DigitalOcean Spaces https://www.digitalocean.com/products/spaces/
I would assume that they log in to my PHP app, and then start uploading from there (do I need to build in upload resume functions in case of network interruptions?). In the background, the file gets a unique name and is being sent to storage or (ideally) gets processed first into a uniform video file format (such as MP4 or something)…?
Yes. You’ll need to build resume functionality. No idea the complexity of implementing such a feature, but I believe it’s something you’ll have to handle in your Laravel code. The logic of how that will happen, no idea.
Is the server-side handling of uploads a potential issue due to network bottlenecks or other limitations? How can I make sure that several users can upload large videos at the same time?
If you expect the number of uploads to be as big as YouTube today, then you’re gonna need YouTube’s kinda infrastructure and scale. Depending on your user base, you can always scale your backend server and performance, and increase your bandwidth demands accordingly on DigitalOcean.
Accordingly, how do I deliver files for streaming through my app?
DigitalOcean CDN https://www.digitalocean.com/community/tutorials/using-a-cdn-to-speed-up-static-content-delivery
Here’s how you can approach managing large video/audio uploads and streaming in your Laravel project using DigitalOcean:
DigitalOcean Spaces is a great option for storing large video files. Spaces is a scalable object storage solution that integrates with Laravel via the Flysystem adapter. Here’s why it’s suitable:
To integrate Spaces:
config/filesystems.php).To allow users to upload large files with resume capabilities:
Here’s a possible workflow:
Convert uploaded videos into a uniform format (e.g., MP4 for compatibility):
For simultaneous uploads:
To deliver secure streaming:
Upload:
Processing:
Streaming:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.