Added encoder constraint to stop encoding after maximum frame limit
has been reached (as opposed to crashing).