MP-MediaInfo is .NET wrapper for MediaArea MediaInfo and use native packages and .
Framework | Package |
---|---|
.NET Framework 4.0 | |
.NET Framework 4.5 | |
.NET Standard 2.0 | |
.NET Standard 2.1 | |
.NET 5.0 | |
.NET 6.0 |
There are 2 packages for .NET Core and .NET Framework. If your project is designed to run only on Windows and you are not using .NET Core, use the .NET Framework package. .NET Core package is designed for ASP.NET Core services only.
dotnet add package MediaInfo.Wrapper.Core --version 21.9.3
Install-Package MediaInfo.Wrapper -Version 21.9.3
Add to usings:
using MediaInfo;
Instantiate an object of class MediaInfoWrapper
, providing the full path to the media file and logger instance if it is required.
var media = new MediaInfoWrapper(mediaFileLocation);
Check successfully parsing of the parameters of the media file.
if (media.Success)
{
...
}
Retrieve technical and tag data from the video or audio file:
var containerFormat = media.Format;
var mediaHasVideo = media.HasVideo;
var videoBitRate = media.VideoRate;
foreach (var stream in media.AudioStreams)
{
var codec = stream.Codec;
}
ASP.NET Core demo application is available which shows the usage of the package, serialization and running from the docker container. Code from this demo should not be used in production code, the code is merely to demonstrate the usage of this package.
Make sure that the following dependencies are installed in the operating system before starting the project
.NET Core package supports next operating systems
Operation system | Version |
---|---|
MacOS | 10.15 (Catalina), 11 (Big Sur) |
Ubuntu | 16.04, 18.04, 20.04 and 21.04 |
CenOS | 7 and above |
Fedora | 32 and above |
OpenSUSE | 15.2 and Tumbleweed |
RedHat | 7 and above |
Debian | 9 and above |
Arch Linux | |
Windows | 7 and above |
Docker | buster |
Some dependencies are available with MacPorts. To install MacPorts: https://guide.macports.org/#installing
port install zlib curl zenlib
sudo apt-get update
sudo apt-get install libzen0v5 libmms0 zlib1g zlibc libnghttp2-14 librtmp1 curl libcurl4-gnutls-dev libglib2.0-dev
sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum -y update
sudo yum -y install zlib curl libzen bzip2 libcurl
sudo rpm -ivh https://download1.rpmfusion.org/free/el/updates/7/x86_64/l/libmms-0.6.4-2.el7.x86_64.rpm
sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo yum -y update
sudo yum -y install zlib curl libzen bzip2 libcurl
sudo rpm -ivh https://download1.rpmfusion.org/free/el/updates/8/x86_64/l/libmms-0.6.4-8.el8.x86_64.rpm
sudo dnf update
sudo dnf -y install zlib curl libzen openssl libmms
sudo zypper refresh
sudo zypper update -y
sudo zypper install -y zlib curl libmms0 openssl libnghttp2-14
sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum -y update
sudo yum -y install zlib curl libzen bzip2 libcurl
sudo rpm -ivh https://download1.rpmfusion.org/free/el/updates/7/x86_64/l/libmms-0.6.4-2.el7.x86_64.rpm
sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo yum -y update
sudo yum -y install zlib curl libzen bzip2 libcurl
sudo rpm -ivh https://download1.rpmfusion.org/free/el/updates/8/x86_64/l/libmms-0.6.4-8.el8.x86_64.rpm
sudo apt-get update
sudo apt-get install libzen0v5 libmms0 openssl zlib1g zlibc libnghttp2-14 librtmp1 curl libcurl4-gnutls-dev libglib2.0
Windows package contains all dependencies and does not required any actions.
sudo pacman -Syu
sudo pacman -S libcurl-gnutls libzen libmms libssh librtmp0
FROM mcr.microsoft.com/dotnet/aspnet:3.1
RUN apt-get update && apt-get install -y libzen0v5 libmms0 openssl zlib1g zlibc libnghttp2-14 librtmp1 curl libcurl4-gnutls-dev libglib2.0
FROM mcr.microsoft.com/dotnet/aspnet:5.0
RUN apt-get update && apt-get install -y libzen0v5 libmms0 openssl zlib1g zlibc libnghttp2-14 librtmp1 curl libcurl4-gnutls-dev libglib2.0
FROM mcr.microsoft.com/dotnet/aspnet:6.0
RUN apt-get update && apt-get install -y libzen0v5 libmms0 openssl zlib1g zlibc libnghttp2-14 librtmp1 curl libcurl4-gnutls-dev libglib2.0