media-insights-on-aws
media-insights-on-aws copied to clipboard
The proxy video created by the Thumbnails operator can be larger than the input video
Describe the bug
When I run the Content Localization application workflow with MIE v4.0.1, the size of the proxy encode generated for a ~400MB input video is 1.1G. In the Content Localization v1.0.0 release, which uses an MIE v3.0.2, the proxy is even larger causing the Transcribe operator to fail because the video input to the operator is > 2G.
To Reproduce Run an MIE workflow.
Expected behavior
The proxy encoded video should be less than or equal size to the input video.
Please complete the following information about the solution:
- [ ] Version: [e.g. v1.0.0] v3.0.2 v4.0.1
Screenshots If applicable, add screenshots to help explain your problem (please DO NOT include sensitive information).
Additional context Add any other context about the problem here.
Looking in the code, this is likely caused by statically defined values in the MediaConvert job settings that upscale the input.
See: https://github.com/aws-solutions/aws-media-insights-engine/blob/development/source/operators/thumbnail/start_thumbnail.py#L171
To address this, we should adjust a few things:
- In any workflow, place the MediaInfo operator in a stage before the MediaConvert proxy encode operator.
- Change the encode from a constant bit rate to QVBR (need to think about how to determine optimal limit and threshold bitrates based on input file size and service limit constraints)
- Pass along any relevant metadata from MediaInfo into MediaConvert job settings, e.g. frame-rate.
- Remove any statically defined values in the MediaConvert job settings and let the service provide default values.
I would also propose to change the name of the Proxy Encode operator from "Thumbnail" to "ProxyEncode" as that is the primary function of the operator.