- Home /
Canon EDSDK integration with Unity
Hi,
I've faced a problem when trying integrate Canon EDSDK C# wrapper with Unity's Mono. Used C# wrapped and code which handles this wrapper was successfuly working on .NET. WPF application captures photos, takes Live View. But when I try to launch the same code bundle on Unity, I am having an issue with saving photo on PC's HDD. Unity handler script is successfuly initializing EDSDK library and sending command to camera. So far it's all Ok, but when camera takes a photo, and tries to save it on Host, it fails. At the camera's small screen starts to blink icon which says there is not enough space on disk. On another camera (also Canon), in the same situation there was poping up text "PC FULL". In the same time camera is successfuly saving photos on internal storage (SD), even when code is executed in Unity environment.
I have stuck on the issue and have no idea how to fix it. Please, help!
What I've tried:
run Unity with administrator rights
set all existing rights to all
existing users of OS for photo saving folderplay with EDSDK
CanonCamera.SetCapacity(int, int)
method, setting different values for params
I always get "internal_error" when trying to initilialize the Canon SD$$anonymous$$. Can you share some more info what you did? It works fine as a Winforms/WPF application but not in Unity.
Answer by huyakinemota · Oct 08, 2017 at 02:18 PM
Hi, yes. Not straight solution, but a workaround using additional .NET process. In my case it's .NET console application, which is being launched by Unity in particular conditions. This additional application process uses C# EDSDK wrapper and handles Canon camera Live View. Then it streams Live View images bytes using Tcp Socket into Unity. Something like TCP Client-Server principle. This way console application plays like a feeder, sending data, and within Unity Socket listener receives data and uses it.
Actually, i don't have this issue yet. I just wondered if it's even possible to work with EDSD$$anonymous$$ inside Unity. But hey, thanks for responce! Btw, It's possible to stream live view directly from EDSD$$anonymous$$ to Unity, do you mean something else?
Hi. I think it's possible, because some people say that one guy made EDSD$$anonymous$$ working straightly within Unity in production project. Personally, I had no idea how to integrate EDSD$$anonymous$$ correctly into Unity. It's works great in .NET, but raises much issues in Unity. So if you some day will get it, let me know also. I would be grateful to you.
Hi, I am facing the same challenges. Would you have an example of your code that you could share? Thank you!
Hi, I am trying to use EDSD$$anonymous$$ in Unity too!!! I don't have the issue and successfully taking photo and starting liveview!!! However, when I build it and run the exe program, it will get stuck/freeze. When I click "open session" The UI and other Gameobject will stop working totally, EXCEPT the ApiThread which still looping. Did you have same issue like $$anonymous$$e?
$$anonymous$$$$anonymous$$JasonLi, which version of Unity you are using?
maybe you are making build incorrectly? wrong architecture selected?
@$$anonymous$$$$anonymous$$JasonLi can you share what you did that EDSD$$anonymous$$ runs in unity? $$anonymous$$y initilization always throws "INTERNAL_ERROR"
Answer by doc-zoidberg · Aug 14, 2018 at 04:29 PM
@huyakinemota I use the wrapper from here: https://www.codeproject.com/Articles/688276/Canon-EDSDK-Tutorial-in-Csharp?msg=5256579 and copied all necessary dlls in the assets folder. I use the 64bit binaries.
The ddls. work without problems as winforms/wpf application.
But initializing the SDK from a unity plugin throws "INTERNAL_ERROR". I tried also the initialization from a new Thread/STAThread without success.
I have the same problem with the official wrappers included in the sdk
I have exactly the same problem. I used the same Tutorial. If you could manage to solve this problem, could you help me to find the answer, please?
Answer by thecloob · Jul 16, 2018 at 07:18 AM
I'm just getting started with EDSDK / Unity integration on Mac OSX. Can you guys share a few bits of how to get started with this? Can't seem to get the external framework/bundle to be read by Unity. Any help/examples would be amazing!
try out EDSD$$anonymous$$ C# wrapper with Unity 2017+ .NET 4.* framework. maybe it would go on it, as C# wrapper is written in C# 6.0
Your answer
Follow this Question
Related Questions
How do I use .NET as a Scripting Backend on PC, Mac & Linux Standalone? 0 Answers
How do you integrate the EPPlus library into Unity? 2 Answers
How to build windows 8.1 phone game in unity 3d 5.3 ? 0 Answers
Complex numbers? 2 Answers
What are the steps required to integrate StartApp's SDK for Unity? 0 Answers