Hi,to make it short i want to convert a any media file to mp4 x264 baseline format so everythng went fine as i had a mooo ffmpeg but now when trying to access from c# i couldnt from mooo as it is diff installation can only be accesed wit its own command prompt.

Anybody please advice how to install ffmpeg with x264 lib , and where can i find the zip files for this

thanks in advance

Recommended Answers

All 8 Replies

You may need to build from source for that. I do know that my Linux version of ffmpeg (binary installation) has the x264 lib installed by default. Don't know about the Windows version though.

mooo as it is diff installation can only be accesed wit its own command prompt.

You could use the Process Class to call the program. You can even redirect standard in and out to interact directly with it.

Hi thanks for the reply , as you said am using process to access the cmd but then the problem somewhr in my commanad when i just use the following cmd it works in c# and cmp prompt Aswell.

ffmpeg -i input.flv output.mp4

when i go for baseline profile with x264 it gets comverted when using cmd prompt rather doesnt in c# process access

pls find my sample code

Process pro = new Process();
        try
        {


            string path = @"F:\FFmpeg 1.05\bin\ffmpeg.exe";
            pro.StartInfo.FileName = path;
            string outputfile = @"D:\test.mp4";
            string fpath = @"E:\videosong\Bo1.flv";
             Response.Write(fpath);
            pro.StartInfo.Arguments = @" -i " + fpath + "-c:v libx264 -profile:v baseline -movflags faststart" + outputfile + "";
            pro.StartInfo.UseShellExecute = false;
            pro.StartInfo.CreateNoWindow = false;
            pro.Start();

        }
        catch (Exception ex)
        {

            Response.Write(ex.ToString());
            if (pro!= null) 

                pro.Dispose();
        }
        finally
        {
            //proc.Dispose();
            pro.Close();
        }

Assuming that the format of the arguments you're passing is correct, your problem could be spacing. you have no space before -c or after faststart.

Also why are you adding an empty string on to the end of the arguments?

Hi , thanks for the response , tried with this but didnt work .

@"-i"+fpath+"-c:v libx264 -profile:v baseline -movflags faststart"+outputfile;

can you please give me example as were am going wrong.thanks for your time.

Here's the string modified see how there's extras spaces.

@"-i "+fpath+" -c:v libx264 -profile:v baseline -movflags faststart "+outputfile;

If you still have problems, you may have to consult the ffmpeg documentation a little more and make sure your not missing something or have incompatible options enabled.

great!! its works fine now.. thank you so much for your timeply help:)

Glad it works. Please remember to mark this solved. Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.