def convertFiles(old_dir, new_dir, video_dir = "", fps = 25):
    """Converts the the subtitle files in old_dir and subdirectories
    from using fps to using the actual time
    @param old_dir The directory where the to be converted subtititle files are
    @param new_dir Where the changed files should go
    @param video_dir Directory where the video files, for which the 
    subtitles in old_dir where written, are. This is optional but recommended.
    @param fps This is the default fps used to calculate the time. 
    Will be overwritten by the actual fps of the video if video_dir is set    
    """
    import os
    use_video_fps = os.path.exists(video_dir)
    if use_video_fps:
        from theora import Theora
    if use_video_fps:
        print "Using fps values from the actual video files"
    else:
        print "Using the default fps: " + str(fps)
    for dirpath, dirnames, filenames in os.walk (old_dir):
        os.mkdir (os.path.join (new_dir, dirpath[1+len (old_dir):]))
        for filename in filenames:
            old_file = (os.path.join(dirpath, filename))
            new_file = (os.path.join(new_dir, dirpath[1+len (old_dir):], filename))
            if use_video_fps:
                video_file = os.path.join(video_dir, dirpath[1+len (old_dir):], os.path.splitext(filename)[0] + ".ogg")
                video = Theora(video_file)
                fps = int(video.fps_ratio[0] / video.fps_ratio[1])
            print old_file + "->" + new_file
            convertFile(old_file, new_file, fps)