Skip to content

save_images API function does not work correctly with some characters #450

Closed

Description

@pengyouak

Description:

If the output dir contains Chinese, the image cannot be saved properly

Activity

  1. Breakthrough commented on Oct 27, 2024

    @Breakthrough
    Owner

    Can you provide a sample stack trace of what error you get? It would be good to know if this is coming from OpenCV or something PySceneDetect is doing with the paths.

  2. pengyouak commented on Oct 27, 2024

    @pengyouak
    Author

    I have tested the PySenceDetect function locally and it can print the path normally. The problem may occur with cv2.iwrite. There is no error output when calling save_images.

    cv2.imwrite(get_and_create_path(file_path, output_dir), frame_im, imwrite_param)

  3. Breakthrough commented on Oct 30, 2024

    @Breakthrough
    Owner

    I suspected so, I audited the code paths, and PySceneDetect tries to be good about respecting UTF-8 characters in paths. We can probably work around this issue by writing to an in-memory buffer and then saving that to disk separate.

  4. changed the title [-]scenedetect.scene_manager.save_images cannot save images properly[/-] [+]`save_images` API function does not work correctly with some characters[/+] on Oct 31, 2024
  5. added this to the 0.6.5 milestone on Oct 31, 2024
  6. added a commit that references this issue on Nov 10, 2024
    e441b8c
  7. Breakthrough commented on Nov 10, 2024

    @Breakthrough
    Owner

    I should have a fix for this in the next version. During the process I was also able to make it multithreaded so now the save-images command should run close to 40% faster in some cases.

  8. added a commit that references this issue on Nov 10, 2024
    54c0a00
  9. pengyouak commented on Nov 10, 2024

    @pengyouak
    Author

    非常感谢你能修复这个问题,这能让我减少很多不必要的麻烦~

  10. added a commit that references this issue on Nov 14, 2024
    b599345
  11. added 2 commits that reference this issue on Nov 24, 2024
    67913b9
    95091f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions