https://github.com/lemutec/mediainfonet
The MediaInfoLib .NET Wrapper for Windows.
https://github.com/lemutec/mediainfonet
mediainfo mediainfodll mediainfolib
Last synced: 6 months ago
JSON representation
The MediaInfoLib .NET Wrapper for Windows.
- Host: GitHub
- URL: https://github.com/lemutec/mediainfonet
- Owner: lemutec
- License: bsd-2-clause
- Created: 2022-10-24T02:06:08.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-28T02:31:07.000Z (10 months ago)
- Last Synced: 2025-04-02T22:33:08.508Z (6 months ago)
- Topics: mediainfo, mediainfodll, mediainfolib
- Language: C#
- Homepage: https://nuget.org/packages/MediaInfoDLL
- Size: 37.8 MB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://nuget.org/packages/MediaInfoDLL) [](https://github.com/lemutec/MediaInfoNet/actions/workflows/library.nuget.yml) [](https://dotnet.microsoft.com/en-us/download/dotnet/latest/runtime)
# MediaInfoNet
Minimal MediaInfo .NET APIs wrapped from [MediaArea.net](https://mediaarea.net/en/MediaInfo/Download/Windows).
Support for Windows Vista, 7, 8, 10, 11 with x86, x64.
## Usage
1. Provide the Media Inform.
```c#
using MediaInfoLib;using MediaInfo lib = new();
lib.Open(@"C:\media.mp4");
Console.WriteLine(lib.Inform());
```Useful options.
```c#
using MediaInfoLib;using MediaInfo lib = new();
lib.Open(@"C:\media.mp4");
lib.Option("Complete", "1"); // Set complete output.
lib.Option("Inform", Inform_Format.HTML.ToString()); // Set format to HTML.
lib.Option("Language", Language_ISO639.ChineseSimplified.ToIso639()); // Set language to Chinese.
Console.WriteLine(lib.Inform());
```2. Check audio track exists.
```C#
using MediaInfoLib;using MediaInfo lib = new();
bool hasAudio = lib.WithOpen(fileName).Count_Get(StreamKind.Audio) > 0;
Console.WriteLine(hasAudio);
```3. Get audio track parameter.
```C#
using MediaInfoLib;using MediaInfo lib = new();
lib.Open(fileName);
_ = double.TryParse(lib.Get(StreamKind.Audio, 0, "BitRate"), out double bitRate);
Console.WriteLine(bitRate);
```## Examples
1. [ConsoleDemo](https://github.com/lemutec/MediaInfoNet/tree/main/demo/ConsoleDemo) for Console Application.
2. [WinFormsDemo](https://github.com/lemutec/MediaInfoNet/tree/main/demo/WinFormsDemo) for [WinForms](https://github.com/dotnet/winforms) Application.
3. [VSEnc](https://github.com/lemutec/VSEnc) for [WPF](https://github.com/dotnet/wpf) Application.
4. [LyricStudio](https://github.com/lemutec/LyricStudio) for [Avalonia](https://github.com/AvaloniaUI/Avalonia) Application.## References
https://github.com/MediaArea/MediaInfoLib/blob/master/Source/MediaInfo/MediaInfo_Config.h
https://github.com/MediaArea/MediaInfoLib/blob/master/Source/MediaInfo/File__Analyse_Automatic.h
https://github.com/MediaArea/MediaInfo/tree/master/Source/Resource/Plugin/Language
https://github.com/MediaArea/MediaInfo/blob/master/Source/Resource/Language.csv
## License
MediaInfoLib - https://github.com/MediaArea/MediaInfoLib
Copyright (c) MediaArea.net SARL. All Rights Reserved.
This program is freeware under BSD-2-Clause license conditions.
See License.html for more information