function mov2yuv(File,format)
Obj = VideoReader('/Users/test.avi');
% open(Obj);
vidHeight = Obj.Height;
vidWidth = Obj.Width;
mov(1:100) = ...
struct('cdata',zeros(vidHeight,vidWidth,3,'uint8'),...
'colormap',[]);
for k=1:100
mov(k).cdata = read(Obj,k);
end
%set factor for UV-sampling
format = '420';
File = '/Users/temp.yuv';
fwidth = 0.5;
fheight= 0.5;
if strcmp(format,'400')
fwidth = 0;
fheight= 0;
elseif strcmp(format,'411')
fwidth = 0.25;
fheight= 1;
elseif strcmp(format,'420')
fwidth = 0.5;
fheight= 0.5;
elseif strcmp(format,'422')
fwidth = 0.5;
fheight= 1;
elseif strcmp(format,'444')
fwidth = 1;
matlab下avi视频转yuv格式
最新推荐文章于 2022-10-08 14:16:44 发布
