added bitrate calculation function
currently processes all frames
Script now calculate and uses appropriate bitrate for the part to be
reencoded. Still there is an unexplained pause at the end of the
reencoded part which has to be investigated.