-
Notifications
You must be signed in to change notification settings - Fork 0
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
System.AccessViolationException on avcodec_open2 #38
Comments
Taking the error of nvenc
as clue, I can see this:
Any thoughts ? |
Your demo project works with RTX3000. And MX350 does not supports nvenc, only for nvdec: https://en.wikipedia.org/wiki/Nvidia_NVENC Would you try with an another card or check only for decoder? |
@hglee hey! My problem is really that a avcodec_open2 creates a crash that closes my app, when the command itself is producing some of these type of errors. Then I can’t just detect that avcodec_open2 has failed to act in consequence. This crash happens in some situations and I suppose it’s something memory related on how this wrapper and libav are interacting. |
I'll move question as it attracted some gravity, or you find bug in bindings - otherwise it is just usage of complex product. |
Thanks @Ruslan-B This type of crash happened to me in other situations that led on libav giving an internal error on avcodec_open2, instead of receiving the result as error it just crashes as something relative to memory interaction between libav and this wrapper. It may be an issue of different size of data types, but haven't found the exact explanation. I wanted to highlight that's not something that just happens when using this type of card or so, but something general to calling avcodec_open2 and getting an error in some situations. The case of using a MX350 is just a certain way to reproduce it. The main issue is as it crashes you haven't a way to act in consequence. |
Would you try ffmpeg DLL with master? There's some fix for nvenc after v6.0: https://trac.ffmpeg.org/ticket/10221 FYI, you can try OBS style device check: https://github.com/obsproject/obs-studio/blob/cb391a595d45aea0d710680c143eb90efe22998b/plugins/obs-ffmpeg/obs-ffmpeg.c#L61 |
I am using version v6.0.0.2 with the ffmpeg libraries that are https://github.com/Ruslan-B/FFmpeg.AutoGen/tree/v6.0.0.2 that I suppose are v6.0 ( as per its version ). Then I think your point is perfectly valid, I'll try with latest FFMpeg libraries when I've a minute. Thanks! The OBS style check may help here as well, thanks, however it's not enough as there are a lot of combinations of types of cards ( intel, amd and Nvidia. Plus intel + Nvidia and other hybrids ) and codecs configurations that may not be available or may fail and then at the end it would be needed to check the failure to fallback to software or to try something different. |
Note: for support questions, please use stackoverflow or special repository on [github.com](in special repository github.com). This repository's issues are reserved for feature requests and bug reports.
**I'm submitting a ... **
Do you want to request a feature or report a bug?
I want to report a bug.
Sometimes I got System.AccessViolationException when calling avcodec_open2, making impossible to catch the issue to fallback or to retry or so; as the application closes.
It happens to me time by time depending on the options I choose on the codec, but for example is reproducible 100% on a device that has a NVIDIA GeForce MX350 graphics card when I do select to open an h264_nvenc with mode AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX using AV_PIX_FMT_CUDA and AV_HWDEVICE_TYPE_CUDA.
But as I said, I think any problem that makes avcodec_open2 fail in a specific manner let me on a crash of this type.
Open the codec or getting a controlled error.
As currently is not usable.
I am using it on a Windows 11 device with NVIDIA GeForce MX350 graphics card.
Latest version v6.0.0.2
On FFmpeg logs I can see something like:
The crash I am getting.
I am reproducing it with this demo project:
GraphicsCheck.zip
The text was updated successfully, but these errors were encountered: