I am writing simple REST API using Flask, which reads uploaded video and returns some JSON. Video is sent as file by POST request, with content type application/x-www-form-urlencoded.
I want to process it using opencv, but I do not know how to read it from raw binary string. The only solution I came up with, is to save video to file and read it using opencv VideoCapture class. However I would like to avoid IO operations, because I think it will slow down my API.
So my question is:
How can I transform video from raw bytes representation to opencv representation (list of numpy arrays)?