• 13-03-2023, 11:23:56
    #1
    Merhaba, c# üzerinden yüklenen videonun boyutunu küçülterek kaydetmek istiyorum kullandığınız bir kütüphane var mı?
  • 13-03-2023, 11:29:06
    #2
    Bitmap sınıfı kullanarak yapabilirsin.
    Dosya boyutundan bahsediyorsan ffmpeg kullanabilirsin.
  • 13-03-2023, 11:44:39
    #3
    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ı.");
    }
    }
    }