mmalsharp - MMALSharp.Processing 0.7.0-360

Image Processing library for MMALSharp.

PM> Install-Package MMALSharp.Processing -Version 0.7.0-360 -Source https://www.myget.org/F/mmalsharp/api/v3/index.json

Copy to clipboard

> nuget.exe install MMALSharp.Processing -Version 0.7.0-360 -Source https://www.myget.org/F/mmalsharp/api/v3/index.json

Copy to clipboard

> dotnet add package MMALSharp.Processing --version 0.7.0-360 --source https://www.myget.org/F/mmalsharp/api/v3/index.json

Copy to clipboard
<PackageReference Include="MMALSharp.Processing" Version="0.7.0-360" />
Copy to clipboard
source https://www.myget.org/F/mmalsharp/api/v3/index.json

nuget MMALSharp.Processing  ~> 0.7.0-360
Copy to clipboard

> choco install MMALSharp.Processing --version 0.7.0-360 --source https://www.myget.org/F/mmalsharp/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "mmalsharp" -SourceLocation "https://www.myget.org/F/mmalsharp/api/v2"
Install-Module -Name "MMALSharp.Processing" -RequiredVersion "0.7.0-360" -Repository "mmalsharp" -AllowPreRelease
Copy to clipboard

MMALSharp - C# wrapper to Broadcom's MMAL and API to the Raspberry Pi camera

Build status Join the chat at https://gitter.im/MMALSharp/Lobby

If you like this project, please support it by giving it a star! GitHub stars

MMALSharp is a C# wrapper around the MMAL library designed by Broadcom. It exposes many elements of MMAL and in addition provides an easy to use, asynchronous API to the Raspberry Pi Camera Module. The library targets .NET Standard 2.0 and is compatible with Mono 5.4/.NET Core 2.0 or greater runtimes.

Installation

MMALSharp NuGet package: NuGet version

PM> Install-Package MMALSharp

MMALSharp.FFmpeg NuGet package: NuGet version

PM> Install-Package MMALSharp.FFmpeg

Pre-release builds can be found on MyGet:

Logging configuration

For v0.6, MMALSharp now uses Microsoft.Extensions.Logging.Abstractions to provide package agnostic logging. If you want to enable logging, you must provide the ILoggerFactory instance your client application is using. For .NET Core applications, this will typically be done during dependency injection configuration. For more information, please see here.

Below is an example on how to configure NLog in a .NET Core 3.0+ console app. Note: the ILoggerFactory instance should be set before carrying out any MMALSharp specific operations:

var loggerFactory = LoggerFactory.Create(builder =>
{

	builder                
	.ClearProviders()
	.SetMinimumLevel(LogLevel.Trace)                
	.AddNLog("NLog.config");
});

MMALLog.LoggerFactory = loggerFactory;

Also see here for full NLog integration instructions.

Basic Examples

Take a JPEG image using YUV420 encoding:


public void TakePicture()
{
    // Singleton initialized lazily. Reference once in your application.
    MMALCamera cam = MMALCamera.Instance;

    using (var imgCaptureHandler = new ImageStreamCaptureHandler("/home/pi/images/", "jpg"))        
    {            
        await cam.TakePicture(imgCaptureHandler, MMALEncoding.JPEG, MMALEncoding.I420);
    }
    
    // Cleanup disposes all unmanaged resources and unloads Broadcom library. To be called when no more processing is to be done
    // on the camera.
    cam.Cleanup();
}

Take a H.264 video using YUV420 encoding at 30 fps:


public void TakeVideo()
{
    // Singleton initialized lazily. Reference once in your application.
    MMALCamera cam = MMALCamera.Instance;

    using (var vidCaptureHandler = new VideoStreamCaptureHandler("/home/pi/videos/", "avi"))        
    {    
        var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
                
        await cam.TakeVideo(vidCaptureHandler, cts.Token);
    }   

    // Cleanup disposes all unmanaged resources and unloads Broadcom library. To be called when no more processing is to be done
    // on the camera.
    cam.Cleanup();
}

Documentation

For full installation instructions for Mono and .NET Core, including configuration and examples - please visit the Wiki.

License

MIT license

Copyright (c) 2016-2020 Ian Auty

Raspberry Pi is a trademark of the Raspberry Pi Foundation

Contributors

I want to say a big thank you to those of you who have helped develop MMALSharp over the years, your contributions are most appreciated. In addition, I'd like to say thanks to Dave Jones @waveform80 for your work on picamera which gave me the inspiration to start this project.

  • .NETStandard 2.0
    • Microsoft.Extensions.Logging.Abstractions (>= 3.1.0)
    • MMALSharp.Common (>= 0.7.0-360)
    • Mono.Posix.NETStandard (>= 1.0.0)
    • System.Drawing.Common (>= 4.7.0)
    • System.Threading.Channels (>= 4.7.1)
  • .NETStandard 2.0: 2.0.0.0

Owners

techyian

Authors

Ian Auty

Project URL

https://github.com/techyian/MMALSharp

License

MIT

Tags

raspberry-pi

Info

8 total downloads
0 downloads for version 0.7.0-360
Download (28.26 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
0.7.0-380 33.83 KB Thu, 15 Oct 2020 14:03:16 GMT 4
0.7.0-379 33.83 KB Thu, 15 Oct 2020 11:46:39 GMT 0
0.7.0-378 33.83 KB Thu, 15 Oct 2020 11:36:56 GMT 0
0.7.0-377 33.83 KB Thu, 15 Oct 2020 11:27:35 GMT 0
0.7.0-376 33.83 KB Wed, 14 Oct 2020 13:01:01 GMT 0
0.7.0-375 33.83 KB Mon, 12 Oct 2020 18:34:52 GMT 0
0.7.0-374 33.84 KB Mon, 12 Oct 2020 08:50:09 GMT 0
0.7.0-365 28.3 KB Sat, 12 Sep 2020 15:12:41 GMT 0
0.7.0-362 28.27 KB Thu, 03 Sep 2020 13:30:58 GMT 1
0.7.0-360 28.26 KB Sun, 30 Aug 2020 14:17:59 GMT 0
0.7.0-358 27.57 KB Sat, 29 Aug 2020 14:19:20 GMT 0
0.7.0-353 27.57 KB Sun, 23 Aug 2020 13:10:07 GMT 0
0.7.0-345 27.15 KB Mon, 17 Aug 2020 19:08:44 GMT 0
0.7.0-339 26.86 KB Mon, 03 Aug 2020 13:53:48 GMT 0
0.7.0-336 27.04 KB Mon, 27 Jul 2020 13:59:34 GMT 0
0.7.0-331 26.07 KB Tue, 21 Jul 2020 10:36:11 GMT 0
0.7.0-330 26.04 KB Mon, 20 Jul 2020 19:47:50 GMT 0
0.7.0-324 21.13 KB Sat, 16 May 2020 19:36:40 GMT 0
0.7.0-323 21.13 KB Sat, 16 May 2020 18:56:00 GMT 0
0.7.0-322 21.13 KB Fri, 15 May 2020 19:21:15 GMT 0
0.7.0-321 21.13 KB Mon, 11 May 2020 18:12:44 GMT 0
0.7.0-320 21.12 KB Sun, 10 May 2020 15:02:29 GMT 0
0.7.0-319 21.13 KB Sun, 10 May 2020 14:55:04 GMT 0
0.7.0-318 21.13 KB Sun, 10 May 2020 14:50:10 GMT 0
0.7.0-317 21.13 KB Sat, 09 May 2020 15:14:47 GMT 0
0.7.0-316 21.13 KB Thu, 07 May 2020 21:03:37 GMT 0
0.7.0-315 21.13 KB Thu, 07 May 2020 18:24:32 GMT 0
0.7.0-314 21.13 KB Thu, 07 May 2020 13:34:51 GMT 0
0.7.0-313 21.13 KB Mon, 04 May 2020 18:33:48 GMT 0
0.7.0-312 21.13 KB Tue, 14 Apr 2020 13:06:47 GMT 0
0.6.0 19.87 KB Mon, 02 Mar 2020 20:57:47 GMT 0
0.6.0-311 21.15 KB Mon, 13 Apr 2020 19:25:53 GMT 0
0.6.0-310 20.7 KB Mon, 13 Apr 2020 11:48:15 GMT 0
0.6.0-309 20.7 KB Sun, 12 Apr 2020 20:54:59 GMT 0
0.6.0-308 20.7 KB Sat, 11 Apr 2020 12:15:20 GMT 0
0.6.0-307 20.7 KB Wed, 08 Apr 2020 18:21:15 GMT 0
0.6.0-306 20.7 KB Mon, 02 Mar 2020 21:42:21 GMT 0
0.6.0-304 20.7 KB Mon, 02 Mar 2020 20:55:18 GMT 0
0.6.0-303 20.7 KB Thu, 27 Feb 2020 12:35:32 GMT 0
0.6.0-302 20.11 KB Thu, 27 Feb 2020 10:09:36 GMT 0
0.6.0-301 20.11 KB Wed, 26 Feb 2020 12:53:26 GMT 0
0.6.0-300 20.11 KB Wed, 26 Feb 2020 10:11:00 GMT 0
0.6.0-299 20.08 KB Tue, 25 Feb 2020 19:59:07 GMT 0
0.6.0-298 20.03 KB Tue, 25 Feb 2020 19:51:56 GMT 0
0.6.0-297 20.21 KB Sat, 18 Jan 2020 17:20:23 GMT 1
0.6.0-296 20.19 KB Fri, 17 Jan 2020 11:43:31 GMT 0
0.6.0-295 20.2 KB Fri, 17 Jan 2020 11:32:30 GMT 0
0.6.0-294 20.2 KB Fri, 17 Jan 2020 11:24:42 GMT 0
0.6.0-293 20.19 KB Wed, 08 Jan 2020 06:06:52 GMT 2
0.6.0-292 20.19 KB Tue, 07 Jan 2020 20:54:13 GMT 0
0.6.0-291 20.19 KB Mon, 06 Jan 2020 21:17:55 GMT 0
0.6.0-290 20.2 KB Thu, 02 Jan 2020 22:30:46 GMT 0
0.6.0-289 20.2 KB Thu, 02 Jan 2020 18:38:14 GMT 0
0.6.0-288 20.16 KB Wed, 01 Jan 2020 19:11:36 GMT 0
0.6.0-287 20.16 KB Wed, 01 Jan 2020 19:10:22 GMT 0
0.6.0-286 20.15 KB Tue, 31 Dec 2019 22:00:17 GMT 0
0.6.0-285 20.16 KB Tue, 31 Dec 2019 18:38:26 GMT 0
0.6.0-284 20.16 KB Tue, 31 Dec 2019 18:37:35 GMT 0
0.6.0-283 20.16 KB Mon, 30 Dec 2019 21:57:31 GMT 0
0.6.0-282 20.16 KB Mon, 30 Dec 2019 21:34:41 GMT 0
0.6.0-281 20.16 KB Mon, 30 Dec 2019 18:27:16 GMT 0
0.6.0-280 20.14 KB Mon, 30 Dec 2019 15:06:15 GMT 0
0.6.0-279 20.12 KB Mon, 30 Dec 2019 14:49:49 GMT 0
0.6.0-278 20.12 KB Mon, 30 Dec 2019 14:47:35 GMT 0
0.6.0-277 20.12 KB Mon, 30 Dec 2019 14:27:21 GMT 0
0.6.0-276 20.08 KB Mon, 30 Dec 2019 11:14:51 GMT 0
0.6.0-275 20.16 KB Mon, 30 Dec 2019 09:57:11 GMT 0
0.6.0-274 20.15 KB Mon, 30 Dec 2019 09:42:25 GMT 0
0.6.0-273 20.09 KB Mon, 30 Dec 2019 08:45:42 GMT 0
0.6.0-272 20.09 KB Sun, 29 Dec 2019 15:55:44 GMT 0
0.6.0-271 20.09 KB Sat, 28 Dec 2019 19:58:06 GMT 0
0.6.0-270 20.08 KB Sat, 28 Dec 2019 19:36:52 GMT 0
0.6.0-269 20.09 KB Sat, 28 Dec 2019 11:40:25 GMT 0
0.6.0-268 20.05 KB Tue, 24 Dec 2019 21:26:41 GMT 0
0.6.0-267 20.06 KB Tue, 24 Dec 2019 21:02:27 GMT 0
0.6.0-266 20.05 KB Fri, 20 Dec 2019 22:15:35 GMT 0
0.6.0-265 20.06 KB Fri, 20 Dec 2019 19:23:00 GMT 0
0.6.0-264 20.06 KB Wed, 18 Dec 2019 22:05:10 GMT 0
0.6.0-263 38 KB Sun, 15 Dec 2019 18:19:16 GMT 0
0.6.0-262 37.88 KB Thu, 12 Sep 2019 20:49:32 GMT 0
0.6.0-261 37.88 KB Thu, 12 Sep 2019 20:47:12 GMT 0
0.6.0-260 37.88 KB Thu, 12 Sep 2019 20:23:37 GMT 0
0.6.0-259 37.88 KB Thu, 12 Sep 2019 20:20:59 GMT 0
0.6.0-258 37.88 KB Wed, 11 Sep 2019 22:04:48 GMT 0
0.5.1 24.85 KB Sun, 14 Jul 2019 18:56:31 GMT 0
0.5.1-255 25.56 KB Tue, 25 Jun 2019 20:20:58 GMT 0
0.5.1-253 25.56 KB Tue, 25 Jun 2019 20:10:49 GMT 0
0.5.0 23.47 KB Thu, 24 Jan 2019 20:51:54 GMT 0
0.5.0-252 25.55 KB Tue, 18 Jun 2019 09:46:37 GMT 0
0.5.0-251 25.54 KB Mon, 08 Apr 2019 21:16:40 GMT 0
0.5.0-250 25.54 KB Mon, 08 Apr 2019 21:02:27 GMT 0
0.5.0-249 25.54 KB Mon, 08 Apr 2019 15:26:10 GMT 0
0.5.0-248 25.55 KB Mon, 08 Apr 2019 15:20:10 GMT 0
0.5.0-247 25.55 KB Sun, 07 Apr 2019 20:23:34 GMT 0
0.5.0-246 24.27 KB Fri, 05 Apr 2019 19:32:44 GMT 0
0.5.0-245 24.09 KB Thu, 24 Jan 2019 21:15:16 GMT 0
0.5.0-243 24.1 KB Thu, 24 Jan 2019 20:50:19 GMT 0