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(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. 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

  • :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, maximum is 500 pixels.

  • :max_height (Integer)

    Optional; Maximum height of the output video, up to the original video width. Defaults to 250 pixels, maximum is 500 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.

  • :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 seconds. Default is 10 seconds.

Returns:

  • (String)


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

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

#video_convert_to_gif_with_http_info(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. 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&#39;s aspect ratio.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

  • :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, maximum is 500 pixels.

  • :max_height (Integer)

    Optional; Maximum height of the output video, up to the original video width. Defaults to 250 pixels, maximum is 500 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.

  • :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 seconds. Default is 10 seconds.

Returns:

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

    String data, response status code and response headers



51
52
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
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 51

def video_convert_to_gif_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: 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/octet-stream'])
  # 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[:'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'] = opts[:'input_file'] if !opts[:'input_file'].nil?

  # 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(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. 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

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

Returns:

  • (String)


105
106
107
108
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 105

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

#video_convert_to_mov_with_http_info(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. 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

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

Returns:

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

    String data, response status code and response headers



121
122
123
124
125
126
127
128
129
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
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 121

def video_convert_to_mov_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: 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/octet-stream'])
  # 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?

  # form parameters
  form_params = {}
  form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil?

  # 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(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. 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

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

Returns:

  • (String)


174
175
176
177
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 174

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

#video_convert_to_mp4_with_http_info(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. 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

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

Returns:

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

    String data, response status code and response headers



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
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
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 190

def video_convert_to_mp4_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: 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/octet-stream'])
  # 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?

  # form parameters
  form_params = {}
  form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil?

  # 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_still_frames(opts = {}) ⇒ StillFramesResult

Convert Video to PNG 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

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

  • :frames_per_second (Float)

    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.

Returns:



241
242
243
244
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 241

def video_convert_to_still_frames(opts = {})
  data, _status_code, _headers = video_convert_to_still_frames_with_http_info(opts)
  data
end

#video_convert_to_still_frames_with_http_info(opts = {}) ⇒ Array<(StillFramesResult, Fixnum, Hash)>

Convert Video to PNG 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

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

  • :frames_per_second (Float)

    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.

Returns:

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

    StillFramesResult data, response status code and response headers



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 255

def video_convert_to_still_frames_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VideoApi.video_convert_to_still_frames ...'
  end
  # resource path
  local_var_path = '/video/convert/to/still-frames'

  # 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[:'framesPerSecond'] = opts[:'frames_per_second'] if !opts[:'frames_per_second'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil?

  # 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 => 'StillFramesResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideoApi#video_convert_to_still_frames\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#video_convert_to_webm(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. 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

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

Returns:

  • (String)


306
307
308
309
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 306

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

#video_convert_to_webm_with_http_info(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. 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

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

Returns:

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

    String data, response status code and response headers



322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 322

def video_convert_to_webm_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: 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/octet-stream'])
  # 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?

  # form parameters
  form_params = {}
  form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil?

  # 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_cut_video(opts = {}) ⇒ String

Cut a Video to a Shorter Length 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

  • :file_url (String)

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

  • :start_time (DateTime)

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

  • :time_span (DateTime)

    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.

Returns:

  • (String)


372
373
374
375
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 372

def video_cut_video(opts = {})
  data, _status_code, _headers = video_cut_video_with_http_info(opts)
  data
end

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

Cut a Video to a Shorter Length 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

  • :file_url (String)

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

  • :start_time (DateTime)

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

  • :time_span (DateTime)

    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.

Returns:

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

    String data, response status code and response headers



385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 385

def video_cut_video_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VideoApi.video_cut_video ...'
  end
  # resource path
  local_var_path = '/video/cut'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # 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[:'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'] = opts[:'input_file'] if !opts[:'input_file'].nil?

  # 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_cut_video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#video_get_info(opts = {}) ⇒ MediaInformation

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:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

  • :file_url (String)

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

Returns:



430
431
432
433
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 430

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

#video_get_info_with_http_info(opts = {}) ⇒ Array<(MediaInformation, 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:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

  • :file_url (String)

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

Returns:

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

    MediaInformation data, response status code and response headers



441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 441

def video_get_info_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: 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'] = opts[:'input_file'] if !opts[:'input_file'].nil?

  # 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 => 'MediaInformation')
  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

#video_resize_video(opts = {}) ⇒ String

Resizes a Video Preserving the Original Aspect Ratio. 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

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

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

  • :extension (String)

    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.

Returns:

  • (String)


489
490
491
492
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 489

def video_resize_video(opts = {})
  data, _status_code, _headers = video_resize_video_with_http_info(opts)
  data
end

#video_resize_video_simple(opts = {}) ⇒ String

Resizes a Video without Preserving Aspect Ratio. 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

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

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

  • :extension (String)

    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.

Returns:

  • (String)


558
559
560
561
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 558

def video_resize_video_simple(opts = {})
  data, _status_code, _headers = video_resize_video_simple_with_http_info(opts)
  data
end

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

Resizes a Video without Preserving Aspect Ratio. 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

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

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

  • :extension (String)

    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.

Returns:

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

    String data, response status code and response headers



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 574

def video_resize_video_simple_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VideoApi.video_resize_video_simple ...'
  end
  # resource path
  local_var_path = '/video/resize/target'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # 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[:'frameRate'] = opts[:'frame_rate'] if !opts[:'frame_rate'].nil?
  header_params[:'quality'] = opts[:'quality'] if !opts[:'quality'].nil?
  header_params[:'extension'] = opts[:'extension'] if !opts[:'extension'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil?

  # 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_resize_video_simple\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Resizes a Video Preserving the Original Aspect Ratio. 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

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

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

  • :extension (String)

    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.

Returns:

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

    String data, response status code and response headers



505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 505

def video_resize_video_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VideoApi.video_resize_video ...'
  end
  # resource path
  local_var_path = '/video/resize/preserveAspectRatio'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # 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[:'frameRate'] = opts[:'frame_rate'] if !opts[:'frame_rate'].nil?
  header_params[:'quality'] = opts[:'quality'] if !opts[:'quality'].nil?
  header_params[:'extension'] = opts[:'extension'] if !opts[:'extension'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil?

  # 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_resize_video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#video_scan_for_nsfw(opts = {}) ⇒ NsfwResult

Scan a Video for NSFW content. 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

  • :file_url (String)

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

  • :frames_per_second (Float)

    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.

Returns:



623
624
625
626
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 623

def video_scan_for_nsfw(opts = {})
  data, _status_code, _headers = video_scan_for_nsfw_with_http_info(opts)
  data
end

#video_scan_for_nsfw_with_http_info(opts = {}) ⇒ Array<(NsfwResult, Fixnum, Hash)>

Scan a Video for NSFW content. 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

  • :file_url (String)

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

  • :frames_per_second (Float)

    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.

Returns:

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

    NsfwResult data, response status code and response headers



635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 635

def video_scan_for_nsfw_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VideoApi.video_scan_for_nsfw ...'
  end
  # resource path
  local_var_path = '/video/scan/nsfw'

  # 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[:'framesPerSecond'] = opts[:'frames_per_second'] if !opts[:'frames_per_second'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil?

  # 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 => 'NsfwResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideoApi#video_scan_for_nsfw\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#video_split_video(split_time, opts = {}) ⇒ SplitVideoResult

Split a Video into Two Shorter Videos 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.

Parameters:

  • split_time

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

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

  • :file_url (String)

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

  • :time_span (DateTime)

    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.

Returns:



681
682
683
684
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 681

def video_split_video(split_time, opts = {})
  data, _status_code, _headers = video_split_video_with_http_info(split_time, opts)
  data
end

#video_split_video_with_http_info(split_time, opts = {}) ⇒ Array<(SplitVideoResult, Fixnum, Hash)>

Split a Video into Two Shorter Videos 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.

Parameters:

  • split_time

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

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

    the optional parameters

Options Hash (opts):

  • :input_file (File)

    Input file to perform the operation on.

  • :file_url (String)

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

  • :time_span (DateTime)

    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.

Returns:

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

    SplitVideoResult data, response status code and response headers



694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
# File 'lib/cloudmersive-video-api-client/api/video_api.rb', line 694

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
  header_params[:'splitTime'] = split_time
  header_params[:'fileUrl'] = opts[:'file_url'] if !opts[:'file_url'].nil?
  header_params[:'timeSpan'] = opts[:'time_span'] if !opts[:'time_span'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil?

  # 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 => 'SplitVideoResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VideoApi#video_split_video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end