Gallery

mmalsharp

mmalsharp

Builds for the mmalsharp library

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:

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-2019 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.

Read more...

It's kind of empty out here...

Package Id Latest Version
Uploaded rss
MMALSharp

Authored by: Ian Auty

MMALSharp brings low level access to the Raspberry Pi camera module in C#. Based on the native MMAL library, MMALSharp allows you to configure a rich set of camera/sensor related settings via an easy to use asynchronous API.

0.7.0-380 4 years ago
MMALSharp.Common

Authored by: Ian Auty

MMALSharp common library.

0.7.0-380 4 years ago
MMALSharp.FFmpeg

Authored by: Ian Auty

FFmpeg support library for MMALSharp.

0.7.0-380 4 years ago
MMALSharp.Processing

Authored by: Ian Auty

Image Processing library for MMALSharp.

0.7.0-380 4 years ago

Connect to feed

By: techyian

Total download count: 49

Readonly