def _calc_video_bitrate(options):
    """
    Calculate video bitrate in kilobits.
    """
    limit_kbits = options.l * 8 * 1024
    vb = limit_kbits / options.outduration - options.ab
    vb = int(vb * 10) / 10
    if vb < 0.001:
        raise Exception(
            """

Unable to calculate video bitrate for the given limit.
Either limit is too low, duration of the video is too long
or audio bitrate is too high.
Consider fixing one of this or just set bitrate manually."""
            )
    return vb
