cloudmersive-video-api-client

CloudmersiveVideoApiClient - the Ruby gem for the videoapi

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

This SDK is automatically generated by the Swagger Codegen project:

  • API version: v1
  • Package version: 2.0.2
  • Build package: io.swagger.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build cloudmersive-video-api-client.gemspec

Then either install the gem locally:

gem install ./cloudmersive-video-api-client-2.0.2.gem

(for development, run gem install --dev ./cloudmersive-video-api-client-2.0.2.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'cloudmersive-video-api-client', '~> 2.0.2'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'cloudmersive-video-api-client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'cloudmersive-video-api-client'

# Setup authorization
CloudmersiveVideoApiClient.configure do |config|
  # Configure API key authorization: Apikey
  config.api_key['Apikey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveVideoApiClient::VideoApi.new

input_file = File.new('/path/to/file.txt') # File | Input file to perform the operation on.

opts = { 
  file_url: 'file_url_example', # String | Optional; URL of a video file being used for conversion. Use this option for files larger than 2GB.
  max_width: 56, # Integer | Optional; Maximum width of the output video, up to the original video width. Defaults to 250 pixels.
  max_height: 56, # Integer | Optional; Maximum height of the output video, up to the original video width. Defaults to 250 pixels.
  preserve_aspect_ratio: true, # BOOLEAN | 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.
  frame_rate: 56, # Integer | Optional; Specify the frame rate of the output video. Defaults to 24 frames per second.
  extend_processing_time: true, # BOOLEAN | Optional; If true, will allow additional processing time for the video file conversion, using one API call per additional minute over the 5 minute default processing time, up to a maximum of 25 total minutes. This is generally necessary for files larger than 500 MB or longer than 30 minutes.
  start_time: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Optional; Specify the desired starting time of the GIF video in TimeSpan format.
  time_span: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Optional; Specify the desired length of the GIF video in TimeSpan format. Limit is 30 minutes.
}

begin
  #Convert Video to Animated GIF format.
  result = api_instance.video_convert_to_gif(input_file, opts)
  p result
rescue CloudmersiveVideoApiClient::ApiError => e
  puts "Exception when calling VideoApi->video_convert_to_gif: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.cloudmersive.com

Class Method HTTP request Description
CloudmersiveVideoApiClient::VideoApi video_convert_to_gif POST /video/convert/to/gif Convert Video to Animated GIF format.
CloudmersiveVideoApiClient::VideoApi video_convert_to_mov POST /video/convert/to/mov Convert Video to MOV format.
CloudmersiveVideoApiClient::VideoApi video_convert_to_mp4 POST /video/convert/to/mp4 Convert Video to MP4 format.
CloudmersiveVideoApiClient::VideoApi video_convert_to_webm POST /video/convert/to/webm Convert Video to WEBM format.
CloudmersiveVideoApiClient::VideoApi video_get_info POST /video/convert/get-info Get detailed information about a video or audio file

Documentation for Models

Documentation for Authorization

Apikey

  • Type: API key
  • API key parameter name: Apikey
  • Location: HTTP header