How do I extract the frames from a yuv 420 video? Let’s say i want to store them as still images. How?
Share
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.
Here’s a submission from the MathWorks File Exchange that should do what you want:
The function
loadFileYuvfrom the above submission will load a YUV file and return an array of movie frames. Each movie frame is a structure with the following fields:cdata: A matrix ofuint8values. The dimensions are height-by-width-by-3.colormap: An N-by-3 matrix of doubles. It is empty on true color systems.You can therefore extract the
cdatafield from each movie frame in the array and save/use it as an RGB image.Your code might look something like this: