def _to_ffmpeg_time(n):
    """ Format number of seconds to time expected by FFMPEG.

    :param n: Time in seconds to format.
    :returns: Formatted time in FFMPEG format.
    """
    m, s = divmod(n, 60)
    h, m = divmod(m, 60)
    return '%d:%02d:%09.6f' % (h, m, s)