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

Encoder message error catching #107

Closed
piercus opened this issue Sep 20, 2022 · 1 comment
Closed

Encoder message error catching #107

piercus opened this issue Sep 20, 2022 · 1 comment

Comments

@piercus
Copy link
Contributor

piercus commented Sep 20, 2022

Hello,

Thanks for this great library.

I was wondering if it would be possible to catch the errors given.
When i'm setting up the parameters wronlgly, for the encoder, i'm often having important/interesting messages like

[mpeg2video @ 0x7fc8c00ba500] The encoder timebase is not set.

Next time when the system is logging

[NULL @ 0x7fc8c00ba500] No codec provided to avcodec_open2()

I see the message in the console, but i was wondering if there is any way to catch this message.

  • the code does not throw an error
  • I have checked in the encoder instance, and encoder.error is null

The only thing i could detect programmatically is an empty {packets: []}

Do you have any idea of how to detect/catch this kind of error from the code, instead of relying on the stdout/stderr.

Would it be technically feasible to add an event .on('error', err => {}) or .on('message', msg => {}) in the encoder ?

@piercus
Copy link
Contributor Author

piercus commented Oct 6, 2022

After seeing av_log_set_callback

It should be possible to add something like beamcoder.setLoggingCallback((message, level) => {})

piercus added a commit to piercus/beamcoder that referenced this issue Oct 7, 2022
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

1 participant