Our JavaScript webcam recorder and video uploader API allows website publishers to collect video files and webcam recordings from their visitors. Before uploading these videos to one of the supported destinations (such as Cloud storage services, end user Cloud drives, social networks, etc.), the Clipchamp API compresses the videos.

While doing so, it converts videos into a publisher-picked output video format, such as

  • MP4,
  • WebM,
  • ASF/WMV,
  • Flash video (FLV) or
  • (animated) GIF.

This article describes the purpose of the different formats, which can be selected in the "format" parameter - see the Clipchamp API documentation page.

Generally, when selecting a video format, two distinct settings are automatically chosen:

  • The container format, which is essentially a file format to accommodate video and audio streams (also: subtitles, further stream types, and other types of video metadata). Container formats are often associated with specific file extensions such as .mp4 for MP4, .mov for Quicktime, .webm for WebM, .asf for Microsoft's "Advanced Streaming Format", or .avi for the (legacy) "Audio/Video Interleave" format. 
  • The audio and video codecs, which are standards for compressing an audio waveform or sequences of video frames. After a wide variety of (now legacy) codecs were in use in the 1990s and early 2000s (think of Cinepak, Sorenson, Indeo and many more), recent years have popularized a few codecs such as the H.264 ("Advanced Video Coding", AVC), H.265 ("High Efficiency Video Coding", HEVC), the VPx family (VP8, VP9 and the emerging VP10) of video codecs; and the AAC ("Advanced Audio Coding"), MP3, Opus and Vorbis audio codecs. Other codecs are largely confined to professional applications and legacy formats.

 

MP4

MP4 (formally known as MPEG-4, part 14) is the leading video format, supported by all major browsers through the HTML5 <video> tag. While technically a container format, MP4 files typically contain H.264-encoded video streams (also known as "Advanced Video Coding") and AAC-encoded audio streams.

Most conveniently, MP4 files produced by the Clipchamp API are streaming friendly, supporting progressive download/playback. This means that video players (such as the HTML5 <video> tag) are able to start video playback after only a small chunk of data is loaded from the server and before the entire video file is downloaded. While playback of the video continues, more data is progressively obtained from the server.

This capability of the Clipchamp API matters a lot when you want to allow playing back uploaded videos directly from a supported upload destination such as AWS S3 or Microsoft Azure. This does dramatically simplify your backend architecture, where you do not need a dedicated streaming server to support progressive download/playback.

The "mp4" format parameter is the default choice when you do not specify any other format in the Clipchamp API. You should choose "mp4" whenever compatibility with modern players (web browsers through the <video> tag, video players built into smartphones, etc.) is the determining concern for your choice.

 

FLV (Flash video)

Before the rise of HTML5 video, most video players were based on the Adobe Flash browser plugin, which has inbuilt support for playing back video. After the open-source Firefox browser gained MP4 (H.264/AAC) playback support, few reasons remain to use Flash-based players.

We do nevertheless make the "flv" format available to website publishers, thus producing video files in the (legacy) Flash video format (not to be confused with the F4V format, which is a variant of MP4 for Flash-based video players), using the same H.264 and AAC video and audio codecs, where H.264 video is supported by the newer versions of the Flash plugin and delivers much better compression than legacy video codecs (such as H.263 and Sorenson Spark) that were formerly in popular use in .flv files.

 

WebM

WebM ("Web Media") is a variant of the Matroska file format, confined to the capabilities that are needed for playback of video on the Web. WebM is commonly used with the VPx family of video codecs that Google bought when acquiring On2 technologies (and then continued progressing them).

VP8, VP9, and the upcoming VP10 video codec are regarded as viable competitors to the H.26x codecs, where VP8 delivers roughly the same compression as H.264 (AVC), while VP9's niche is Ultra-HD (4K) content, where one would otherwise employ H.265 (HEVC).

The reason for VP8 & VP9 to exist is the fact that a number of patent holders regularly claim license fees from any third party building H.264 and H.265 encoding and decoding devices. While the legal basis for their claims remains in dispute, Google has done the world a great service in waiving all patent license fees for VP8 and VP9.

VP8 and VP9 are often combined with the open source Audio codecs Vorbis and Opus. When selecting the "webm" format, the Clipchamp API will produce a WebM file, containing VP8-encoded video streams andVorbis-encoded audio streams. Future releases of the Clipchamp API will add VP9/Opus support for better compression and Ultra HD (4K) video resolution.

A WebM file as produced by the Clipchamp API will natively play back in some browsers, notably Chrome, Firefox, and Opera. Microsoft has announced WebM/VP9 support for its new Edge browser (although it is unclear whether VP8 will also be supported). Reasonably new Android releases will also support WebM-encoded video files, iOS does not support WebM natively and requires 3rd party apps for playback.

 

ASF

ASF ("Advanced System's Format", formerly known as "Advanced Streaming Format" and "Active Streaming Format") is Microsoft's proprietary container format for video files that are natively supported in Microsoft products, notably Microsoft Windows and Microsoft Office. While MP4 support was later added, embedding MP4 videos into Microsoft Powerpoint slideshows is still hampered by compatibility issues.

The Clipchamp API uses the Windows Media Video 8 (WMV2) video codec and the Windows Media Audio 2(WMA2) audio codec. To produce .asf files with these settings, use the "asf" format parameter. You should only choose ASF whenever the aforementioned constraints (compatibility with Microsoft Office products) is the key concern. We don't recommend to use ASF to distribute video files over the web.

 

GIF

GIF ("Graphics Exchange Format") is technically an image format that offered the first cross-browser option to display simple animations. You might remember this particular example. While these days, HTML5 video provides the better option to embed video into websites in most circumstances, we nevertheless added the "gif" format option to produce legacy animated GIF image files. Being an image file format, no audio streams are included.

Did this answer your question?