locked
ffmpeg set flv video duration RRS feed

  • Question

  • User-277742030 posted

    I'm trying to set video duration but my code doesn't work

     filargs = "-i " + Filenamewithpath + " -ar 22050 -b 500k -f flv " + outputfile + " ";
                
    
                string spath;
                spath = AppDomain.CurrentDomain.BaseDirectory;
                Process proc;
                proc = new Process();
                proc.StartInfo.FileName = spath + "ffmpeg.exe";
                proc.StartInfo.Arguments = filargs;
                proc.StartInfo.UseShellExecute = false;
                proc.StartInfo.CreateNoWindow = false;
                proc.StartInfo.RedirectStandardOutput = false;
    
                proc.Start();
    
                proc.WaitForExit();
                proc.Close();
    
    
    
                filargs = "flvtool2 -UP " + outputfile;
                Process proc1 = new Process();
                proc1.StartInfo.FileName = spath + "flvtool2.exe";
                proc1.StartInfo.Arguments = filargs;
                proc1.StartInfo.UseShellExecute = false;
                proc1.StartInfo.CreateNoWindow = false;
                proc1.StartInfo.RedirectStandardOutput = false;
    
                proc1.Start();
    
                proc1.WaitForExit();
                proc1.Close();

    how can I fix this problem?

    Thursday, May 27, 2010 4:09 AM

Answers

  • User-277742030 posted

    has already been solved.


    if someone interested in solution here it is


    static void Fix(string Path)
            {
                string spath;
                spath = AppDomain.CurrentDomain.BaseDirectory;
                string filargs = "-U " + Path;
                Process proc1 = new Process();
                proc1.StartInfo.FileName = spath + "flvtool2.exe";
                proc1.StartInfo.Arguments = filargs;
                proc1.StartInfo.UseShellExecute = false;
                proc1.StartInfo.CreateNoWindow = false;
                proc1.StartInfo.RedirectStandardOutput = false;
                proc1.Start();
                proc1.WaitForExit();
                proc1.Close();
            }


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 26, 2010 4:55 AM

All replies

  • User-319574463 posted

    In what context are you trying to do this?

    If other than an ASP.NET website/application/service, please ask at:


    Saturday, June 26, 2010 4:49 AM
  • User-277742030 posted

    has already been solved.


    if someone interested in solution here it is


    static void Fix(string Path)
            {
                string spath;
                spath = AppDomain.CurrentDomain.BaseDirectory;
                string filargs = "-U " + Path;
                Process proc1 = new Process();
                proc1.StartInfo.FileName = spath + "flvtool2.exe";
                proc1.StartInfo.Arguments = filargs;
                proc1.StartInfo.UseShellExecute = false;
                proc1.StartInfo.CreateNoWindow = false;
                proc1.StartInfo.RedirectStandardOutput = false;
                proc1.Start();
                proc1.WaitForExit();
                proc1.Close();
            }


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 26, 2010 4:55 AM
  • User-319574463 posted

    Excellent! Please click "Mark as Answer" against one or more of the replies!

    Saturday, June 26, 2010 4:59 AM