How to make your own YouTube with FFlib.NET (I.)

Hi programmers, web developers, designers etc. A few day  ago we released for you very first version of FFlib.NET. Now we are going to show you, how to use this library to make your own video conversion site like Youtube, DailyMotion or Metacafe. So …

Let’s start!

If you are planning to make your video server, the first step is to define the application structure of your video website. If you have already been concerned with video applications, you know that you need:

  • an frontend to display videos to your users
  • an backend with video conversion service and video files storage

Easy? Yes and No. Of course, for a really big website you will need much more. These are only the basic requirements for your video website. For a bigger site you will more more resources. For example - dedicated database server(s), a farm of file storage servers and maybe more than one dedicated server for video conversion service. But, for a simple video server you can use only one server for frontend and backend.

Basic architecture scheme for an good video website

As you know, for your own video server you can use a lot of options, but we can show you one of our recommend schemes to design your video site. The picture below shows this scheme:

So, the basic description for this solution is:

  • Frontend server for serving website and for streaming video files to client. This server is running on linux with web server, we recommend nginx web server for its small memory requirements, great support for video streaming and excellent speed. The server also serves an database engine for website to store users and application data.
  • Backend server 1 for video conversion service, runing on Windows with IIS web server, NET 2.0 framework and database engine for job queue.
  • Backend 2 (and more) for video files storage, an storage farm.

As we told above, this is only one of the options of video server with good performance. But if you want make a serious video server like YouTube, you will need much more :). For inspiration, look at “YouTube Architecture” on HighScalability.com. So, what next?

How it works?

The solution suggested above uses 3 servers. The client is using frontend server, where is a website for your video server. When user uploads a video file to server, application on frontend server sends this video file to storage backend server and makes an request to video conversion backend server to tell our conversion application to convert this new file. Our conversion application on dedicated backend server then adds this request to conversion queue and then converts video files from queue. When conversion is done, converted video is stored back to storage server and conversion server sends an request to frontend application to make an flag in database, that video is ready for streaming. Easy :)

FFlib.NET

Now we have the know-how, so this is the time for our FFlib.NET implementation.

Because we want our video server functional ASAP and we do not want spend time and money for 3 or more servers, we will create our sample video application for single server. So, the essentials are:

  • make an page for displaying video in flash player
  • make an page for upload video file to start conversion
  • based on ASP.NET 2.0
  • we don’t make any queue for video conversion, so only one file at same time can be converted

Now, we have specification … but for results you must wait to the next post :). Until then you can download your copy of FFlib.NET and try our sample application included in our distribution package.


Digg this story!

Comments

Comments are closed

About Us

FFlib.NET is an FFMPEG based .NET c# library for video conversion services and applications. You can use it for free.
FFlib is developed by SOFTPAE.com, an excelent webdesign and development company from Slovakia.

Recent posts

Recent comments

Sponsored Links