A channel code allocation scheme is developed for transmission of video over error-prone channels. The system is designed to minimize the expected distortion of the video under a quality constraint. It is based on the Viterbi algorithm and achieves a very robust bit stream, also in mismatch situations. It is further shown that the distribution of available channel codes vary significantly with respect to the channel conditions.