Added the exit call if invalid res/codec