22 January 2019
over 7 years ago by Encoding.com Product Team #2
Auto Crop
Detect and remove video letterbox.
<?xml version="1.0"?>
<query>
<userid>ID</userid> <!-- required-->
<userkey>KEY</userkey> <!-- required-->
<action>[Action]</action> <!-- required-->
<format>
<auto_crop>
<enable>[yes|no]</enable>
<crop_type>[CropType]</crop_type>
<limit>[Detection]</limit>
<round>[CropRound]</round>
</auto_crop>
</format>
</query>{
"query": {
"userid": "ID",
"userkey": "KEY",
"action": "[Action]",
"format": {
"auto_crop": {
"enable": "[yes|no]",
"crop_type": "[CropType]",
"limit": "[Detection]",
"round": "[CropRound]"
}
}
}
}| Parameter | Description | Allowed Values | Default |
|---|---|---|---|
| enable | Enable auto-cropping. | yes, no | no |
| crop_type | Specify cropping type. |
| resize |
| limit | Higher black value threshold. | Positive integer number from 0 to 128. Value greater than 128 will be changed to 128. 0 – Pixel must be absolutely black to be classified as black. 128 – The lightest pixels would be classified as black. | 24 |
| round | The value which the width/height should be divisible by. | Positive integer number. | 16 |
Note for crop_typeIf <crop_type /> set to crop and
specified for output then video will be re-scaled like if <crop_type /> set to stretch.
NoteAuto cropping will be ignored if <crop_* /> parameters are specified.
Consistent Arrays in JSON response
Request:
{
"query": {
"userid": "ID",
"userkey": "KEY",
"action": "GetMediaInfoEx",
"mediaid": "[MediaID]",
"consistentarrays": "[1|0]"
}
}
Note for JSON requestIf MediaInfo contains only one track, by default track parameter in response will be object. To keep it as array add
"consistentarrays": "1"parameter to request.
| Parameter | Description | Allowed Values | Default |
|---|---|---|---|
| consistentarrays | Make arrays consistent in response | 1, 0 | 0 |
Response:
{
"response": {
"Mediainfo": {
"File": {
"track": [
{
"@attributes": {"type": "[TrackType]"}
},
{
"@attributes": {"type": "[TrackType]"}
},
]
}
}
}
}Changelog
- added: auto_crop parameters
- added: consistentarrays parameter for JSON requests