C# ffmpeg bu kod işini görür hocam
using System;
using System.Diagnostics;
namespace VideoCompression
{
class Program
{
static void Main(string[] args)
{
// Video dosyasının yolunu belirleyin
string videoFile = @"C:video.mp4";
// Küçültmek istediğiniz boyutu belirleyin (örneğin, 500KB)
int targetSize = 500 * 1024;
// FFmpeg komut satırından çıktısını okumak için bir süreç oluşturun
Process process = new Process();
process.StartInfo.FileName = "ffmpeg.exe";
process.StartInfo.Arguments = $"-i {videoFile} -vcodec h264 -acodec aac -b:v {targetSize} {videoFile}_compressed.mp4";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.CreateNoWindow = true;
process.Start();
string output = process.StandardOutput.ReadToEnd();
process.WaitForExit();
Console.WriteLine(output);
Console.WriteLine("Video küçültme işlemi tamamlandı.");
}
}
}