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

cannot access local variable 'res' where it is not associated with a value #250

Open
blueroutecn opened this issue Jul 11, 2024 · 1 comment

Comments

@blueroutecn
Copy link

ComfyUI-VideoHelperSuite\videohelpersuite\utils.py", line 172, in get_audio
match = re.search(', (\d+) Hz, (\w+), ',res.stderr.decode('utf-8'))
^^^
UnboundLocalError: cannot access local variable 'res' where it is not associated with a value

How to fix it.

AustinMroz added a commit that referenced this issue Jul 11, 2024
The prior implementation made a best effort to continue in the event of
an error, but immediately threw an error afterwards since there was no
output from the subprocess.

As get_audio isn't called until the audio connection from a Load Video
is used, it's safe to raise an exception here and properly expose the
error message from ffmpeg as is done elsewhere.

See #250
@AustinMroz
Copy link
Collaborator

There's an error being thrown by ffmpeg when it tries to decode audio, which the current code was handling improperly.

I've pushed an update to properly expose what that error is, but you'll likely need to share what that new error message is.

GentlemanHu pushed a commit to GentlemanHu/ComfyUI-VideoHelperSuite that referenced this issue Jul 14, 2024
The prior implementation made a best effort to continue in the event of
an error, but immediately threw an error afterwards since there was no
output from the subprocess.

As get_audio isn't called until the audio connection from a Load Video
is used, it's safe to raise an exception here and properly expose the
error message from ffmpeg as is done elsewhere.

See Kosinkadink#250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants