Speykious / SeeShark

Simple C# camera library.
BSD 3-Clause "New" or "Revised" License
146 stars 13 forks source link

Build Errors #49

Open zhou123aw opened 1 year ago

zhou123aw commented 1 year ago

Hi,

I am just trying to build a simple example project,I don't know if I have to do any configuration before build.

I have errors about CameraManager.

Any help about run a simple project should be helpful.

Thanks.

20230904150321

Speykious commented 1 year ago

Damn, I can't believe I didn't put instructions on how to make sure the examples run. Sorry about that. 7_7

SeeShark requires FFmpeg to run properly. You can download FFmpeg binaries here. The code is currently tied to FFmpeg v5.0. Try to see if version 6.0 or 5.1 work, if not then I guess you'll have to download a 5.0 version.

There are comments in the example codes to specify where to look for the FFmpeg libraries.

zhou123aw commented 1 year ago

I download FFmpeg binaries,but I don't know how to load it. I just only want a simple project for a WPF/C# application. Could you give me any hints to run a simple project with minimal code, please?

Speykious commented 1 year ago

SeeShark.Example.Ascii is a simple example project inside this repo. I recommend trying to run that project before making one of your own if you have issues loading the FFmpeg libraries. You should be able to just run that with Visual Studio, since it seems that's what you're using, by just loading the solution file of this repo once you have it downloaded.

To load the FFmpeg binaries, it's actually very simple: take a look at https://github.com/Speykious/SeeShark/blob/cc4aa3b69053f08c92b77528ab95d326c91d7f72/SeeShark.Example.Ascii/Program.cs#L33-L40 You can see a call to SetupFFmpeg with a minimal FFmpeg log level, a console text color, and then a few paths. These paths are what SeeShark uses to search for the FFmpeg binaries you just downloaded. So for example, if inside of your project folder you make a ffmpeg-libs folder and unzip the FFmpeg libraries* there, then you would add the path to that ffmpeg-libs folder inside the call to SetupFFmpeg and it should then just work.

* the FFmpeg libraries should be .dll files, notably from the ffmpeg-release-full-shared.7z download link, inside the bin/ folder in the archive, with names like avcodec-??.dll, avdevice-??.dll, etc.