(path)
| 198 | |
| 199 | |
| 200 | def generate_unique_path(path): |
| 201 | if not os.path.exists(path): |
| 202 | return path |
| 203 | root, ext = os.path.splitext(path) |
| 204 | index = 1 |
| 205 | new_path = f"{root}-{index}{ext}" |
| 206 | while os.path.exists(new_path): |
| 207 | index += 1 |
| 208 | new_path = f"{root}-{index}{ext}" |
| 209 | return new_path |
| 210 | |
| 211 | |
| 212 | def save_to_video(gen_lvideo, out_path, target_fps): |