I have multiple jpeg images stored as strings in memory. I want to generate a video from them (so those pictures would be the frames in the video).
How can I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you have a collection of strings that individually represents one image each, you can combine
StringIOwithPILto read it without saving them to files. Then you convert from aPILimage to OpenCV by usingnumpy. Also, update your code to use the new OpenCV bindings.Here is an example that duplicates what you have (sys.argv[1] assumed to be the name of the output video file), you might need to adjust the video codec: