Is there any tutorial or a c# library which which help me to accomplish the following
now steps 1) and 4) I have implemented but could not find a good c# library to accomplish 3) and 4)
I looked up the ffmpeg
library but could not find a good C# wrapper to accomplish the requirements.
Cutting is often confused with trimming because both of them are about deleting some parts from the video. However, when you trim a video clip, you delete its beginning and /or end while cutting means cutting a piece out of your video file somewhere else.
ffmpeg is a very powerful application and I have used it many times, even from C#. You don't need a C# wrapper library. All you have to do is execute the ffmpeg commands from C# using:
System.Diagnostics.Process.Start(string fileName, string arguments);
Or use System.Diagnostics.ProcessStartInfo
to redirect standard output if you need to.
This article explains how to use System.Diagnostics
to execute synchronous and asynchronous commands, etc.
http://www.codeproject.com/KB/cs/Execute_Command_in_CSharp.aspx
Here's a simple example of how to cut a video file down to its first 4 minutes using ffmpeg from C#.
using System.Diagnostics
Process.Start("ffmpeg.exe",
"-sameq -t 240 -i InputVideoFile.avi OutputVideoFile.avi");
Here's a SO example of how to use System.Diagnostics.ProcessStartInfo
C# and FFmpeg preferably without shell commands?
There are lots of online resources that explain all of ffmpeg's features and how to use them, just search.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With