clear, clc


filelist=dir('*.avi');

delete('*.mkv');

for i=1:length(filelist),
    
   filename=filelist(i).name;
   
   [pathstr, name_wo_ext, ext] = fileparts(filelist(i).name);
   
   
   dos(sprintf('./ffmpeg -i %s -c:v libx264 -preset ultrafast -crf 0 -pix_fmt yuv422p %s.mkv',filename,name_wo_ext));
    
    
end
