All Projects → AydinAdn → Mediatoolkit

AydinAdn / Mediatoolkit

Licence: mit
A .NET library to convert and process all your video & audio files.

Projects that are alternatives of or similar to Mediatoolkit

Ffmediaelement
FFME: The Advanced WPF MediaElement (based on FFmpeg)
Stars: ✭ 733 (+48.98%)
Mutual labels:  audio, ffmpeg, mp3, mp4
Axiom
An FFmpeg GUI for Windows
Stars: ✭ 560 (+13.82%)
Mutual labels:  audio, ffmpeg, mp3, mp4
Ffmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
Stars: ✭ 27,382 (+5465.45%)
Mutual labels:  audio, ffmpeg, mp4
Spotivy
🎼 Download music videos from Spotify playlists
Stars: ✭ 64 (-86.99%)
Mutual labels:  audio, mp3, mp4
Av Converter
[av-converter.com] Audio and Video Converter, and YouTube downloader. Convert to MP3, MP4, AAC, FLAC, AC3, WAV, etc.
Stars: ✭ 97 (-80.28%)
Mutual labels:  audio, mp3, mp4
Music Metadata
Stream and file based music metadata parser for node. Supporting a wide range of audio and tag formats.
Stars: ✭ 455 (-7.52%)
Mutual labels:  audio, mp3, mp4
Trinity
android video record editor muxer sdk
Stars: ✭ 609 (+23.78%)
Mutual labels:  audio, ffmpeg, mp4
Mediaelement Files
Sample media files (MP4, WebM, Ogv, MP3, etc.) for the MediaElement.js library
Stars: ✭ 92 (-81.3%)
Mutual labels:  audio, mp3, mp4
Ni Media
NI Media is a C++ library for reading and writing audio streams.
Stars: ✭ 158 (-67.89%)
Mutual labels:  audio, mp3, mp4
Audioplayer
Audio Player for Nextcloud and ownCloud
Stars: ✭ 179 (-63.62%)
Mutual labels:  audio, mp3, mp4
Awesome Video
A curated list of awesome streaming video tools, frameworks, libraries, and learning resources.
Stars: ✭ 397 (-19.31%)
Mutual labels:  audio, ffmpeg, mp4
Symphonia
Pure Rust multimedia format demuxing, tag reading, and audio decoding library
Stars: ✭ 191 (-61.18%)
Mutual labels:  audio, mp3, mp4
Youtube2audio
Desktop application to download YouTube videos as annotated MP3 or MP4 files
Stars: ✭ 128 (-73.98%)
Mutual labels:  ffmpeg, mp3, mp4
Sjmediacacheserver
A HTTP Media Caching Framework. It can cache FILE or HLS media. 音视频边播边缓存框架, 支持 HLS(m3u8) 和 FILE(mp4, mp3等).
Stars: ✭ 87 (-82.32%)
Mutual labels:  audio, mp3, mp4
Mediafile
A unified reader of metadata from audio & video files.
Stars: ✭ 138 (-71.95%)
Mutual labels:  audio, mp3, mp4
Atldotnet
Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
Stars: ✭ 180 (-63.41%)
Mutual labels:  audio, mp3, mp4
Swiftffmpeg
A Swift wrapper for the FFmpeg API
Stars: ✭ 243 (-50.61%)
Mutual labels:  audio, ffmpeg, mp4
Androidffmpeg
android 读取摄像头和麦克风,使用rtmp推流
Stars: ✭ 298 (-39.43%)
Mutual labels:  audio, ffmpeg
Flutter Assetsaudioplayer
Play simultaneously music/audio from assets/network/file directly from Flutter, compatible with android / ios / web / macos, displays notifications
Stars: ✭ 458 (-6.91%)
Mutual labels:  audio, mp3
Blank Audio
Set of blank MP3 audio files
Stars: ✭ 452 (-8.13%)
Mutual labels:  audio, mp3

Update 19/Feb/2020

There's breaking changes on the way, when MediaToolkit was initially developed it was meant to act as facade over the FFmpeg library, providing a simplified interface to perform the most basic tasks of converting media.

Since then, there's been demands for new features, demands for updates of the original FFmpeg executables, demands for custom code executions and with each new feature the original code base has been getting more bloated and difficult to maintain, the Engine class has turned into a god class essentially and there's no easy way for clients to plugin their own arguments without modifying the original code base, the new update aims to resolve all of that.

Changes going forwards:

  • Conversion methods have been extracted out into separate classes deriving from IInstructionBuilder, so whether if you want to crop a video you would use the CropVideoInstructionBuilder, if you wanted to extract a thumbnail, ExtractThumbnailInstructionBuilder, etc. You can also obviously implement your own instructions as long as it implements IInstructionBuilder.
  • Added logging functionality to log traces of the raw output received by the FFmpeg process.
  • Added FFprobe for querying the Metadata of media files.
  • MediaFile classes will no longer be used, the reason for this change is because it relies on FFmpeg for querying metadata and it's difficult to make it work reliably across different types of files as the output from FFmpeg is difficult to parse and it doesn't really expose all that much information anyway. What's recommended is using FFprobe instead.

You can track its progress in the MajorRefactoring branch. You're welcome to get involved, if you see opportunities to break dependencies without adding great deals of complexity, let me know.

MediaToolkit

MediaToolkit provides a straightforward interface for handling media data, making tasks such as converting, slicing and editing both audio and video completely effortless.

Under the hood, MediaToolkit is a .NET wrapper for FFmpeg; a free (LGPLv2.1) multimedia framework containing multiple audio and video codecs, supporting muxing, demuxing and transcoding tasks on many media formats.

Contents

  1. Features
  2. Get started!
  3. Samples
  4. Licensing

Features

  • Resolving metadata
  • Generating thumbnails from videos
  • Transcode audio & video into other formats using parameters such as:
    • Bit rate
    • Frame rate
    • Resolution
    • Aspect ratio
    • Seek position
    • Duration
    • Sample rate
    • Media format
  • Convert media to physical formats and standards such as:
    • Standards include: FILM, PAL & NTSC
    • Mediums include: DVD, DV, DV50, VCD & SVCD
  • Supports custom FFmpeg command line arguments
  • Raising progress events

Get started!

Install MediaToolkit from NuGet using the Package Manager Console with the following command (or search on NuGet MediaToolkit)

PM> Install-Package MediaToolkit

Samples

Grab thumbnail from a video

var inputFile = new MediaFile {Filename = @"C:\Path\To_Video.flv"};
var outputFile = new MediaFile {Filename = @"C:\Path\To_Save_Image.jpg"};

using (var engine = new Engine())
{
    engine.GetMetadata(inputFile);
    
    // Saves the frame located on the 15th second of the video.
    var options = new ConversionOptions { Seek = TimeSpan.FromSeconds(15) };
    engine.GetThumbnail(inputFile, outputFile, options);
}

Retrieve metadata

var inputFile = new MediaFile {Filename = @"C:\Path\To_Video.flv"};

using (var engine = new Engine())
{
    engine.GetMetadata(inputFile);
}

Console.WriteLine(inputFile.Metadata.Duration);

Basic conversion

var inputFile = new MediaFile {Filename = @"C:\Path\To_Video.flv"};
var outputFile = new MediaFile {Filename = @"C:\Path\To_Save_New_Video.mp4"};

using (var engine = new Engine())
{
    engine.Convert(inputFile, outputFile);
}

Convert Flash video to DVD

var inputFile = new MediaFile {Filename = @"C:\Path\To_Video.flv"};
var outputFile = new MediaFile {Filename = @"C:\Path\To_Save_New_DVD.vob"};

var conversionOptions = new ConversionOptions
{
    Target = Target.DVD, 
    TargetStandard = TargetStandard.PAL
};

using (var engine = new Engine())
{
    engine.Convert(inputFile, outputFile, conversionOptions);
}

Transcoding options FLV to MP4

var inputFile = new MediaFile {Filename = @"C:\Path\To_Video.flv"};
var outputFile = new MediaFile {Filename = @"C:\Path\To_Save_New_Video.mp4"};

var conversionOptions = new ConversionOptions
{
    MaxVideoDuration = TimeSpan.FromSeconds(30),
    VideoAspectRatio = VideoAspectRatio.R16_9,
    VideoSize = VideoSize.Hd1080,
    AudioSampleRate = AudioSampleRate.Hz44100
};

using (var engine = new Engine())
{
    engine.Convert(inputFile, outputFile, conversionOptions);
}

Cut video down to smaller length

var inputFile = new MediaFile {Filename = @"C:\Path\To_Video.flv"};
var outputFile = new MediaFile {Filename = @"C:\Path\To_Save_ExtractedVideo.flv"};

using (var engine = new Engine())
{
    engine.GetMetadata(inputFile);

    var options = new ConversionOptions();
    
    // This example will create a 25 second video, starting from the 
    // 30th second of the original video.
    //// First parameter requests the starting frame to cut the media from.
    //// Second parameter requests how long to cut the video.
    options.CutMedia(TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(25));

    engine.Convert(inputFile, outputFile, options);
}

Subscribe to events

public void StartConverting()
{
    var inputFile = new MediaFile {Filename = @"C:\Path\To_Video.flv"};
    var outputFile = new MediaFile {Filename = @"C:\Path\To_Save_New_Video.mp4"};
    
    using (var engine = new Engine())
    {
        engine.ConvertProgressEvent += ConvertProgressEvent;
        engine.ConversionCompleteEvent += engine_ConversionCompleteEvent;
        engine.Convert(inputFile, outputFile);
    }
}

private void ConvertProgressEvent(object sender, ConvertProgressEventArgs e)
{
    Console.WriteLine("\n------------\nConverting...\n------------");
    Console.WriteLine("Bitrate: {0}", e.Bitrate);
    Console.WriteLine("Fps: {0}", e.Fps);
    Console.WriteLine("Frame: {0}", e.Frame);
    Console.WriteLine("ProcessedDuration: {0}", e.ProcessedDuration);
    Console.WriteLine("SizeKb: {0}", e.SizeKb);
    Console.WriteLine("TotalDuration: {0}\n", e.TotalDuration);
}

private void engine_ConversionCompleteEvent(object sender, ConversionCompleteEventArgs e)
{
    Console.WriteLine("\n------------\nConversion complete!\n------------");
    Console.WriteLine("Bitrate: {0}", e.Bitrate);
    Console.WriteLine("Fps: {0}", e.Fps);
    Console.WriteLine("Frame: {0}", e.Frame);
    Console.WriteLine("ProcessedDuration: {0}", e.ProcessedDuration);
    Console.WriteLine("SizeKb: {0}", e.SizeKb);
    Console.WriteLine("TotalDuration: {0}\n", e.TotalDuration);
}

Licensing

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].