DoenaSoft.CalculateDvdDiscId
1.0.6
dotnet add package DoenaSoft.CalculateDvdDiscId --version 1.0.6
NuGet\Install-Package DoenaSoft.CalculateDvdDiscId -Version 1.0.6
<PackageReference Include="DoenaSoft.CalculateDvdDiscId" Version="1.0.6" />
<PackageVersion Include="DoenaSoft.CalculateDvdDiscId" Version="1.0.6" />
<PackageReference Include="DoenaSoft.CalculateDvdDiscId" />
paket add DoenaSoft.CalculateDvdDiscId --version 1.0.6
#r "nuget: DoenaSoft.CalculateDvdDiscId, 1.0.6"
#:package DoenaSoft.CalculateDvdDiscId@1.0.6
#addin nuget:?package=DoenaSoft.CalculateDvdDiscId&version=1.0.6
#tool nuget:?package=DoenaSoft.CalculateDvdDiscId&version=1.0.6
Calculate Video DVD Disc Id
A .NET library that implements the Windows disc ID calculation algorithm for video DVDs, based on US patent 6,871,012 B1.
Overview
Cataloguing software uses algorithms to uniquely identify discs inserted into a PC's drive. These algorithms differ for audio CDs, video DVDs, and video Blu-rays. For video DVDs, Windows traditionally provided the IDvdInfo2::GetDiscID COM interface to generate a consistent identifier for each physical disc.
This library recreates the original Windows disc ID calculation algorithm, which worked reliably from Windows XP through Windows 10 version 1803. It also provides a method to reproduce the modified behavior introduced in Windows 10 version 1809 that broke compatibility with many cataloging applications.
The Problem
The IDvdInfo2::GetDiscID interface (https://docs.microsoft.com/en-us/windows/win32/api/strmif/nf-strmif-idvdinfo2-getdiscid) worked correctly on:
- Windows XP
- Windows Vista
- Windows 7
- Windows 8.x
- Windows 10 (up to version 1803)
Windows 10 version 1809 introduced a breaking change: Microsoft modified the disc ID calculation algorithm, causing the same physical DVD to generate different disc IDs depending on the Windows version. This broke cataloging software that relied on consistent disc identification across systems.
A bug report was filed with Microsoft: https://aka.ms/AA6144x
The Solution
This library implements the original patent-based algorithm, allowing applications to:
- Generate disc IDs that match the original Windows XP-10.1803 behavior
- Maintain compatibility with existing disc databases and cataloging systems
- Optionally reproduce the Windows 10.1809+ behavior for testing purposes
Algorithm Details
The disc ID calculation is based on US patent 6,871,012 B1: http://patentimages.storage.googleapis.com/pdfs/US6871012.pdf
Original Algorithm (Windows XP - 10.1803)
The calculation follows these steps:
Collect and Sort Files: All files in the
VIDEO_TSfolder are enumerated and sorted alphabetically (case-insensitive).Hash File Metadata: For each file, the following metadata is hashed using CRC64:
- Creation timestamp: 64-bit value representing 100-nanosecond intervals since January 1, 1601 UTC (Windows FILETIME format)
- File size: 32-bit unsigned integer (bytes)
- File name: UTF-8 encoded, converted to uppercase
- Null terminator: Single zero byte
All values are stored in little-endian (LSB first) byte order.
Include VIDEO_TS.IFO Content: If the file
VIDEO_TS\VIDEO_TS.IFOexists, read up to 65,536 bytes from the beginning and include in the hash.Include First VTS File Content: Find the first
VIDEO_TS\VTS_xx_0.IFOfile (alphabetically), read up to 65,536 bytes, and include in the hash.Compute CRC64: All hash components are concatenated and processed through a CRC64 algorithm to produce the final 16-character hexadecimal disc ID (e.g.,
0123456789ABCDEF).
Modified Algorithm (Windows 10.1809+)
The Windows 10 version 1809 update changed step 1 to only include files matching these patterns:
VIDEO_TS.*(all files starting with VIDEO_TS)VTS_01_0.*(all files starting with VTS_01_0)
This reduced file set leads to different disc IDs for the same physical media.
Installation
Install via NuGet:
dotnet add package DoenaSoft.CalculateDvdDiscId
Or through the NuGet Package Manager:
Install-Package DoenaSoft.CalculateDvdDiscId
Usage
Calculate Disc ID (Original Algorithm)
using DoenaSoft.CalculateDvdDiscId;
// Use drive letter
string discId = DvdDiscIdCalculator.Calculate("D:");
// Or use full drive path
string discId = DvdDiscIdCalculator.Calculate("D:\\");
Calculate Disc ID (Windows 10.1809+ Algorithm)
using DoenaSoft.CalculateDvdDiscId;
// Reproduce Windows 10.1809+ behavior
string discId = DvdDiscIdCalculator.CalculateForWin10_1809_AndHigher("D:");
Error Handling
using System;
using DoenaSoft.CalculateDvdDiscId;
try
{
string discId = DvdDiscIdCalculator.Calculate("D:");
Console.WriteLine($"Disc ID: {discId}");
}
catch (ArgumentException ex)
{
// Handle errors:
// - Invalid or empty drive letter
// - Drive not ready (no disc inserted)
// - Drive does not contain a VIDEO_TS folder
Console.WriteLine($"Error: {ex.Message}");
}
Technical Details
File Name Normalization
The DVD standard mandates uppercase file names in the UDF filesystem. The algorithm converts all file names to uppercase before processing to ensure:
- Consistent results across different disc authoring tools
- Compatibility with non-compliant DVDs that may use mixed case
CRC64 Implementation
The library uses a table-driven CRC64 algorithm with a 256-entry lookup table for efficient hash computation. The implementation is based on: https://github.com/rdp/dvdid/blob/master/0.2.0a/dvdid-0.2.0a/src/libdvdid/crc64_table.c
Supported Frameworks
- .NET Framework 4.7.2
- .NET Standard 2.0 (compatible with .NET Core 2.0+, .NET 5+, Xamarin, etc.)
- .NET 10.0
Real-World Applications
This library is useful for:
- DVD cataloging software: Maintain consistent disc identification across Windows versions
- Media library management: Track owned physical media
- Disc verification: Confirm disc identity against existing databases
- Compatibility testing: Compare disc IDs between different Windows versions
Why This Matters
Video DVD collectors and enthusiasts use cataloging software (like DVD Profiler, Collectorz, etc.) to manage their physical media libraries. These applications identify discs by their disc ID to automatically download metadata (cover art, cast, plot summaries, etc.).
When Microsoft changed the disc ID algorithm in Windows 10.1809:
- Discs previously catalogued appeared as "new" discs with different IDs
- Metadata associations were lost
- Users had to manually re-catalog their entire collections
- Cross-platform database synchronization broke
This library restores the original behavior, allowing continued use of existing cataloging systems.
License
MIT License - See LICENSE file for details
Author
DJ Doena - Doena Soft.
Links
- GitHub Repository: https://github.com/DJDoena/Calculate-Video-DVD-Disc-Id
- NuGet Package: https://www.nuget.org/packages/DoenaSoft.CalculateDvdDiscId
- US Patent 6,871,012 B1: http://patentimages.storage.googleapis.com/pdfs/US6871012.pdf
- Microsoft Bug Report: https://aka.ms/AA6144x
- IDvdInfo2::GetDiscID Documentation: https://docs.microsoft.com/en-us/windows/win32/api/strmif/nf-strmif-idvdinfo2-getdiscid
Contributing
Contributions, bug reports, and feature requests are welcome! Please submit them through the GitHub repository.
Version History
1.0.6 - Current release
- Enhanced code documentation with detailed inline comments
- Improved CRC64 algorithm explanation
- Code quality improvements
1.0.5
- Support for .NET Framework 4.7.2, .NET Standard 2.0, and .NET 10.0
- Comprehensive XML documentation
- Both original and Windows 10.1809+ algorithm implementations
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.