Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pengyouak opened this issue Oct 27, 2024 · 3 comments
Open
Labels
Milestone

Comments

@pengyouak
Copy link

Description:

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

@Breakthrough
Copy link
Owner

Breakthrough commented Oct 27, 2024

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.

@pengyouak
Copy link
Author

pengyouak commented Oct 27, 2024

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)

@Breakthrough
Copy link
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.

@Breakthrough Breakthrough reopened this Oct 30, 2024
@Breakthrough Breakthrough changed the title scenedetect.scene_manager.save_images cannot save images properly save_images API function does not work correctly with some characters Oct 31, 2024
@Breakthrough Breakthrough added this to the 0.6.5 milestone Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants