Video Converter for .NET FFMpeg C# wrapper
features C# video library
- FFMpeg .NET wrapper: convert (encode,decode) almost all known video and audio formats (mp4,mp3,h264,wmv,wav,avi,flv,mov,mkv,webm,ogg and many others)
- no memory leaks: ffmpeg is executed in a separate process (via System.Diagnostics.Process) and your .NET app remains fully isolated.
- all ffmpeg command-line options are supported
- can resize/crop/cut/split/merge video files, combine video and audio from different files, transcode live video stream from C# Stream input (Webcam, RTSP URL, file) to C# Stream output (streaming server URL, file)
- easy to use video conversion .NET library: all you need is one assembly (FFMpeg is embedded into DLL and extracted on first use)
-
Usage examples (C# / NET8):
- Concat: merge several videos into one resulting file (with complex filter and 'concat' demuxer)
- CutCropResize: code snippets to cut/crop/resize videos
- VideoWatermark: apply watermark to the video (PNG image or just a text)
- DemoMvc: Convert any video file to MP4/FLV, extract video thumbnail, apply video watermark image (online demo code)
- ConvertProgressWinForms: convert video with progress bar in a separate thread (WinForm app)
- LiveStreamMvc: on-the-fly live stream transcoding for HTML5 video (ASP.NET MVC app)
- LiveStreamRecognition: decode h264 stream and get frames as Bitmaps for further processing (for video recognition or extracting sequence of video thumbnails for every minute) as C# Bitmap objects (console app)
- LiveStreamFromImages: encode live video stream from images (Bitmap objects, without temp files). Can be used for creating animated GIFs.
- Rotate: detect video clip orientation and perform necessary rotation
- ScreenCapture: record desktop (with mouse moves) and save as mp4 video + softly stop encoding process by sending Ctrl+C signal
download and pricing
Video Converter examples
advanced examples with source code (C# / NET8), NO support |
FREE Download |
Video Converter enterprise source code pack
Includes: component source code (C#), a commercial license that allows code modification / multiple deployments / SaaS usage, a license key for LT version , a 1-year subscription for email support and downloads |
$199 - Order Now |
quick purchase process
- 1 Choose a package
- 2 Pay online
- 3 Download the package
Video Converter provides C# API for executing FFMpeg process from .NET applications. FFMpeg can convert video files,
resize/cut/combine video, get video thumbnail, capture screen, create video from images, decode video frames as bitmaps etc.
how to use
- Add a reference to NReco.VideoConverter nuget package
- Convert video to MP4 by executing FFMpeg process with one line of C# code:
var ffMpeg = new NReco.VideoConverter.FFMpegConverter(); ffMpeg.ConvertMedia(pathToVideoFile, "video.mp4", Format.mp4);
- Get video thumbnail (C#):
ffMpeg.GetVideoThumbnail(pathToVideoFile, "video_thumbnail.jpg");
-
Feel free to contact usWhat's next:
in case of any questions.
online video converter demo
frequently asked questions
VideoConverter can be used for FREE in non-SaaS .NET apps that have only one single-server production deployment.
A commercial license (included into "enterprise source code" pack) is required for:
A commercial license (included into "enterprise source code" pack) is required for:
- Applications for external redistribution (ISV), multiple deployments
- Usage in SaaS apps
- Non-Windows deployments that are supported with NReco.VideoConverter.LT nuget
- Email support/assistance (support is NOT available for free users)
VideoConverter is based on FFMpeg tool; this tool supports almost all known video and audio formats (detailed
list of supported formats: ffmpeg.exe -formats and ffmpeg.exe -codecs).
VideoConverter executes FFMpeg in a separate process (via System.Diagnostics.Process API)
and your hosting environment/platform should allow that. This might be not possible in the following cases:
Linux/MacOS
Non-Windows deployments are supported with NReco.VideoConverter.LT nuget: this is a version without ffmpeg.exe, it expects that ffmpeg is deployed separately and suitable for Linux/Docker or MacOS, or if you want to use a specific ffmpeg version/build.
NET8+
Starting from version 1.2.0 you can use NReco.VideoConverter nuget in modern .NET apps and get leverages of simplified deployment (no need to deploy ffmpeg.exe separately). This nuget can be used only for Windows deployments.
- partial-trust environments: most shared ASP.NET hostings
- Azure Apps on 'shared' plan. Azure Apps with VM-based plan ('Basic' or higher) can run tasks automated with VideoConverter.
- UWP Apps (System.Diagnostics.Process API is not available).
Linux/MacOS
Non-Windows deployments are supported with NReco.VideoConverter.LT nuget: this is a version without ffmpeg.exe, it expects that ffmpeg is deployed separately and suitable for Linux/Docker or MacOS, or if you want to use a specific ffmpeg version/build.
NET8+
Starting from version 1.2.0 you can use NReco.VideoConverter nuget in modern .NET apps and get leverages of simplified deployment (no need to deploy ffmpeg.exe separately). This nuget can be used only for Windows deployments.
The following code snippet illustrates how to do that with VideoConverter:
var ffmpeg = new NReco.VideoConverter.FFMpegConverter(); ffmpeg.ConvertMedia( new [] { new FFMpegInput("video.mp4"), new FFMpegInput("audio.mp3") }, "result.mp4", null, new ConvertSettings() { AudioCodec = "copy", // or audio codec for re-encoding VideoCodec = "copy", // or video codec for re-encoding CustomOutputArgs = " -map 0:v:0 -map 1:a:0 " });
Normally VideoConverter works with files but some tasks require real-time processing of media stream
(usually this is video/audio broadcast or webcam stream). Live stream data is processed as it comes;
its duration is not known in advance.
NOTE: not all media formats could be used with as live streams (for example, MP4 format can be processed only as file).
NOTE: not all media formats could be used with as live streams (for example, MP4 format can be processed only as file).
FFMpeg can generate video from files with special image2 demuxer and this can be achieved with
VideoCoverter. As alternative VideoConverter can generate live video stream from Bitmap objects (package
includes special example for this use case).
Yes it is possible to consume live stream and get each frame as Bitmap in C# code for further real-time processing
(video recognition, for instance). Package includes special example for this use case.
Yes you can use VideoConverter for creating animated GIFs from existing video clip or bitmaps (images):
var ffmpeg = new FFMpegConverter(); ffmpeg.ConvertMedia("your_clip.mp4", null, "result.gif", null, new ConvertSettings() );To avoid huge size of resulting GIF file better to descrease frame rate and resulting GIF frame size. Also note that GIF image can have only 256 (!) colors; this means that if your video has a lot of different colours it might look weird when converted to GIF. You can get nice-looking GIFs using 2-pass approach that generates optimal palette for GIF file first.
what's new
2023 Apr 13 | v.1.2.1:
|
2023 Jan 18 | v.1.2.0:
|
2020 Jan 23 | v.1.1.4:
|
2018 Jun 12 | v.1.1.3:
|
2017 Jan 14 | v.1.1.2:
|
2016 Jul 04 | v.1.1.1:
|
2016 Apr 19 | v.1.1.0:
|
2015 Dec 14 | v.1.0.9:
|
2015 Sep 22 | v.1.0.8:
|
2015 Aug 07 | v.1.0.7:
|
2015 May 14 | v.1.0.6:
|
2015 Jan 21 | v.1.0.5:
|
2014 Nov 02 | v.1.0.4: upgrade FFMpeg to version built on Nov 02 2014 + minor fix for convert progress event (in some cases it always returns zero progress). |
2014 Aug 24 | v.1.0.3:
|
2014 Aug 04 | v.1.0.2: upgrade FFMpeg to version built on Jul 28 2014. |
2014 May 12 | v.1.0.1: added Invoke method for untypical ffmpeg usage or complicated command line arguments. |
2014 Apr 16 | Added LogReceived event (enables FFMpeg log analysis). Added example that detects clip orientation and performs video rotation. |
2014 Apr 08 | Added ConvertLiveMedia overload for writing result directly to file (useful for grabbing live stream to MP4 format) |
2014 Mar 11 | Bugfix for issue with live stream conversion (freezing) |
2014 Mar 08 | ConvertLiveMedia: added support for FFMpeg input sources (URL/path to file, HTTP/UDP/TCP endpoints). |
2014 Feb 23 | Example for generating video stream from Bitmap images |
2014 Feb 17 | Example for grabbing live stream frames as Bitmap images |
2014 Feb 02 | VideoConverter is available as NuGet package |
2014 Jan 14 | Added FFMpegProcessPriority property (useful to avoid resources overuse at webserver) |
2013 Dec 27 | Bugfixes: filename with space, issue when ConvertMedia is called simultaneously from different threads, avoid hang up from unit testing environment like NUnit |
2013 Dec 07 | API documentation (generated from XML-comments) is now availabe |
2013 Nov 20 | Added ConvertProgress event and progress bar example |
2013 Nov 13 | Example for live stream conversion |
2013 Oct 23 | Added media concatentation support (ConcatMedia method) |
2013 Oct 21 | Added live stream conversion support (ConvertLiveMedia method and ConvertLiveMediaTask class) |
2013 Sep 08 | Initial VideoConverter release |
more components
-
Image Generator
.NET wrapper WkHtmlToImage utility that generate pretty-looking images by HTML layout.
-
HTML-to-PDF Generator
.NET wrapper for WkHtmlToPdf utility that generates PDF reports by HTML template.