SeeShark 4.1.0

dotnet add package SeeShark --version 4.1.0
                    
NuGet\Install-Package SeeShark -Version 4.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SeeShark" Version="4.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SeeShark" Version="4.1.0" />
                    
Directory.Packages.props
<PackageReference Include="SeeShark" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SeeShark --version 4.1.0
                    
#r "nuget: SeeShark, 4.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SeeShark@4.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SeeShark&version=4.1.0
                    
Install as a Cake Addin
#tool nuget:?package=SeeShark&version=4.1.0
                    
Install as a Cake Tool

SeeShark

Simple C# camera and display library.


SeeShark is currently being rewritten from scratch without using FFmpeg. It will become a library with zero third-party dependencies and rely solely on ones readily available on your OS.

SeeShark now has a Discord server so that I can provide more direct support to the best of my availability.


When you SeeShark, you C#!

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

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

Features include:

  • Control framerate, resolution and input format.
  • Notify the application if devices get connected/disconnected.
  • 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 video stream to a video file.
  • Managing audio devices.

Cross-platform support

SeeShark has been confirmed to work on Linux and Windows.

Unfortunately, it doesn't work on MacOS. Long story short, FFmpeg 5 doesn't implement device enumeration for MacOS, and SeeShark doesn't implement a custom function to do that.

FFmpeg

SeeShark 4 depends on FFmpeg 5. You can get binaries here:

  • Windows: ffmpeg 5.1.2 builds (ffmpeg-5.1.2-full_build-shared.zip)
  • Linux: last time I tried, it was a disaster and I had to download several dependencies of libav* myself. Let me know if you can find an easy solution.

The important elements are the libav* DLLs/shared libraries: | | Windows | Linux | | -------- | ----------------- | ------------------- | | avcodec | avcodec-59.dll | libavcodec.so.59 | | avdevice | avdevice-59.dll | libavdevice.so.59 | | avformat | avformat-59.dll | libavformat.so.59 | | swscale | swscale-6.dll | libswscale.so.6 |

You can ignore executables like ffmpeg or ffplay as they are not used by SeeShark.

If you get an error message about a module's dependency potentially missing, you might need to specify a LD_LIBRARY_PATH environment variable:

LD_LIBRARY_PATH=/path/to/libs:$LD_LIBRARY_PATH

Example code

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

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 asynchronously
        camera.StartCapture();

        // Just wait a bit
        Thread.Sleep(TimeSpan.FromSeconds(10));

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

    // Create a callback for decoded camera frames
    private 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 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!

Vignette

This library was previously hosted on https://github.com/vignetteapp/SeeShark. It was first made to be used in Vignette's vtuber application. Now, it is its own self-contained library!

License

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

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.1.0 267 11/11/2025
4.0.0 1,798 10/30/2022
3.1.0 791 2/23/2022
3.0.0 1,083 2/19/2022
2.2.0 519 12/15/2021
2.0.1 465 12/5/2021
2.0.0 435 12/5/2021
1.0.0 1,995 11/26/2021