Video and Media Services API API Reference

The video APIs help you convert, encode, and transcode videos.

Swagger OpenAPI Specification | .NET Framework Client | .NET Core Client | Java Client | Node.JS Client | Python Client | Drupal Client

API Endpoint
https://api.cloudmersive.com
Schemes: https
Version: v1

Authentication

Apikey

API Key Authentication

type
apiKey
name
Apikey
in
header

Audio

Convert Audio File to MP3 format.

POST /audio/convert/to/mp3


Automatically detect audio file format and convert it to MP3 format. Supports many input audio formats, including AAC, FLAC, M4A, MP2, MP3, OGG, WMA, and WAV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of an audio file being used for conversion. Use this option for files larger than 2GB.

bitRate: int
in header

Optional; Specify the desired bitrate of the converted audio file in kilobytes per second (kB/s). Value may be between 48 and 1,411. By default, the optimal bitrate will be chosen automatically.

Code Example:
200 OK

OK

type
string (byte)
Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
"string (byte)"

Convert Audio File to M4A format.

POST /audio/convert/to/m4a


Automatically detect audio file format and convert it to M4A format. Supports many input audio formats, including AAC, FLAC, M4A, MP2, MP3, OGG, WMA, and WAV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of an audio file being used for conversion. Use this option for files larger than 2GB.

bitRate: int
in header

Optional; Specify the desired bitrate of the converted audio file in kilobytes per second (kB/s). Value may be between 48 and 1,411. By default, the optimal bitrate will be chosen automatically.

Code Example:
200 OK

OK

type
string (byte)
Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
"string (byte)"

Convert Audio File to AAC format.

POST /audio/convert/to/aac


Automatically detect audio file format and convert it to AAC format. Supports many input audio formats, including AAC, FLAC, M4A, MP2, MP3, OGG, WMA, and WAV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of an audio file being used for conversion. Use this option for files larger than 2GB.

bitRate: int
in header

Optional; Specify the desired bitrate of the converted audio file in kilobytes per second (kB/s). Value may be between 48 and 1,411. By default, the optimal bitrate will be chosen automatically.

Code Example:
200 OK

OK

type
string (byte)
Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
"string (byte)"

Convert Audio File to WAV format.

POST /audio/convert/to/wav


Automatically detect audio file format and convert it to WAV format. Supports many input audio formats, including AAC, FLAC, M4A, MP2, MP3, OGG, WMA, and WAV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of an audio file being used for conversion. Use this option for files larger than 2GB.

sampleRate: double
in header

Optional; Specify the desired sample rate of the converted audio file in kHz. Value may be between 8 and 96. Standard for audio CDs is 44.1, while DVD audio standard is 48. By default, the optimal sample rate will be chosen automatically.

Code Example:
200 OK

OK

type
string (byte)
Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
"string (byte)"

Video

Get detailed information about a video or audio file

POST /video/convert/get-info


Retrieve detailed information about a video or audio file, including format, dimensions, file size, bit rate, duration and start time. Compatible with many formats, including: AVI, ASF, FLV, GIF, MP4, MPEG/MPG, Matroska/WEBM, MOV, AIFF, ASF, CAF, MP3, MP2, MP1, Ogg, OMG/OMA, and WAV. Uses 1 API call per 10 MB of file size.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of a video file being used for conversion. Use this option for files larger than 2GB.

Code Example:

OK

Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
{
  "Successful": "boolean",
  "FileFormat": "string",
  "FileFormatFull": "string",
  "ValidFileFormats": [
    "string"
  ],
  "Width": "integer (int32)",
  "Height": "integer (int32)",
  "Size": "integer (int32)",
  "BitRate": "integer (int32)",
  "Duration": "number (double)",
  "StartTime": "number (double)"
}

Convert Video to WEBM format.

POST /video/convert/to/webm


Automatically detect video file format and convert it to WEBM format. Supports many input video formats, including AVI, ASF, FLV, MP4, MPEG/MPG, Matroska/WEBM, 3G2, OGV, MKV, M4V and MOV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of a video file being used for conversion. Use this option for files larger than 2GB.

maxWidth: integer
in header

Optional; Maximum width of the output video, up to the original video width. Defaults to original video width.

maxHeight: integer
in header

Optional; Maximum height of the output video, up to the original video width. Defaults to original video height.

preserveAspectRatio: boolean
in header

Optional; If false, the original video's aspect ratio will not be preserved, allowing customization of the aspect ratio using maxWidth and maxHeight, potentially skewing the video. Default is true.

frameRate: integer
in header

Optional; Specify the frame rate of the output video. Defaults to original video frame rate.

quality: integer
in header

Optional; Specify the quality of the output video, where 100 is lossless and 1 is the lowest possible quality with highest compression. Default is 50.

Code Example:
200 OK

OK

type
string (byte)
Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
"string (byte)"

Convert Video to MOV format.

POST /video/convert/to/mov


Automatically detect video file format and convert it to MOV format. Supports many input video formats, including AVI, ASF, FLV, MP4, MPEG/MPG, Matroska/WEBM, 3G2, OGV, MKV, M4V and MOV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of a video file being used for conversion. Use this option for files larger than 2GB.

maxWidth: integer
in header

Optional; Maximum width of the output video, up to the original video width. Defaults to original video width.

maxHeight: integer
in header

Optional; Maximum height of the output video, up to the original video width. Defaults to original video height.

preserveAspectRatio: boolean
in header

Optional; If false, the original video's aspect ratio will not be preserved, allowing customization of the aspect ratio using maxWidth and maxHeight, potentially skewing the video. Default is true.

frameRate: integer
in header

Optional; Specify the frame rate of the output video. Defaults to original video frame rate.

quality: integer
in header

Optional; Specify the quality of the output video, where 100 is lossless and 1 is the lowest possible quality with highest compression. Default is 50.

Code Example:
200 OK

OK

type
string (byte)
Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
"string (byte)"

Convert Video to MP4 format.

POST /video/convert/to/mp4


Automatically detect video file format and convert it to MP4 format. Supports many input video formats, including AVI, ASF, FLV, MP4, MPEG/MPG, Matroska/WEBM, 3G2, OGV, MKV, M4V and MOV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of a video file being used for conversion. Use this option for files larger than 2GB.

maxWidth: integer
in header

Optional; Maximum width of the output video, up to the original video width. Defaults to original video width.

maxHeight: integer
in header

Optional; Maximum height of the output video, up to the original video width. Defaults to original video height.

preserveAspectRatio: boolean
in header

Optional; If false, the original video's aspect ratio will not be preserved, allowing customization of the aspect ratio using maxWidth and maxHeight, potentially skewing the video. Default is true.

frameRate: integer
in header

Optional; Specify the frame rate of the output video. Defaults to original video frame rate.

quality: integer
in header

Optional; Specify the quality of the output video, where 100 is lossless and 1 is the lowest possible quality with highest compression. Default is 50.

Code Example:
200 OK

OK

type
string (byte)
Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
"string (byte)"

Convert Video to Animated GIF format.

POST /video/convert/to/gif


Automatically detect video file format and convert it to animated GIF format. Supports many input video formats, including AVI, ASF, FLV, MP4, MPEG/MPG, Matroska/WEBM, 3G2, OGV, MKV, M4V and MOV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB. Default height is 250 pixels, while preserving the video's aspect ratio.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of a video file being used for conversion. Use this option for files larger than 2GB.

maxWidth: integer
in header

Optional; Maximum width of the output video, up to the original video width. Defaults to 250 pixels, maximum is 500 pixels.

maxHeight: integer
in header

Optional; Maximum height of the output video, up to the original video width. Defaults to 250 pixels, maximum is 500 pixels.

preserveAspectRatio: boolean
in header

Optional; If false, the original video's aspect ratio will not be preserved, allowing customization of the aspect ratio using maxWidth and maxHeight, potentially skewing the video. Default is true.

frameRate: integer
in header

Optional; Specify the frame rate of the output video. Defaults to 24 frames per second.

startTime: string (date-time)
in header

Optional; Specify the desired starting time of the GIF video in TimeSpan format.

timeSpan: string (date-time)
in header

Optional; Specify the desired length of the GIF video in TimeSpan format. Limit is 30 seconds. Default is 10 seconds.

Code Example:
200 OK

OK

type
string (byte)
Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
"string (byte)"

Resizes a Video Preserving the Original Aspect Ratio.

POST /video/resize/preserveAspectRatio


Resizes a video, while maintaining the original aspect ratio and encoding. Supports many input video formats, including AVI, ASF, FLV, MP4, MPEG/MPG, Matroska/WEBM, 3G2, MKV, M4V and MOV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of a video file being used for conversion. Use this option for files larger than 2GB.

maxWidth: integer
in header

Optional; Maximum width of the output video, up to the original video width. Defaults to original video width.

maxHeight: integer
in header

Optional; Maximum height of the output video, up to the original video width. Defaults to original video height.

frameRate: integer
in header

Optional; Specify the frame rate of the output video. Defaults to original video frame rate.

quality: integer
in header

Optional; Specify the quality of the output video, where 100 is lossless and 1 is the lowest possible quality with highest compression. Default is 50.

extension: string
in header

Optional; Specify the file extension of the input video. This is recommended when inputting a file directly, without a file name. If no file name is available and no extension is provided, the extension will be inferred from the file data, which may cause a different extension to be used in the output.

Code Example:
200 OK

OK

type
string (byte)
Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
"string (byte)"

Resizes a Video without Preserving Aspect Ratio.

POST /video/resize/target


Resizes a video without maintaining original aspect ratio, allowing fully customizable dimensions. May cause image skewing. Supports many input video formats, including AVI, ASF, FLV, MP4, MPEG/MPG, Matroska/WEBM, 3G2, MKV, M4V and MOV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of a video file being used for conversion. Use this option for files larger than 2GB.

maxWidth: integer
in header

Optional; Maximum width of the output video, up to the original video width. Defaults to original video width.

maxHeight: integer
in header

Optional; Maximum height of the output video, up to the original video width. Defaults to original video height.

frameRate: integer
in header

Optional; Specify the frame rate of the output video. Defaults to original video frame rate.

quality: integer
in header

Optional; Specify the quality of the output video, where 100 is lossless and 1 is the lowest possible quality with highest compression. Default is 50.

extension: string
in header

Optional; Specify the file extension of the input video. This is recommended when inputting a file directly, without a file name. If no file name is available and no extension is provided, the extension will be inferred from the file data, which may cause a different extension to be used in the output.

Code Example:
200 OK

OK

type
string (byte)
Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
"string (byte)"

Cut a Video to a Shorter Length

POST /video/cut


Cuts a video to the specified start and end times. Supports many input video formats, including AVI, ASF, FLV, MP4, MPEG/MPG, Matroska/WEBM, 3G2, MKV, M4V and MOV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of a video file being used for conversion. Use this option for files larger than 2GB.

startTime: string (date-time)
in header

Optional; Specify the desired starting time of the cut video in TimeSpan format.

timeSpan: string (date-time)
in header

Optional; Specify the desired length of the cut video in TimeSpan format. Leave blank to include the rest of the video. Maximum time is 4 hours.

Code Example:
200 OK

OK

type
string (byte)
Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
"string (byte)"

Split a Video into Two Shorter Videos

POST /video/split


Cuts a video into two videos based on the specified start time. Supports many input video formats, including AVI, ASF, FLV, MP4, MPEG/MPG, Matroska/WEBM, 3G2, MKV, M4V and MOV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time. Maximum output file size is 50GB.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of a video file being used for conversion. Use this option for files larger than 2GB.

splitTime: string (date-time)
in header

Specify the desired time at which to split the video in TimeSpan format.

timeSpan: string (date-time)
in header

Optional; Specify the desired length of the second video in TimeSpan format. Leave blank to include the rest of the video. Maximum time is 4 hours.

Code Example:

OK

Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
{
  "Successful": "boolean",
  "Videos": [
    {
      "VideoNumber": "integer (int32)",
      "Content": "string (byte)"
    }
  ]
}

Convert Video to PNG Still Frames.

POST /video/convert/to/still-frames


Automatically detect video file format and convert it to an array of still frame PNG images. Supports many input video formats, including AVI, ASF, FLV, MP4, MPEG/MPG, Matroska/WEBM, 3G2, OGV, MKV, M4V and MOV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additional minute of processing time over 5 minutes, up to a maximum of 25 minutes total processing time.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of a video file being used for conversion. Use this option for files larger than 2GB.

maxWidth: integer
in header

Optional; Maximum width of the output video, up to the original video width. Defaults to original video width.

maxHeight: integer
in header

Optional; Maximum height of the output video, up to the original video width. Defaults to original video height.

framesPerSecond: double
in header

Optional; How many video frames per second to be returned as PNG images. Minimum value is 0.1, maximum is 60. Default is 1 frame per second. Maximum of 2000 total frames.

Code Example:

OK

Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
{
  "Successful": "boolean",
  "TotalFrames": "integer (int32)",
  "StillFrames": [
    {
      "FrameNumber": "integer (int32)",
      "TimeStamp": "string",
      "Content": "string (byte)"
    }
  ]
}

Scan a Video for NSFW content.

POST /video/scan/nsfw


Automatically detect video file format and scan it for Not Safe For Work (NSFW)/Porn/Racy content. Supports many input video formats, including AVI, ASF, FLV, MP4, MPEG/MPG, Matroska/WEBM, 3G2, OGV, MKV, M4V and MOV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per frame scanned.



inputFile: file
in formData

Input file to perform the operation on.

fileUrl: string
in header

Optional; URL of a video file being scanned. Use this option for files larger than 2GB.

framesPerSecond: double
in header

Optional; How many video frames per second to be scanned. Minimum value is 0.05 (1 frame per 20 seconds), maximum is 1. Default is 0.33 frame per second (1 frame scanned every 3 seconds). Maximum of 1000 total frames can be scanned, potentially adjusting the framerate for longer videos.

Code Example:
200 OK

OK

Response Content-Types: application/json, text/json, application/xml, text/xml
Response Example (200 OK)
{
  "Successful": "boolean",
  "HighestClassificationResult": "string",
  "HighestScore": "number (double)",
  "TotalRacyFrames": "integer (int32)",
  "TotalNsfwFrames": "integer (int32)",
  "TotalFrames": "integer (int32)",
  "NsfwScannedFrames": [
    {
      "FrameNumber": "integer (int32)",
      "TimeStamp": "string",
      "Content": "string (byte)",
      "ClassificationResult": "string",
      "Score": "number (double)"
    }
  ]
}

Schema Definitions

MediaInformation: object

Result of retrieving information about a video or audio file

Successful: boolean

True if the operation was successful, false otherwise

FileFormat: string

The file's short format name

FileFormatFull: string

The file's full format name

ValidFileFormats: string[]

A list of the file's valid formats

string
Width: integer (int32)

The video's width, if file is a video

Height: integer (int32)

The video's height, if file is a video

Size: integer (int32)

The file's size in bytes

BitRate: integer (int32)

The file's bit rate

Duration: number (double)

The file's duration in seconds

StartTime: number (double)

The file's media start time

Example
{
  "Successful": "boolean",
  "FileFormat": "string",
  "FileFormatFull": "string",
  "ValidFileFormats": [
    "string"
  ],
  "Width": "integer (int32)",
  "Height": "integer (int32)",
  "Size": "integer (int32)",
  "BitRate": "integer (int32)",
  "Duration": "number (double)",
  "StartTime": "number (double)"
}

SplitVideoResult: object

The result of splitting a video

Successful: boolean

True if the operation was successful, false otherwise

Videos: VideoFile

Individual video files resulting from the split operation

VideoFile
Example
{
  "Successful": "boolean",
  "Videos": [
    {
      "VideoNumber": "integer (int32)",
      "Content": "string (byte)"
    }
  ]
}

VideoFile: object

A video file

VideoNumber: integer (int32)

Sequence number of the video

Content: string (byte)

The video file as a byte array

Example
{
  "VideoNumber": "integer (int32)",
  "Content": "string (byte)"
}

StillFramesResult: object

The result of converting a video into still frames

Successful: boolean

True if the operation was successful, false otherwise

TotalFrames: integer (int32)

The total number of frames converted

StillFrames: StillFrame

Individual still frames from the conversion operation

StillFrame
Example
{
  "Successful": "boolean",
  "TotalFrames": "integer (int32)",
  "StillFrames": [
    {
      "FrameNumber": "integer (int32)",
      "TimeStamp": "string",
      "Content": "string (byte)"
    }
  ]
}

StillFrame: object

A single still frame from a video

FrameNumber: integer (int32)

The number of the current frame

TimeStamp: string

The playback time of the current frame

Content: string (byte)

The still frame in PNG format as a byte array

Example
{
  "FrameNumber": "integer (int32)",
  "TimeStamp": "string",
  "Content": "string (byte)"
}

NsfwResult: object

The result of scanning a video file for NSFW content

Successful: boolean

True if the operation was successful, false otherwise

HighestClassificationResult: string

The highest NSFW classification of the video

HighestScore: number (double)

The highest NSFW score out of all frames scanned

TotalRacyFrames: integer (int32)

The total number of potentially "racy" frames.

TotalNsfwFrames: integer (int32)

The total number of frames with high probability of NSFW.

TotalFrames: integer (int32)

The total number of frames scanned

NsfwScannedFrames: NsfwScannedFrame

The NSFW scanning results for each frame

NsfwScannedFrame
Example
{
  "Successful": "boolean",
  "HighestClassificationResult": "string",
  "HighestScore": "number (double)",
  "TotalRacyFrames": "integer (int32)",
  "TotalNsfwFrames": "integer (int32)",
  "TotalFrames": "integer (int32)",
  "NsfwScannedFrames": [
    {
      "FrameNumber": "integer (int32)",
      "TimeStamp": "string",
      "Content": "string (byte)",
      "ClassificationResult": "string",
      "Score": "number (double)"
    }
  ]
}

NsfwScannedFrame: object

An individual frame scanned for NSFW content

FrameNumber: integer (int32)

The number of the current frame

TimeStamp: string

The playback time of the current frame

Content: string (byte)

The still frame in PNG format as a byte array

ClassificationResult: string

The NSFW classification of the still frame

Score: number (double)

The NSFW score of the current frame

Example
{
  "FrameNumber": "integer (int32)",
  "TimeStamp": "string",
  "Content": "string (byte)",
  "ClassificationResult": "string",
  "Score": "number (double)"
}