Popularity
1.9
Growing
Activity
9.0
Declining
46
4
5

Programming language: C#
License: BSD 3-clause "New" or "Revised" License
Tags: Media    

SeeShark alternatives and similar packages

Based on the "Media" category.
Alternatively, view SeeShark alternatives based on common mentions on social networks and blogs.

  • NAudio

    Audio and MIDI library for .NET
  • CSCore

    An advanced audio library, written in C#. Provides tons of features. From playing/recording audio to decoding/encoding audio streams/files to processing audio data in realtime (e.g. applying custom effects during playback, create visualizations,...). The possibilities are nearly unlimited.
  • Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
  • TagLib#

    Library for reading and writing metadata in media files
  • Xabe.FFmpeg

    .NET Standard wrapper for FFmpeg. It allows to process media without know how FFmpeg works, and can be used to pass customized arguments to FFmpeg from dotnet core application.
  • Audio Switcher

    .NET Library which facilitates interacting with Audio Devices on Windows
  • Bufdio

    A cross platform audio playback library for .NET with PortAudio and FFmpeg

Do you think we are missing an alternative of SeeShark or a related project?

Add another 'Media' Package

README

SeeShark

Simple C# camera library.

Discord NuGet

When you SeeShark, you C#!

SeeShark is a simple cross-platform .NET library for handling camera inputs on Linux, Windows and MacOS.

Using FFmpeg, it allows you to enumerate camera devices and decode raw frames in 199 different pixel formats (because that's how powerful FFmpeg is!).

Features include:

  • Zero-copy.
  • Memory-safe.
  • Cross platform (Tested on Windows and Linux, might work on more platforms like MacOS).
  • Managing camera devices.
  • Notifies the application if devices get connected/disconnected.
  • Event-driven code flow.
  • Supports 199 different pixel formats.
  • Conversion of a frame from a pixel format to another.
  • Scaling frames.
  • Access to raw pixel data.

Features don't include:

  • Saving a frame as an image (here's a wiki page on how to do it using ImageSharp).
  • Recording a camera stream to a video file.
  • Manage audio devices.

Example code

using System;
using System.Threading;
using SeeShark;
using SeeShark.FFmpeg;

namespace YourProgram
{
    // This program will display camera frames info for 10 seconds.
    class Program
    {
        static void Main(string[] args)
        {
            // Create a CameraManager to manage camera devices
            using var manager = new CameraManager();

            // Get the first camera available
            using var camera = manager.GetCamera(0);

            // Attach your callback to the camera's frame event handler
            camera.OnFrame += FrameEventHandler;

            // Start decoding frames
            camera.StartCapture();

            // The camera decodes frames asynchronously.
            Thread.Sleep(TimeSpan.FromSeconds(10));

            // Stop decoding frames
            camera.StopCapture();
        }

        // Create a callback for decoded camera frames
        public static void FrameEventHandler(object? _sender, FrameEventArgs e)
        {
            // Only care about new frames
            if (e.Status != DecodeStatus.NewFrame)
                return;

            Frame frame = e.Frame;

            // Get information and raw data from a frame
            Console.WriteLine($"New frame ({frame.Width}x{frame.Height} | {frame.PixelFormat})");
            Console.WriteLine($"Length of raw data: {frame.RawData.Length} bytes");
        }
    }
}

You can also look at our overcommented [SeeShark.Example.Ascii](./SeeShark.Example.Ascii/) program which displays your camera input with ASCII characters.

See demo of the example below.

ASCII output of OBS virtual camera, feat. Bad Apple!!


Contribute

You can request a feature or fix a bug by reporting an issue.

If you feel like fixing a bug or implementing a feature, you can fork this repository and make a pull request at any time!

You can also join our discord server where we talk about our different projects. This one has a particular #Project SeeShark thread that can be found under the #main channel.

License

This library is licensed under the BSD 3-Clause License. See [LICENSE](LICENSE) for details.


*Note that all licence references and agreements mentioned in the SeeShark README section above are relevant to that project's source code only.