Soenneker.Utils.File.Types 4.0.1669

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Utils.File.Types --version 4.0.1669
                    
NuGet\Install-Package Soenneker.Utils.File.Types -Version 4.0.1669
                    
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="Soenneker.Utils.File.Types" Version="4.0.1669" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.File.Types" Version="4.0.1669" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Utils.File.Types" />
                    
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 Soenneker.Utils.File.Types --version 4.0.1669
                    
#r "nuget: Soenneker.Utils.File.Types, 4.0.1669"
                    
#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 Soenneker.Utils.File.Types@4.0.1669
                    
#: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=Soenneker.Utils.File.Types&version=4.0.1669
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.File.Types&version=4.0.1669
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Utils.File.Types

Case-insensitive extension classification for common video, audio, subtitle, and artwork files, plus recursive video discovery.

Installation

dotnet add package Soenneker.Utils.File.Types

Registration

builder.Services.AddFileTypeUtilAsSingleton();

Scoped registration is also available with AddFileTypeUtilAsScoped().

Classify extensions and paths

bool videoExtension = fileTypes.IsVideoExtension(".mkv");
bool audioExtension = fileTypes.IsAudioExtension(".flac");
bool subtitleExtension = fileTypes.IsSubtitleExtension(".vtt");
bool artworkExtension = fileTypes.IsImageExtension(".jpg");

bool videoFile = fileTypes.IsVideoFile(@"C:\media\movie.MP4");
bool imageFile = fileTypes.IsImageFile("poster.png");

Extension methods expect the leading period; pass .mp4, not mp4. File methods extract the extension from the supplied path or name. Matching is ordinal and case-insensitive.

Classification is based only on the name. It does not inspect file signatures, MIME types, codecs, or file contents and must not be used as a security validation boundary for uploads.

Discover video files

List<FileInfo> videos = await fileTypes.GetAllVideoFiles(mediaDirectory);

await foreach (FileInfo video in fileTypes.EnumerateVideoFiles(mediaDirectory))
{
    Console.WriteLine(video.FullName);
}

Both APIs first materialize a recursive file snapshot, skipping inaccessible directories and reparse points, and then filter it by extension. EnumerateVideoFiles() exposes async iteration but does not provide true filesystem streaming or cancellation.

Container codecs

if (fileTypes.TryGetContainerMediaSet(".mkv", out MediaFormatSet? formats) == true)
{
    IReadOnlyList<string> videoCodecs = formats.VideoCodecs;
    IReadOnlyList<string> audioCodecs = formats.AudioCodecs;
}

Container lookup requires the leading period and only contains explicitly defined mappings. The returned codec lists are defensive copies and can be modified without changing later lookups. They describe the library's known mapping, not the codecs actually present in a particular file.

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
4.0.1676 39 9/5/2026
4.0.1675 39 9/4/2026
4.0.1674 36 9/4/2026
4.0.1673 39 9/4/2026
4.0.1672 41 9/4/2026
4.0.1671 37 9/4/2026
4.0.1670 44 9/4/2026
4.0.1669 82 9/1/2026
4.0.1668 71 8/31/2026
4.0.1667 76 8/31/2026
4.0.1666 85 8/31/2026
4.0.1665 85 8/31/2026
4.0.1664 78 8/30/2026
4.0.1663 75 8/30/2026
4.0.1662 83 8/30/2026
4.0.1661 112 8/30/2026
4.0.1660 83 8/30/2026
4.0.1659 76 8/29/2026
4.0.1658 81 8/29/2026
4.0.1657 81 8/29/2026
Loading failed

Updated NuGet packages