SER.Lib 1.2.241

This package has a SemVer 2.0.0 package version: 1.2.241+adf6e4a49e545dc97142296119adca141f285160.
dotnet add package SER.Lib --version 1.2.241
                    
NuGet\Install-Package SER.Lib -Version 1.2.241
                    
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="SER.Lib" Version="1.2.241" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SER.Lib" Version="1.2.241" />
                    
Directory.Packages.props
<PackageReference Include="SER.Lib" />
                    
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 SER.Lib --version 1.2.241
                    
#r "nuget: SER.Lib, 1.2.241"
                    
#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 SER.Lib@1.2.241
                    
#: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=SER.Lib&version=1.2.241
                    
Install as a Cake Addin
#tool nuget:?package=SER.Lib&version=1.2.241
                    
Install as a Cake Tool

SER.Lib

A pure-managed reader and writer for the SER planetary-imaging video format (the Lucam Recorder format, spec v3).

SER is the de-facto container for lunar / planetary / solar lucky-imaging captures: thousands of raw mono, Bayer, or RGB frames in one file, with optional per-frame UTC timestamps. SER.Lib decodes and encodes it with memory-mapped, frame-accurate random access (seek to any frame in O(1), even in multi-gigabyte files), and is AOT- and trim-friendly with zero external dependencies.

Part of the SharpAstro family (alongside FITS.Lib). It is consumed by TianWen, whose tianwen-fits viewer opens SER captures as a frame sequence.

Install

dotnet add package SER.Lib

Quick start

using SharpAstro.Ser;

using var ser = SerReader.Open("jupiter.ser");

Console.WriteLine($"{ser.Width}x{ser.Height}  {ser.ColorId}  " +
                  $"{ser.PixelDepthPerPlane}-bit  {ser.FrameCount} frames");

// Random access: decode frame 1000 into a reusable buffer (no per-frame allocation).
var frame = new ushort[ser.Width * ser.Height * ser.ColorId.PlaneCount];
ser.ReadFrame16(index: 1000, frame);

// Per-frame UTC timestamps (when the file carries the optional trailer).
if (ser.HasTimestamps)
    Console.WriteLine(ser.Timestamps[1000].ToString("u"));

Writing:

using var w = new SerWriter("out.ser", width: 640, height: 480,
    colorId: SerColorId.BayerRGGB, pixelDepthPerPlane: 8);

foreach (var (bytes, time) in frames)
    w.AppendFrame(bytes, time);   // timestamps -> the v3 trailer on Close()

Slicing a frame range out of a (possibly multi-gigabyte) capture, e.g. to carve a small shareable clip. Frame bytes are copied verbatim -- no decode -- so the slice is loss-free for any bit depth or endianness, and the matching timestamps come along:

// 200 frames starting at frame 15000 -> a new, self-contained .ser
SerReader.Cut("jupiter.ser", "clip.ser", startFrame: 15000, count: 200);

// or from an already-open reader:
using var ser = SerReader.Open("jupiter.ser");
ser.CutTo("clip.ser", startFrame: 15000, count: 200);

Cropping every frame to a window, e.g. a small planet tracked across a whole-sensor capture. The crop is verbatim: the source's own header bytes with only the width and height changed (its padded strings and both start times as they were), each window as its bytes are stored, and the timestamp trailer plus anything after it byte for byte, so nothing is re-encoded. The callback places each frame's window as it is written; a Bayer mosaic's origin must be even, or the pattern would re-phase:

using var ser = SerReader.Open("jupiter.ser");
ser.CropTo("jupiter-crop.ser", width: 288, height: 304, originOf: i => TrackedOrigin(i));

Format notes & gotchas

The on-disk format is a fixed 178-byte little-endian header, the frame data, and an optional per-frame timestamp trailer. A few real-world subtleties SER.Lib handles for you:

  • The LittleEndian header flag is interpreted the way SER Player / PIPP do (the de-facto reference): for 16-bit data, LittleEndian == 0 means little-endian samples and LittleEndian == 1 means big-endian — the opposite of what the field name suggests. This is a well-known wart in the ecosystem; matching the reference players is what makes real captures display correctly. The header's own integers are always little-endian regardless of this flag.
  • Timestamps are .NET DateTime ticks (100 ns since 0001-01-01). SER.Lib surfaces them as UTC DateTimeOffsets, applying the same UTC-vs-local detection the reference player uses.
  • Frames are stored top-row-first (the first pixel is the upper-left); SER.Lib does not flip rows.
  • v2 vs v3: RGB/BGR true colour, arbitrary bit depths (1-16 with MSB/LSB alignment), and the timestamp trailer + UTC start time are v3 additions. SER.Lib reads v2 files (mono/Bayer, 8/16-bit, no trailer) transparently.

License

MIT - see LICENSE.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SER.Lib:

Package Downloads
TianWen.Lib

Astronomical imaging and device-control library for .NET: cameras, mounts, focusers, filter wheels, cover/calibrators and guiders over ASCOM, Alpaca, ZWO, QHYCCD, Meade LX200, Skywatcher, OnStep and PHD2, plus plate solving, deep-sky and planetary stacking, auto-focus and unattended session automation. First-class multi-OTA (dual rig) support. AOT compatible.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.241 845 10/14/2026
1.2.221 157 10/13/2026
1.2.211 1,365 10/10/2026
1.2.201 484 10/9/2026
1.2.191 1,106 10/4/2026
1.2.171 2,060 9/28/2026
1.1.151 4,773 8/20/2026
1.1.141 537 8/2/2026
1.1.131 524 7/4/2026
1.1.111 53 6/23/2026
1.0.91 267 6/23/2026
1.0.71 50 6/22/2026
1.0.51 62 6/22/2026
1.0.41 51 6/22/2026
1.0.31 54 6/22/2026
1.0.21 46 6/22/2026
1.0.11 54 6/22/2026