Small command line using ffmpeg.exe to capture/recorde the desktop into a video file. In a command prompt window just type,
ffmpeg -f gdigrab -framerate 24 -i desktop -preset ultrafast -pix_fmt yuv420p out.mp4
Simple as that. The directory where the ffmpeg.exe is sitting this is where the mp4 video file will be created. This was a sample using it with the ffmpeg.exe in a command prompt window.
ffmpeg -f gdigrab -framerate 24 -i desktop -preset ultrafast -pix_fmt yuv420p out.mp4
Simple as that. The directory where the ffmpeg.exe is sitting this is where the mp4 video file will be created. This was a sample using it with the ffmpeg.exe in a command prompt window.
This is how to use it in c# in this case in visual studio 2013 express.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics;
namespace Ffmpeg_App
{
class Ffmpeg
{
Process process;
public void Start(string FileName, int Framerate)
{
process = new System.Diagnostics.Process();
process.StartInfo.FileName = @"D:\ffmpegx86\ffmpeg.exe"; // Change the directory where ffmpeg.exe is.
process.EnableRaisingEvents = false;
process.StartInfo.WorkingDirectory = @"D:\ffmpegx86"; // The output directory
process.StartInfo.Arguments = @"-f gdigrab -framerate " + Framerate + " -i desktop -preset ultrafast - pix_fmt yuv420p " + FileName;
process.Start();
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = false;
Close();
}
public void Close()
{
process.Close();
}
}
}
And this is how to use it in Form1,In top of form1,
Ffmpeg fpeg = new Ffmpeg();
Button click event to start,
private void Start_Click(object sender, EventArgs e)
{
fpeg.Start("test.mp4", 24);
}
Button click event to stop, private void Stop_Click(object sender, EventArgs e)
{
fpeg.Close();
}
Example of two video i recorded,
https://www.youtube.com/watch?v=6Zw_fkMJ-qY&feature=youtu.be
And
https://www.youtube.com/watch?v=yJY-sOjrIx8