How should I structure a video streaming web app?
I want a user to be able to create an account and upload a video to the site.
How should I structure this web app, how should I start thinking about the project, how should I store the videos, and what stack would you recommend for this project? How should I think about the front-end, the server, and the database?
The more detail, the better! Also, any code that people might give me or point me to would be greatly appreciated. I'm looking for code for the following:
user accounts uploading videos storing videos categorizing the videos upon upload displaying videos in thumbnail form I'm probably not thinking of some things, so anything I'm forgetting, please let me know! And remember, the more detail the better!开发者_运维知识库
I'd start by breaking it down into more manageable chunks.
- A python web framework to work in:
- Django
- Pylons
- Google App Engine (webapp)
- Video storage solution:
- Amazon S3
- Amazon CloudFront (for proper H.264 streaming instead of progressive download)
- Google Storage
- CacheFly
- Etc.
- Video metadata and thumbnail retrieval:
- FFmpeg
- Data storage solution:
- PostgreSQL
- MySQL
- MongoDB (if using Pylons)
You've asked for code samples of things like user accounts, but the frameworks listed provide helpful tutorials (Django, Pylons, App Engine) for the basics. If you are unable to adapt the concepts in their tutorials from their respective examples to a system for managing user accounts, I would suggest reading up on database design and architecture a bit first.
As for how you should think about the front-end, database, etc., that again tends to rely on the web framework you choose to go with. They all have their own conventions that you'll benefit from by adhering to.
My general suggestion would be for you to pick a web framework, then go through its various tutorials and user guides. You'll learn a lot about how the framework structures its files, how it prefers (or forces) its databases to be structured, etc. In doing so, you'll learn about a lot of the things you've asked for examples of — video categorization, relating images to videos, and so forth.
Because there are so many different options for you to go with, it is extremely hard to just provide a few samples of code that do some of the things you've asked for. The code would have to come with a list of pre-requisites, and would only lessen your ability to evaluate the various choices and pick the one that you feel will work best for you.
精彩评论