Closed HexagramNM closed 2 weeks ago
What do you mean by "another web camera"? I can't easily reproduce this, so it's difficult to determine from where it's coming.
My machine (laptop) has an embeded web camera, and I meant it. The crash seems to occur when both the web camera and the virtual camera is running.
I have no idea where the problem can come from. I've been running a camera, discord (or other), vcamsample etc for a long time and it don't see any problem.
Thank you for your trying. In that case, it may be a problem of my environment...
Once, I close this issue. If I have any update, I'll let you know.
Hi. I investigated the problem and I found one of the cause. So, I reopen this issue.
In FremeGenerator.cpp, you called lock->Release()
.
https://github.com/smourier/VCamSample/blob/f006d573edebe7c4b8f0d8a79299438205e77224/VCamSampleSource/FrameGenerator.cpp#L289
com_ptr_nothrow<IWICBitmapLock>
, which is the type of lock
, calls Release
method in its destructor, too. Therefore, Release
method for lock
is called twice, and it sometimes causes crash. To delete lock
object explicitly, you should use lock.reset()
instead.
I think this fix also solves my problem.
Indeed, I'm juggling with all kinds of smart pointers with different semantics in my projects... This was changed in this commit https://github.com/smourier/VCamSample/commit/62654a648186b02a557a059c01f8a229c0a333e7
This was changed in this commit https://github.com/smourier/VCamSample/commit/62654a648186b02a557a059c01f8a229c0a333e7
Great! Thank you for the commit. I'll close this issue.
Thank you for publishing your sample on virtual camera using media foundation api. This is very helpful for me!
I find a rare crash bug around the virtual camera.
How to reproduce
Open windows camera application, and show a video from another web camera.
Start VCamSample.
Use its virtual camera in application. I use Discord.
Randomly, frame server crashes, and a video from the virtual camera stops. (Sometimes, it took several tens of minutes to reproduce the crash...)
When I run only VCamSample and don't use another web camera, I don't find the crash.
Error report from Reliability monitor
But I found other errors with different exception codes (c0000374, c0000005) and fault modules (StackHash, VCamSampleSource.dll.)
Machine spec where the crash occurs
OS: Windows 11 Home (23H2) CPU: 13th Gen Intel(R) Core(TM) i7-13700H 2.40 GHz RAM: 32GB GPU: NVIDIA GeForce RTX 4060 Laptop GPU
I think it can be a bug of Windows frame server, but do you know any information or limitation?