SpyreStudios

Web Design and Development Magazine

  • Design
  • Resources
  • Showcase
  • Inspirational
  • Tutorials
  • CSS
  • Resources
  • Tools
  • UX
  • More
    • Mobile
    • Usability
    • HTML5
    • Business
    • Freebies
    • Giveaway
    • About SpyreStudios
    • Advertise On SpyreStudios
    • Get In Touch With Us

How to Compress Video For Online Streaming

December 10, 2018 by Alex Fox

Depending on where you’re uploading your video content, you’ll need to find the correct file settings to get the right result.

Choosing a container format

Source

A video container format is a digital wrapper for your content. They determine the extension of your video file. Popular container formats include MP4 (.mp4), AVI (.avi), QuickTime (.mov) and Matroska (.mkv).

The different container formats all have different strengths and weaknesses, with certain formats preferred by certain content providers. The container itself doesn’t effect the quality of the video directly, but it can limit the compression codecs available for use.

If you’re choosing a container format to use for an encoded video, you’ll want to pick one that has the right mix of supported compression codecs and features. For web playback, this typically means we’ll want to use mp4. It’s a flexible, universally-accessible codec that combines strong compression capability and a laundry list of options.

Choosing a codec

Compression codecs are the algorithms used to compress digital video for distribution. They’re essentially invisible to the viewer. There are dozens in existence, but only a handful are widely used.

Your choice of codec determines both your video’s size and quality. You’ll want to choose a codec that balances size and quality, with a small emphasis on size for web streaming.

With MP4, the most common codec is H.264. While H.265 has been released and is gradually spreading through the industry, it won’t have the widespread compatibility of H.264 for some years yet. It also turns out that H.264 is a quality codec. So, if you have no idea what to do, MP4/H.264 will work for nearly any content.

H.264 is a powerful compression codec designed specifically for digital HD video, achieving a good mix of quality of space savings. H.264 playback is nearly universally supported, from DSLR video to embedded playback. While it doesn’t do as well with 4K video or unusual color depths, it provides the right balance for standard web videos.

If you’re trying to upload a clip that requires the highest available quality, then we should throw away concerns about space and stick with professional codecs. These make enormous files with require significant upload and download files, but when quality is a must, there’s simply no getting around it. Professional codecs like ProRes 422 and the MOV container format will produce the highest-quality (and largest) video files.

The quality of a codec is revealed by its bitrate. Expressed in Mbps or Kbps, this describes how large each second of video can be. The higher the bitrate, the higher the potential quality. This won’t ever increase the quality of the video, but a high bitrate will prevent the quality from decreasing. In general, you won’t want to encode higher than 50 Mbps. Something like 5 Mbps is common in streaming video, but you’ll want to test various bitrates with your content.

Plenty of video sharing websites compress video when uploaded. YouTube is one such platform. On upload, it transcodes your video to either H.264 or V9, better known as WebM. It might seem that such transcoding eliminates the need for compression before upload, or means that your compression choice at this stage is meaningless. That’s not exactly true, however. The better the quality of the video you upload, the better the quality of the video on playback.

When working with YouTube, it’s best to upload the largest practical video size. YouTube will handle downscaling based on user settings, so just provide the maximum quality possible and let YouTube sort it out.

Important Export Settings

Source

There are few settings you’ll want to optimize, like the following:

  • Resolution: Set the correct resolution for your use case. You will probably want to export at full resolution. If you want to reduce it, make sure that you don’t accidentally change the aspect ratio when adjusting the resolution. Using a scale multiplier is typically a good choice.
  • Progressive Encoding: Avoid options for “interlaced” encoding. This is an old method of HD video encoding which is no longer necessary or supported. Make sure to choose a progressive setting, which will likely have a “p” at the end of its resolution: 1080p, 720p, and so on. If you don’t see the options for interlaced exporting, don’t worry about it.
  • Pixel Aspect Ratio: Always set to “square.” Changing the dimensions of the pixels will not play nicely with most playback settings.
  • Bitrate: Controls the maximum data size of each second of video, should be kept at a moderate balance between 5 and 50 Mbps. Test with your content to determine the best balance between file size and video quality.
  • Frame rate: This measurement is determined by the source video. Depending on the device you recorded the video with, you’ll see different frame rate settings. If you don’t know what the setting for frame rate should be, match it to the source video’s frame rate, which can be found with VLC.

Apps for Encoding Videos

To figure out the right compression, use your eyes! They’re the best determinant of what is and is not acceptable. Consider your audience, your streaming platform, and the quality of the clips you recorded. Higher quality is not always strictly better.

Video files can be encoded with a huge variety of software packages. On Windows, FreeMake Video Compressor provides a large range of compression formats and a simple workflow. On macOS, free, open-source tools like MPEG Streamclip or the command-line ffmpeg. You’ll also find basic video compression tools in the macOS Finder. The same open-source tools are available on Linux.

Generally, the best tool for the job is the one that is easiest to use. In most cases, that will be the software you’re using to edit the video. Regardless of software, there will be various options for export.

Filed Under: Tutorial Tagged With: video, video compression, video editing

Recent Posts

  • How to Choose a Stunning Font Package for Your Brand
  • 31 Fresh Design Elements for Spring and Easter
  • 10 Templates for Music Concert Flyers
  • How to Build a Web Scraper Using Node.js
  • Best PHP Books, Courses and Tutorials in 2022

Archives

  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • May 2008
  • April 2008

Categories

  • Accessibility
  • Android
  • Apps
  • Art
  • Article
  • Blogging
  • Books
  • Bootstrap
  • Business
  • CSS
  • Design
  • Development
  • Ecommerce
  • Fireworks
  • Flash
  • Freebies
  • Freelance
  • General
  • Giveaway
  • Graphic Design
  • HTML5
  • Icons
  • Illustrator
  • InDesign
  • Infographics
  • Inspirational
  • Interview
  • Jobs
  • jQuery
  • Learning
  • Logos
  • Matrix
  • Minimalism
  • Mobile
  • Motion Graphics
  • Music
  • News
  • Photoshop
  • PHP
  • Promoted
  • Rails
  • Resources
  • Showcase
  • Tools
  • Tutorial
  • Twitter
  • Typography
  • Uncategorized
  • Usability
  • UX
  • Wallpapers
  • Wireframing
  • WordPress
  • Work

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

SpyreStudios © 2022