Video Optimization API
Overview
The Video Optimization API is a RESTful API that allows you to optimize videos for the web. The API can be used to convert videos to different formats, resize videos, and extract thumbnails from videos.
File Size Limit in Free version of Femto API
Currently we have file size limit of 128MB. Larger file optimization is coming soon. Till then you can check Femto Desktop App for limitless file optimization.
Endpoint
Request
- Method :
POST
- URL :
https://api.femto.cypherx.in/optimize-video
- Headers
Authorization: Bearer YOUR_API_KEY
Content-Type: multipart/form-data
- Body
level: "default" | "turbo" | "ultra"
- Default :
"default"
(Recommended for balanced mix of size & quality and universel playable format). - “turbo” is for higher compression with minor visual loss of quality & universel playable format.
- “ultra” is the most advanced format with higher compression and quality with popular media plyer support (vlc, kmplayer, web browsers etc ).
- Description : The level of optimization to be performed on the video. The default level is
"default"
. The"ultra"
level performs more aggressive optimization on the video, but it may take more time to process. - Example :
level: "ultra"
- Default :
Request Body
- Form Data
- Key :
video
- Type :
File
- Description : The video file to be optimized.
- Value : Binary Video Data
- Type :
- Key :
The maximum allowed Video size is 200 MB. And the supported video formats are: mp4
, webm
, mov
, avi
, flv
, wmv
, mkv
, m4v
.
Response
- Status Code :
200 OK
- Headers
Content-Type: video/YOUR_VIDEO_FORMAT
Response Body
- Value : Binary video Data
Error Response
-
Status Code :
400 Bad Request
- Headers
Content-Type: text/plain
- Body :
File type not supported
- Headers
-
Status Code :
401 Unauthorized
- Headers
Content-Type: application/json
- Body
- Headers
-
Status Code :
413 Payload Too Large
- Headers
Content-Type: application/json
- Body
- Headers
-
Status Code :
500 Internal Server Error
- Headers
Content-Type: text/plain
- Body :
Internal Server Error
- Headers
Request Examples
Here are some sample requests in different programming languages.
cURL
The optimized video will be saved in the current directory with the name optimized_video.mp4
.
JavaScript
In Node.js
- Install the
axios
andform-data
packages.
In Browser
Python
- Install the
requests
package.