I want to start a website in which there are some videos. When I searched Google regarding this video website I came to know that for the proper working of the videos we should compress the videos. When I searched further I came to know about bitrate, codec etc etc which I didn't understand.

How to compress the videos for website? How YouTube compresses videos? What are the technologies do we need to know to compress a video? What kind of people do I need to hire to compress videos?

  • 2
    You need to provide more information. Are you hosting the site yourself? What browsers, devices, and players are you required to support? Why not just upload to a video service like YouTube and embed that?
    – llogan
    Sep 9, 2015 at 20:52

1 Answer 1


I recommend not to host the video files on your web server, but to upload them to YouTube and only embed the YouTube link on your web page. You can even define that your videos won't show up on searches, but are only served when using the link (from your website).

The reason is that these videos add significant load to your web server and bandwidth. And if something goes wrong (like providing the wrong codec), then your users won't see any video at all.

But if you really want to do it, you can even take YouTube as measurement. Upload an HD video and then download the various videos that YouTube has generated from that source.

I use this tool, but there may be others for different browsers:

You will see that YouTube offers a combination of different resolutions and different codecs. There is quite a complex logic behind which files to serve to which browsers. For ex. a small resolution will be served to mobile phones, but a bigger one to desktops depending on their screen resolution. Older browsers may need one codec, whereas modern ones accept others. YouTube does all that logic for you. But if you want to host the videos by yourself, you have to implement that logic as well.

You need then a tool like ffmpeg to convert your videos to these different formats and resolutions. Or, if you are lazy, just use the videos that you downloaded from YouTube, since they have the formats that you want.

Finally, you have to embed these videos on your web page. Here's the HTML video tag that you have to use. It's the new HTML5 standard, so older browsers don't support it.

As you have seen, these steps may mean a lot of work. That's why uploading to YouTube and embedding that link to your web page is the better choice.

Sorry that I didn't cover these steps in detail. This is just an overview.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.