Class: CloudmersiveVideoApiClient::VideoApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudmersive-video-api-client/api/video_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ VideoApi

Returns a new instance of VideoApi.



19
20
21
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#video_convert_to_gif(input_file, opts = {}) ⇒ String

Convert Video to Animated GIF format. 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. Maximum output file size is 50GB. Default height is 250 pixels, while preserving the video’s aspect ratio.

Parameters:

  • input_file

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :file_url (String)

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

  • :max_width (Integer)

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

  • :max_height (Integer)

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

  • :preserve_aspect_ratio (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 (Integer)

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

  • :extend_processing_time (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)

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

  • :time_span (DateTime)

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

Returns:

  • (String)


35
36
37
38
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 35

def video_convert_to_gif(input_file, opts = {})
  data, _status_code, _headers = video_convert_to_gif_with_http_info(input_file, opts)
  data
end

#video_convert_to_gif_with_http_info(input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Convert Video to Animated GIF format. 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. Maximum output file size is 50GB. Default height is 250 pixels, while preserving the video&#39;s aspect ratio.

Parameters:

  • input_file

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :file_url (String)

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

  • :max_width (Integer)

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

  • :max_height (Integer)

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

  • :preserve_aspect_ratio (BOOLEAN)

    Optional; If false, the original video&#39;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 (Integer)

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

  • :extend_processing_time (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)

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

  • :time_span (DateTime)

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

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 53

def video_convert_to_gif_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VideoApi.video_convert_to_gif ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling VideoApi.video_convert_to_gif"
  end
  # resource path
  local_var_path = '/video/convert/to/gif'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
  header_params[:'fileUrl'] = opts[:'file_url'] if !opts[:'file_url'].nil?
  header_params[:'maxWidth'] = opts[:'max_width'] if !opts[:'max_width'].nil?
  header_params[:'maxHeight'] = opts[:'max_height'] if !opts[:'max_height'].nil?
  header_params[:'preserveAspectRatio'] = opts[:'preserve_aspect_ratio'] if !opts[:'preserve_aspect_ratio'].nil?
  header_params[:'frameRate'] = opts[:'frame_rate'] if !opts[:'frame_rate'].nil?
  header_params[:'extendProcessingTime'] = opts[:'extend_processing_time'] if !opts[:'extend_processing_time'].nil?
  header_params[:'startTime'] = opts[:'start_time'] if !opts[:'start_time'].nil?
  header_params[:'timeSpan'] = opts[:'time_span'] if !opts[:'time_span'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideoApi#video_convert_to_gif\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#video_convert_to_mov(input_file, opts = {}) ⇒ String

Convert Video to MOV format. 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. Maximum output file size is 50GB.

Parameters:

  • input_file

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :file_url (String)

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

  • :max_width (Integer)

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

  • :max_height (Integer)

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

  • :preserve_aspect_ratio (BOOLEAN)

    Optional; If false, the original video&#39;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 (Integer)

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

  • :quality (Integer)

    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.

  • :extend_processing_time (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.

Returns:

  • (String)


113
114
115
116
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 113

def video_convert_to_mov(input_file, opts = {})
  data, _status_code, _headers = video_convert_to_mov_with_http_info(input_file, opts)
  data
end

#video_convert_to_mov_with_http_info(input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Convert Video to MOV format. 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. Maximum output file size is 50GB.

Parameters:

  • input_file

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :file_url (String)

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

  • :max_width (Integer)

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

  • :max_height (Integer)

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

  • :preserve_aspect_ratio (BOOLEAN)

    Optional; If false, the original video&#39;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 (Integer)

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

  • :quality (Integer)

    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.

  • :extend_processing_time (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.

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 130

def video_convert_to_mov_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VideoApi.video_convert_to_mov ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling VideoApi.video_convert_to_mov"
  end
  # resource path
  local_var_path = '/video/convert/to/mov'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
  header_params[:'fileUrl'] = opts[:'file_url'] if !opts[:'file_url'].nil?
  header_params[:'maxWidth'] = opts[:'max_width'] if !opts[:'max_width'].nil?
  header_params[:'maxHeight'] = opts[:'max_height'] if !opts[:'max_height'].nil?
  header_params[:'preserveAspectRatio'] = opts[:'preserve_aspect_ratio'] if !opts[:'preserve_aspect_ratio'].nil?
  header_params[:'frameRate'] = opts[:'frame_rate'] if !opts[:'frame_rate'].nil?
  header_params[:'quality'] = opts[:'quality'] if !opts[:'quality'].nil?
  header_params[:'extendProcessingTime'] = opts[:'extend_processing_time'] if !opts[:'extend_processing_time'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideoApi#video_convert_to_mov\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#video_convert_to_mp4(input_file, opts = {}) ⇒ String

Convert Video to MP4 format. 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. Maximum output file size is 50GB.

Parameters:

  • input_file

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :file_url (String)

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

  • :max_width (Integer)

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

  • :max_height (Integer)

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

  • :preserve_aspect_ratio (BOOLEAN)

    Optional; If false, the original video&#39;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 (Integer)

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

  • :quality (Integer)

    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.

  • :extend_processing_time (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.

Returns:

  • (String)


189
190
191
192
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 189

def video_convert_to_mp4(input_file, opts = {})
  data, _status_code, _headers = video_convert_to_mp4_with_http_info(input_file, opts)
  data
end

#video_convert_to_mp4_with_http_info(input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Convert Video to MP4 format. 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. Maximum output file size is 50GB.

Parameters:

  • input_file

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :file_url (String)

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

  • :max_width (Integer)

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

  • :max_height (Integer)

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

  • :preserve_aspect_ratio (BOOLEAN)

    Optional; If false, the original video&#39;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 (Integer)

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

  • :quality (Integer)

    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.

  • :extend_processing_time (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.

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 206

def video_convert_to_mp4_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VideoApi.video_convert_to_mp4 ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling VideoApi.video_convert_to_mp4"
  end
  # resource path
  local_var_path = '/video/convert/to/mp4'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
  header_params[:'fileUrl'] = opts[:'file_url'] if !opts[:'file_url'].nil?
  header_params[:'maxWidth'] = opts[:'max_width'] if !opts[:'max_width'].nil?
  header_params[:'maxHeight'] = opts[:'max_height'] if !opts[:'max_height'].nil?
  header_params[:'preserveAspectRatio'] = opts[:'preserve_aspect_ratio'] if !opts[:'preserve_aspect_ratio'].nil?
  header_params[:'frameRate'] = opts[:'frame_rate'] if !opts[:'frame_rate'].nil?
  header_params[:'quality'] = opts[:'quality'] if !opts[:'quality'].nil?
  header_params[:'extendProcessingTime'] = opts[:'extend_processing_time'] if !opts[:'extend_processing_time'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideoApi#video_convert_to_mp4\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#video_convert_to_webm(input_file, opts = {}) ⇒ String

Convert Video to WEBM format. 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. Maximum output file size is 50GB.

Parameters:

  • input_file

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :file_url (String)

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

  • :max_width (Integer)

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

  • :max_height (Integer)

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

  • :preserve_aspect_ratio (BOOLEAN)

    Optional; If false, the original video&#39;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 (Integer)

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

  • :quality (Integer)

    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.

  • :extend_processing_time (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.

Returns:

  • (String)


265
266
267
268
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 265

def video_convert_to_webm(input_file, opts = {})
  data, _status_code, _headers = video_convert_to_webm_with_http_info(input_file, opts)
  data
end

#video_convert_to_webm_with_http_info(input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Convert Video to WEBM format. 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. Maximum output file size is 50GB.

Parameters:

  • input_file

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :file_url (String)

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

  • :max_width (Integer)

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

  • :max_height (Integer)

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

  • :preserve_aspect_ratio (BOOLEAN)

    Optional; If false, the original video&#39;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 (Integer)

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

  • :quality (Integer)

    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.

  • :extend_processing_time (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.

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 282

def video_convert_to_webm_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VideoApi.video_convert_to_webm ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling VideoApi.video_convert_to_webm"
  end
  # resource path
  local_var_path = '/video/convert/to/webm'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
  header_params[:'fileUrl'] = opts[:'file_url'] if !opts[:'file_url'].nil?
  header_params[:'maxWidth'] = opts[:'max_width'] if !opts[:'max_width'].nil?
  header_params[:'maxHeight'] = opts[:'max_height'] if !opts[:'max_height'].nil?
  header_params[:'preserveAspectRatio'] = opts[:'preserve_aspect_ratio'] if !opts[:'preserve_aspect_ratio'].nil?
  header_params[:'frameRate'] = opts[:'frame_rate'] if !opts[:'frame_rate'].nil?
  header_params[:'quality'] = opts[:'quality'] if !opts[:'quality'].nil?
  header_params[:'extendProcessingTime'] = opts[:'extend_processing_time'] if !opts[:'extend_processing_time'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideoApi#video_convert_to_webm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#video_get_info(input_file, opts = {}) ⇒ String

Get detailed information about a video or audio file 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.

Parameters:

  • input_file

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :file_url (String)

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

Returns:

  • (String)


335
336
337
338
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 335

def video_get_info(input_file, opts = {})
  data, _status_code, _headers = video_get_info_with_http_info(input_file, opts)
  data
end

#video_get_info_with_http_info(input_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Get detailed information about a video or audio file 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.

Parameters:

  • input_file

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :file_url (String)

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

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 346

def video_get_info_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VideoApi.video_get_info ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling VideoApi.video_get_info"
  end
  # resource path
  local_var_path = '/video/convert/get-info'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
  header_params[:'fileUrl'] = opts[:'file_url'] if !opts[:'file_url'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideoApi#video_get_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end