ShotDetector.FastYuv 3.30.0

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

ShotDetector.FastYuv

Optional fast path for ShotDetector: with it, ffmpeg sends raw yuv420p (or yuv422p) and ShotDetector converts only the ~7% of pixels its resize reads, instead of ffmpeg converting every full frame to BGR. Results are identical, and large video is faster (the current numbers: ShotDetector's weekly benchmarks).

using ShotDetector;
using ShotDetector.FastYuv;

var result = ShotDetection.Detect("video.mp4", new DetectionOptions { Yuv420Converter = new SwscaleYuv420() });

It also has Yadif, a port of FFmpeg's yadif deinterlacer, row by row: with in-process decoding and deinterlacing on, only the rows the resize reads are deinterlaced (identical results, and only those rows' work). It is a FrameReader IRowDeinterlacer, so a FrameDecoder takes it too (FrameDecoderOptions.RowDeinterlacer).

var result = ShotDetection.Detect("broadcast.mxf", new DetectionOptions { Deinterlace = DeinterlaceMode.Auto, Yadif = new Yadif() });

The converter is a bit-exact port of FFmpeg libswscale's yuv420p → BGR24 conversion as x86 runs it (verified for all 2^24 Y/U/V values), so this package is licensed under the GNU LGPL 2.1 or later (COPYING.LGPL). The ShotDetector package itself is MIT. It converts yuv422p (and yuvj422p) too: swscale runs the same converter for it, with a chroma row for every row (IYuv422Converter, which SwscaleYuv420 implements). Video that isn't 8-bit yuv420p or yuv422p, or 10-bit 4:2:0 (below), uses the normal path anyway. Rotated video is converted before it is turned, as OpenCV does, so turned video takes the fast path too. On ARM, where FFmpeg's own conversion rounds differently, it gives x86's results.

10-bit 4:2:0 (yuv420p10le, IYuv420P10Converter, which SwscaleYuv420 implements too) has no unscaled converter in swscale, so x86 scales it: the port follows that path (the bicubic chroma filters, interpolating from where the stream says the chroma sits; the MMXEXT vertical scaler and output; the C output for the last two rows), for even widths and any height, and gives x86's bytes there (checked against FFmpeg 8.1 on x86-64, generated and decoded frames). It exists for other CPUs' results; on x64 it gives the same results as the normal path at about the same speed. It converts a frame's pixels in one pass (IYuv420P10FrameConverter), filtering each chroma row once, as swscale does.

At an odd decoded height swscale can't take its unscaled converter for 8-bit 4:2:0 or 4:2:2 and scales instead, interpolating the chroma from where it sits: the 10-bit port runs those too, on the 8-bit samples widened to 10 bits (swscale's 8-bit and 10-bit horizontal scalers then give the same 15-bit rows), with 4:2:2's one-tap vertical output (yuv2bgr24_1) for 4:2:2 (IYuvOddHeightConverter, which SwscaleYuv420 implements; even widths).

Each converter also says which chroma rows converting a row reads (IYuvChromaRows), so decoding in-process ShotDetector copies, and with Yadif deinterlaces, only the rows it converts, not whole frames.

Copyright (C) 2001-2012 Michael Niedermayer, (C) 2009-2010 Konstantin Shishkov, (C) 2024 Niklas Haas (FFmpeg); yadif (C) 2006-2011 Michael Niedermayer, 2010 James Darnley (FFmpeg); C# port (C) 2026 Jakob Boman.

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.

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
3.30.0 0 11/6/2026
3.29.0 18 11/6/2026
3.28.0 595 11/3/2026
3.27.0 302 11/2/2026
3.26.0 267 11/1/2026
3.25.0 450 11/1/2026
3.24.0 351 10/31/2026
3.23.0 505 10/31/2026
3.22.0 335 10/30/2026
3.21.0 174 10/30/2026
3.20.1 180 10/29/2026
3.20.0 350 10/28/2026
3.19.0 309 10/28/2026
3.18.0 155 10/27/2026
3.17.0 339 10/27/2026
3.16.1 394 10/25/2026
3.16.0 178 10/25/2026
3.15.0 236 10/25/2026
3.14.0 318 10/24/2026
3.13.1 269 10/23/2026
Loading failed