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

Do not modify the ffmpeg_args in reencode function #144

Closed
benoit74 opened this issue Feb 27, 2024 · 0 comments · Fixed by #145
Closed

Do not modify the ffmpeg_args in reencode function #144

benoit74 opened this issue Feb 27, 2024 · 0 comments · Fixed by #145
Assignees
Labels
bug Something isn't working
Milestone

Comments

@benoit74
Copy link
Collaborator

Since 3.3.0, the reencode function (or more exactly the private _build_ffmpeg_args function) is auto-magically adding the -threads argument to the passed ffmpeg_args:

if threads:
if "-threads" in ffmpeg_args:
raise AttributeError("Cannot set the number of threads, already set")
else:
ffmpeg_args += ["-threads", str(threads)]

This causes issues like openzim/kolibri#89 where since we are retrying to encode the video multiple times, the same dictionary is modified twice.

I think that reencode function should not modify the passed dictionary but its own copy.

I add this to the 3.4.0 for now, but clearly deserve a 3.3.1 patch I think.

WDYT?

@benoit74 benoit74 added the bug Something isn't working label Feb 27, 2024
@benoit74 benoit74 added this to the 3.4.0 milestone Feb 27, 2024
@benoit74 benoit74 self-assigned this Feb 27, 2024
@benoit74 benoit74 modified the milestones: 3.4.0, 3.3.1 Feb 27, 2024
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.

1 participant