views:

43

answers:

1

How to get the width and height of a given yuv file? The dimensions are needed for subsequent movie/matrix processing. Thank you.

A: 

From the help of VIDEOREADER

%# create reader object (does not load file yet)
xyloObj = VideoReader('xylophone.mpg');

%# query dimensions
nFrames = xyloObj.NumberOfFrames;
vidHeight = xyloObj.Height;
vidWidth = xyloObj.Width;

EDIT

For older versions of Matlab, you can use AVIINFO to query the properties of a movie.

Jonas
But it seems that VideoReader is not a build-in function in Matlab, is it?
appi
@yoursclark: The link I provide in my answer does point to the official Matlab documentation, so yes, it is a built-in function in more recent versions of Matlab. However, the function has not been around forever. Which version are you working with?
Jonas
Oh I see. I'm currently using Matlab R2008a. So I guess the function is not accessible under my version?
appi
@yoursclark: Looks like it. In your version, `aviinfo` should do the job, though. Check the link in my edit.
Jonas
Thank you Jonas!
appi

related questions