FLVio MediaKit - Adjusting Video Dimensions
Overview
This document describes how to adjust the dimensions (width/height) of videos produced by the FLVio MediaKit API.
Box Size
FLVio attempts to maintain the aspect ratio of videos. By default, videos are resized to fit within a size of 320x240. This doesn't mean that videos are resized to 320x240 exactly, as doing so may warp the shape of the video (by changing the original aspect ratio). Instead, videos are resized to fit within an imaginary 320x240 box.
This is why video dimension adjustments are specified as "box size", where the "box width" and "box height" are the adjustable parameters. Videos will be resized to fit within the specified box size, keeping the original aspect ratio intact.
It is common to use the dimensions of the video player that will be used for video playback as the box size. That way, the video is optimally sized for the player.
Specifying Dimensions
Videos are uploaded to FLVio using PUT to create or update a resource. For example:
PUT https://mediakit.flvio.com/api/v1/media/123
By default, the box size is 320x240. So videos are resized to fit within a 320x240 box (maintaining the original aspect ratio).
A custom box size can be specified using two HTTP headers in the PUT request:
X-Flvio-Encodeparam-Boxwidth X-Flvio-Encodeparam-Boxheight
The headers specify the custom "box width" and "box height" that the resized video must fit within.
For example, making a request such as:
PUT https://mediakit.flvio.com/api/v1/media/123
With these headers included:
X-Flvio-Encodeparam-Boxwidth: 640 X-Flvio-Encodeparam-Boxheight: 480
Will upload a video with a custom box size of 640x480. That is, the video will be resized to the largest dimensions possible that still fit within a 640x480 box while maintaining the original aspect ratio.
| Updated: | 2008-08-26 |
|---|---|
| Version: | 1.0.0 |
| Copyright: | Locayta LTD 2008. All rights reserved. |