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

Long Video might fail to maketile due to the jpeg format #91

Closed
runck opened this issue May 29, 2022 · 3 comments · Fixed by #92
Closed

Long Video might fail to maketile due to the jpeg format #91

runck opened this issue May 29, 2022 · 3 comments · Fixed by #92
Assignees
Labels
bug Something isn't working

Comments

@runck
Copy link

runck commented May 29, 2022

Problem:
When I try to get the hash of a long video (about 90 min), it turns out errors when making tile:
"encoder error -2 when writing image file" and
"Maximum supported image dimension is 65500 pixels".

My solution now:
Instead of just changing the frame_interval to shorten the width, I found that it might be a limit of the jpeg format.
So the solution I am using is to change the default output of the function "make_tile" in "tilemaker.py" to png format:
save_tiles(tiles, prefix="tile", directory=tiles_dir, file_format="png")

Suggestion:
Now, there is no error. However, I am not sure if this will affect the hash value (as generated with jpeg format), or if any confilct to any part of this lib.
As I notice the default parameter of "file_format" in th function "save_tiles" is already png, I am confused why the jpeg format is explictly given in the function "make_tile".
If there is no other problem, maybe using png as the default in "make_tile" is better considering some long videos?

Thank you!

@runck runck added the bug Something isn't working label May 29, 2022
@akamhy akamhy self-assigned this May 29, 2022
@akamhy
Copy link
Owner

akamhy commented May 29, 2022

I was aware of the limit of jpeg but didn't thought it would be an issue with the tiles, of course I'm wrong as longer video duration will not only result in a wider horizontally_concatenated_image.png but also generate wider tiles.

self.horizontally_concatenated_image_path = os.path.join(
self.horizontally_concatenated_image_dir,
"horizontally_concatenated_image.png",
)

@akamhy
Copy link
Owner

akamhy commented May 29, 2022

^ Now, there is no error. However, I am not sure if this will affect the hash value (as generated with jpeg format), or if any confilct to any part of this lib.

It didn't affect the test cases, also even if it results in some pixel column in a different tile than in the jpeg codec it can't change the dominant colour.

@runck
Copy link
Author

runck commented Jun 2, 2022

That's good news. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants