To run ffmpeg commands in you need to use Media Handler class. Here is an example how to use media handler class to run ffmpeg commands.

//Create media handler object of Media_handler class

Media_handler mymediahandler=new Media_handler();

// Get web site application path

string webapppath =Server.MapPath(Request.ApplicationPath);

//Get ffmpeg.exe full path from mapping

string ffmpeg_path=HttpContext.Current.Server.MapPath(“ffmpeg.exe”);

//Run FFMPEG command by calling Execute_FFMPEG function of Media_handler class

mymediahandler.Execute_FFMPEG(ffmpeg_path, “-i c:\\clock.avi -vcodec mp3 c:\\clock.flv”);

Written by Bala Krishna

Bala Krishna is web developer and occasional blogger from Bhopal, MP, India. He like to share idea, issue he face while working with the code.

This article has 6 comments

  1. jaimin


    I am using trial version of MediaHander to Convert movie file into FLV for web site in and C#. But the problem is only a few part of original movie converted into FLV. What will the reason ? Is this beacaus of Trai version of MediaHandler?

  2. Bala Krishna

    Hi, I am not sure but this may be a case. Check MediaHandler documentation to confirm trial version limitation..

  3. Jaimin Patel

    We are not able to convert 3gp,rm and dat files to flv.

  4. anup

    i am not geeting the execute command fuction in media handler class…………

  5. johnalphen

    which is freeware is used for ffmpeg and is it based on the FFMPEG encoder (normally it is used to create .flv files from .avi or .mpg, but it can do the reverse too)?

  6. Sandeep Beniwal


    I want to convert video into .flv/.swf using 3.5.Please provide me full code because i am ne in 3.5.