c# and ffmpeg

The first thing i’m going to talk about here is  how to use c# and ffmpeg.

Do you know what we can do with those two? Our private youtube stuff.

The need: Multimedia files in sharepoint but we want everybody to be able to see them independently if they have this or that program (eg: media player or quicktime…) so all videos must be converted to flv (Macromedia Flash video format). 

I searched the web for something that was already done but haven’t found much, you have:

ffmpegScout
avdn
Sharpffmpeg

None of them suited me sharpffmpeg looked like the most promissing but there’s no documentation. I thought with the time i’ll take to understand how to use it I could do one myself. And i did. Something simple that served my needs.

All i want is to get a movie and pass it to flv format. Simple and easy. How you do it?

First you need ffmpeg after that i created a console application and sent my commands to it.

System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = @”””C:\edgar\mediaHandler\ffmpeg\ffmpeg”””;
proc.StartInfo.Arguments = “-i C:\\edgar\\mediaHandler\\ffmpeg\1.mpg -ar 22050 -ab 32 -f flv -s 320×240 -aspect 4:3 -y movie4.flv”; /* use /y to overwrite if there it exists already or will fail */
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start(); 
proc.WaitForExit();
proc.Close();

You could elaborate the code more, i will probably do it later, but for now it’s up to you.
Please comment if this was of any help to you.


I edited this post just to tell you that this was a prototype. I have never used it again. So i’m not the right person to ask questions.

If anybody has got further into this issue and would like to help others please comment.