function [W, H, nFrames, h264Flag]=resfind(res_string)
w_1=strfind(res_string, 'width=');
h_1=strfind(res_string, 'height=');
h_2=strfind(res_string, 'has_b_frames');
nF_1=strfind(res_string, 'nb_read_frames=');
h264Temp=strfind(res_string, 'MPEG-4 part 10');
if isempty(h264Temp)
    h264Flag=0;
else
    h264Flag=1;
end

n=0;
for k=1:length(nF_1)
    if nF_1(k)<h_2
        n=n+1;
    end
end
n=n+1;

nF_2=strfind(res_string, 'nb_read_packets');

W=str2double(res_string(w_1+6:h_1-1));
H=str2double(res_string(h_1+7:h_2-1));
nFrames=str2double(res_string(nF_1(n)+15:nF_2(n)-1));

end

