Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [DllImport("User32.dll")]
- public static extern bool SetForegroundWindow(IntPtr hWnd);
- public void mciConvertWavMP3(string fileName, bool waitFlag)
- {
- string savepath = Server.MapPath(fileName);
- string destpath = Server.MapPath(fileName);
- string pworkingDir = Server.MapPath("~/ffmpeg/");
- // string outfile = "-b:a 16 --resample 24 -m j " + savepath + " " + savepath.Replace(".wav", ".mp3") + ""; //--- lame code
- // string outfile = "-b 192k -i " + savepath + " " + destpath.Replace(".mp4", ".webm");
- // string outfile = "ffmpeg -i " + savepath + " -acodec libvorbis -ac 2 -ab 96k -ar 44100 -b 345k -s 640x360 " + Server.MapPath("output-file.webm");
- string outfile = "ffmpeg -i "test7.mp4" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "" + Server.MapPath("output-file.webm") + """;
- // string outfile = "ffmpeg -i ""+fileName+"" -codec:v libvpx -quality good -cpu-used 0 -b:v 600k -qmin 10 -qmax 42 -maxrate 500k -bufsize 1000k -threads 2 -vf scale=-1:480 -an -pass 1 -f webm /dev/null";
- System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
- psi.FileName = pworkingDir+"ffmpeg.exe";
- psi.Arguments = outfile;
- psi.UseShellExecute = true;
- psi.CreateNoWindow = false;
- System.Diagnostics.Process p = System.Diagnostics.Process.Start(psi);
- Thread.Sleep(1000);// utput.webm
- if (waitFlag)
- {
- p.WaitForExit();
- // wait for exit of called application
- }
- }
- string outfile = "ffmpeg -i "test7.mp4" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "" + Server.MapPath("output-file.webm") + """;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement