Decoding Error Options
When Hybrik encounters a source file with bad frames that cannot be decoded, the task will fail with an error similar to the following:
Example Error
"result_define": "SYS_TSK_FFMPEG_ERROR",
"message": "pipeline error: OTT::video decode error: too many errors (1) at 432",
This error translates to, “the source video has 1 bad frame at index 432 that cannot be decoded by Hybrik”. Inspection with another application can provide a way to verify the bad frame(s). It is likely that if you try to play back the same frame on a video player, you would see the bad frame.
Decoding Options
By default, Hybrik will fail instead of quietly outputting a duplicated frame or some other undesired result. However, Hybrik can compensate for this bad frame(s) by duplicating the previous “good” frame(s) for the target output. This is done by adding an options
object to the source object. This will instruct Hybrik to duplicate frames for both the transcode
and analyze
tasks.
Options
Using the options specified in the API Docs, you can enable these options:
max_decode_errors
- The maximum number of decode errors to allow before failing the job. This applies to the duration of the source file. Normally, a single decode error will cause job failure, but there can be situations where a more flexible approach is desired
max_sequential_decode_errors
- The maximum number of sequential errors to allow during decode. This will tell Hybrik how many frames in-a-row can have decode errors. This can be used in combination with
max_decode_errors
to set bounds on allowable errors in the source
- The maximum number of sequential errors to allow during decode. This will tell Hybrik how many frames in-a-row can have decode errors. This can be used in combination with
Sample Usage
The sample json instructs Hybrik as follows:
"options": {
"max_decode_errors": 20,
"max_sequential_decode_errors": 5
},
Error if there are 20 or more bad frames in the source file that cannot be decoded. If there are 5 frames or more in-a-row, even if the total number of bad frames in the job is less than 20, the job will fail. Given our example error atop this page, Hybrik would duplicate frame 431, in place of frame 432.
Sample Source (Simple) Configuration:
This shows a source configuration for a single asset
{
"uid": "source",
"kind": "source",
"payload": {
"kind": "asset_url",
"payload": {
"storage_provider": "s3",
"url": "{{source_file}}",
"options": {
"max_decode_errors": 20,
"max_sequential_decode_errors": 5
}
}
}
},
Sample Source (asset_complex) Configuration:
This shows a source configuration for multiple assets, it can be applied to multiple asset_components
{
"uid": "source",
"kind": "source",
"payload": {
"kind": "asset_complex",
"payload": {
"asset_versions": [
{
"version_uid": "main",
"location": {
"storage_provider": "s3",
"path": ""
},
"asset_components": [
{
"kind": "name",
"component_uid": "video",
"name": "{{source_file}}",
"options": {
"max_decode_errors": 20,
"max_sequential_decode_errors": 5
}
}
]
}
]
}
}
},