Recently a friend asked me how to reduce the size of a YouTube video to post on his blog, so I did a little research and gave him a solution! Depending on the video that has been uploaded to YouTube, the video width and height are set to a certain default. For example, for most HD videos, the width is 560 pixels and the height is 315 pixels.
If you want to quickly resize a video for posting to your blog, website, or social network, this is a fairly simple process. Previously, you had to manually edit the embed code provided by YouTube to adjust the video size. YouTube now lets you choose from a set of predefined sizes or choose your own size.
The first thing you need to do is search YouTube for the actual video you want to scale down. Then click the Share link and click Embed if not already selected.
The code will look something like this:
You will notice the values ??WIDTH and HEIGHT in the code. In general, the embed code is very easy to understand. You have a width and height, a src tag, which is the URL of the YouTube video, a frame value, and an option to allow the video to play full screen. There are other options besides these, but this is the main embed code.
You can paste this code into any text editor of your choice, such as Notepad, and manually change the width and height settings, but then you have to take care of maintaining the aspect ratio yourself. Instead of worrying about it, you can simply use the Custom size option and it will do the calculations for you.
For example, just enter the width and press the Tab key. The height value will be automatically calculated and filled in. You can also enter a height value and the width value will be adjusted in the actual embed code. For some strange reason, the width field does not change values, which could be an error.
Obviously, you can shrink the YouTube video size, or enlarge it if you like. If the video was shot in HD (1080, 720), you can increase the size and you won’t lose any quality. That’s all! Indeed, it is very easy to make the video smaller. Now let’s look at the options:
1. Show recommended videos when the video ends – this is self-explanatory. If you just want to play the video and stop when it finishes, clear this checkbox.
2. Use HTTPS. If you embed a YouTube video on a site that uses a secure connection (SSL / HTTPS), you also have the option to use HTTPS in the embed code.
3. Enable Privacy Enhanced Mode – By default, YouTube can collect information about every visitor who visits a page that has a YouTube video embedded. By checking this box, they will only be able to collect information about visitors to your site who actually play the video.
4. Use the old embed code – Ugh, I have no idea why you need this. The old embed code relied on the OBJECT tag and required Flash to play. The new embed code uses the IFRAME tag and supports HTML 5 video in addition to Flash.
These are visible options, but there are also a few hidden options to customize your video even more. If you want, you can turn on the automatic play of YouTube videos when the user visits the page. Just add? Autoplay = 1 at the end of the url in the src part of the embed code:
Nicely! You can also choose to start the video at a specific time by adding # t = 1m30s to the end of the src url:
As you can see from the above, different parameters can be combined. In the above example, I have a video autoplaying and I check that it starts 1 minute 30 seconds after the video starts.
There are probably other secret parameters that you can pass into inline code, but the above items will work for most people. Reducing the size of a YouTube video is a breeze with new built-in code that will now also work in most modern browsers without Flash. Enjoy!