Transform 1.1
From Aviberry API
| Language: |
English • Русский |
Contents
Still have a question?
During file conversion you can edit your video to enhance its quality or apply advanced parameters. For example, you can cut the video, change its contrast settings, add watermark etc. All the possible transformations with parameters are listed below. Transformation is set in startConversion method.
Contents |
Cut
Cuts the specified part. Name of operation to use for this setting - cut. Parameters should be set as:
start_interval units, end_interval units
| Parameter | Type | Description |
|---|---|---|
| start_interval | integer | Fragment start. If the parameter is not set, the fragment will be cut from the beginning. The interval length is defined by units parameter. |
| end_interval | integer | Fragment end. If the parameter is not set, the fragment will be cut till the file end. Interval length is defined by units parameter. |
| units | string | Interval unit. The available values are: 'h' (hours), 'm' (minutes), 's' (seconds), 'ms' (milliseconds). |
At least one parameter should be specified when setting. Intervals can be composite. Examples:
transform[cut] = '1000,10s' // Cuts out 9 seconds of video, starting from the 1st second of file.
transform[cut] = '1m,' // Cuts out the fragment from 1 minute till the end of file.
transform[cut] = ',10m17s' // Cuts out 10 minutes 17 seconds of video from the beginning of file.
Split
Splits video in equal parts of same duration or same size. Name of operation to use for this setting - split. Parameters should be set as:
amount units
| Parameter | Type | Description |
|---|---|---|
| amount | integer | Duration or fragment size of video splitting. Depends on units parameter. |
| units | string | Unit of amount parameter. Can have following values: 'h' (hours), 'm' (minutes), 's' (seconds), - then amount is defined as time duration of file fragment, or: 'gb' (gigabytes), 'mb' (megabytes), 'kb' (kilobytes), - then amount is defined as fragment size. |
Both parameters are mandatory. If the splitting is set by duration, the minimum part is 1 minute ('1m' = '60s'). If by size, the minimum part is 10 Mb ('10mb' = '1024kb').
Interval or size can be composite. Examples:
transform[split] = '1m30s' // Splits video into fragments of 1m30s duration.
transform[split] = '1h' // Splits video into fragments of 1h duration.
transform[split] = '50mb' // Splits video into fragments of 50 Mb size.
Crop
Crops the frame to indicated range. Name of operation to use for this setting - сrop. Parameters should be set as:
top, right, bottom, left
or
padding
| Parameter | Type | Description |
|---|---|---|
| top | float | Padding top. Relative value, defined as ratio of padding to frame height. Default value is 0.0. |
| right | float | Padding right. Relative value, defined as ratio of padding to frame width. Default value is 0.0. |
| bottom | float | Padding bottom. The same as top. Default value is 0.0. |
| left | float | Padding left. The same as right. Default value is 0.0. |
| padding | float | Equal padding for top, right, bottom and left. |
If using the first format, at least one of the above parameters should be specified. Omitted parameters are set to default values. When using the second format, the only option is mandatory. Examples:
transform[crop] = '0.2,0.1,0.2,0.1' // Crops the frame on top and bottom by 20% and right and left by 10% of original size.
transform[crop] = ',0.1,,0.1' // Crops the frame on the right and left by 10% of original size.
transform[crop] = '0.2,0.1,,' // Crops the frame on top by 20% and on the right by 10% of original size.
transform[crop] = '0.1' // Crops the frame by 10% from all sides.
Rotate
Rotates the video. Name of operation to use for setting - rotate. Parameters should be set as:
mode
| Parameter | Type | Description |
|---|---|---|
| mode | string | Rotation direction. Possible values are: 'cw' (clockwise) - rotate clockwise by 90°, 'ccw' (counterclockwise) - rotate counterclockwise by 90°, 'usd' (upside down) - rotate by 180°. |
Example:
transform[rotate] = 'cw' // Rotates video by 90 degrees clockwise.
Watermark
Applies "watermark" to video. Watermark can be image, text or both. Name of operation to use for this setting - watermark. To set the watermark, configure additionally image, text and general watermark settings.
Image settings. Name of operation property to use for this setting - image.
| Parameter | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| image | string | Image file URL. Mandatory parameter. Accepted URL types are:
http|https://[user[:password]@]hostname[:port]/[path/][filename] ftp|ftps://[user[:password]@]hostname[:port]/[path/][filename] http://[user:password@]bucket.s3.amazonaws.com/[path/][filename] The URL should be encoded according to standard, i.e. all the special characters should be "percent-encoded". | ||||||||||||
| size | string | Size setting:
scale, aspect
| ||||||||||||
| position | string | Position setting:
vertical, horizontal or align
If using the first format, at least one of the above parameters should be specified. Omitted parameters are set to default values. When using the second format, the only option is mandatory. Examples: |
Text settings. Name of operation to use for setting - text.
| Parameter | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| text | string | Text to use as watermark. Mandatory field. | |||||||||||||||
| size | string | Same as parameter size for image. | |||||||||||||||
| position | string | Same as parameter position for image. | |||||||||||||||
| font | string | Font settings
face, style, size, color
|
General parameter setting. Each general parameter is a separate operation property. General parameters are listed below.
| Parameter | Type | Description |
|---|---|---|
| transparency | float | Watermark transparency. Possible values from 0.0 (not transparent) to 1.0 (transparent). By default 0.0. |
Optional parameters may be omitted. In this case they are set to default values. Example:
transform[watermark][image][image] = 'http://example.org/watermark.png' // Sets the specified image as watermark.
transform[watermark][image][size] = '1.5,4:3' // Enlarges the picture by 50% and sets the ratio to 4:3 (1.333).
transform[watermark][image][position] = '-0.2,0.3' // Moves the image by 20% down and by 30% left.
transform[watermark][text][text] = 'My Watermark' // Sets the specified text as watermark.
transform[watermark][text][size] = '2' // Enlarges text 2 times, keeping the ratio of the text block unchanged.
transform[watermark][text][position] = 0.9,0.9 // Moves the text to the bottom right corner of the frame.
transform[watermark][text][font] = ',italic,,ff0000' // Makes font italic and sets font color to red.
transform[watermark][transparency] = '0.5' // Makes the watermark semitransparent.
Video adjustment
Performs general image adjustment. Name of operation to use for this setting - adjust. Operation consists of set of suboperations, defined as separate operation properties and presented below.
| Parameter | Type | Description |
|---|---|---|
| magic_enhance | boolean | By default false. |
| auto_contrast | boolean | Automatic contrast adjustment. By default false. |
| auto_whitebalance | boolean | Auto white balance. By default false. |
| deblocking | boolean | By default false. |
| deinterlacing | boolean | Deinterlacing. By default false. |
| brightness | integer | Brightness. Possible values from -70 to 70. By default 0. |
| сontrast | integer | Contrast. Possible values from 128 to 384. If set to 256 contrast does not change. By default 256. |
| hue | integer | Hue. Possible values from -180 to 180. If set to 0 hue does not change. |
| saturation | integer | Saturation. Possible values from -100 to 100. If set to 0 saturation does not change. |
Example:
transform[adjust][deinterlacing] = true // Removes interlacing.
transform[adjust][contrast] = 300 // Defines contrast.
Converting to 3D
Converts any 2D video to 3D. Name of operation to use for this setting, - 3d.
| Parameter | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Mode | string | 3D encoding method. Default: 'Anaglyph'.
| ||||||||||||
| Depth | integer | 3D Depth. Strengthens 3D illusion by changing the distance between video frames for the left and right eyes. Possible values are in range -200 to 200. The default value is 0. | ||||||||||||
| Shift | integer | 3D Shift. Changes the distance between objects of a video frame for the right and left eyes.
Possible values are in range 0 to 1000. The default value is 0. | ||||||||||||
| Perspective | integer | Perspective. Creates an artificial perspective for objects of a video frame for the right and left eyes.
Possible values are in range 0 to 100. The default value is 50. |
Example:
transform[3d][Mode] = 'Anaglyph'
transform[3d][Depth] = -20
transform[3d][Shift] = 10
transform[3d][Perspective] = 40
Contents
Still have a question?
| Language: |
English • Русский |
