def clean_temp_dir(temp_dir: Optional[str] = None):
    """Removes media files from the video frames directory."""
    if temp_dir is None:
        temp_dir = TEMP_VIDEO_FRAMES_DIR
        temp_out_dir = TEMP_VIDEO_OUT_FRAMES_DIR
    else:
        temp_out_dir = os.path.join(temp_dir, "out")

    clean_files_with_extension(temp_dir, SOUND_FILE_EXT)
    clean_files_with_extension(temp_dir, IMAGE_FILE_EXT)

    if os.path.exists(temp_out_dir):
        clean_files_with_extension(temp_out_dir, IMAGE_FILE_EXT)
Removes media files from the video frames directory.
modules/utils/video_helper.py