mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
Added the possibility for a command after capturing.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2288 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
75a841b31e
commit
485a814251
1 changed files with 24 additions and 5 deletions
|
@ -285,15 +285,34 @@ namespace Greenshot.Helpers {
|
||||||
// free up the Bitmap object
|
// free up the Bitmap object
|
||||||
GDI32.DeleteObject(hDIBSection);
|
GDI32.DeleteObject(hDIBSection);
|
||||||
}
|
}
|
||||||
if (aviWriter != null) {
|
|
||||||
aviWriter.Dispose();
|
|
||||||
aviWriter = null;
|
|
||||||
MessageBox.Show("Recording written to " + filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (disabledDWM) {
|
if (disabledDWM) {
|
||||||
DWM.EnableComposition();
|
DWM.EnableComposition();
|
||||||
}
|
}
|
||||||
|
if (aviWriter != null) {
|
||||||
|
aviWriter.Dispose();
|
||||||
|
aviWriter = null;
|
||||||
|
|
||||||
|
string ffmpegexe = PluginUtils.GetExePath("ffmpeg.exe");
|
||||||
|
if (ffmpegexe != null) {
|
||||||
|
try {
|
||||||
|
string webMFile = filename.Replace(".avi", ".webm");
|
||||||
|
ProcessStartInfo processStartInfo = new ProcessStartInfo(ffmpegexe, "-i \"" + filename + "\" -vcodec libvpx -g 30 \"" + webMFile + "\"");
|
||||||
|
processStartInfo.CreateNoWindow = false;
|
||||||
|
processStartInfo.RedirectStandardOutput = false;
|
||||||
|
processStartInfo.UseShellExecute = false;
|
||||||
|
Process process = Process.Start(processStartInfo);
|
||||||
|
process.WaitForExit();
|
||||||
|
if (process.ExitCode == 0) {
|
||||||
|
MessageBox.Show("Recording written to " + webMFile);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
MessageBox.Show("Recording written to " + filename + " couldn't convert due to an error: " + ex.Message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
MessageBox.Show("Recording written to " + filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue