Prepare output path.
(output_path, overwrite)
| 237 | |
| 238 | |
| 239 | def _prepare_output_path(output_path, overwrite): |
| 240 | """Prepare output path.""" |
| 241 | prepare_output_path(output_path, |
| 242 | allowed_suffix=['.mp4', ''], |
| 243 | tag='output video', |
| 244 | path_type='auto', |
| 245 | overwrite=overwrite) |
| 246 | # output_path is a directory |
| 247 | if check_path_suffix(output_path, ['']): |
| 248 | temp_folder = output_path |
| 249 | os.makedirs(temp_folder, exist_ok=True) |
| 250 | else: |
| 251 | temp_folder = output_path + '_temp_images' |
| 252 | if check_path_existence(temp_folder, 'dir') in [ |
| 253 | Existence.DirectoryExistNotEmpty, Existence.DirectoryExistEmpty |
| 254 | ]: |
| 255 | shutil.rmtree(temp_folder) |
| 256 | os.makedirs(temp_folder, exist_ok=True) |
| 257 | return temp_folder |
| 258 | |
| 259 | |
| 260 | def _check_frame_path(frame_list): |
no test coverage detected