Search code examples
c#videomedia-playervlc

How to enhanced quality of embed vlc player using c#?


I have a c# windows form application and i want to playback video using embed vlc player and every thing is good. But there is only one problem, however, that the quality of the video is dimmed, and the cloudy and opaque image is displayed. i try change some properties like this:

VlcControl.Video.Adjustments.Contrast = 0;
VlcControl.Video.Adjustments.Brightness = 100;
VlcControl.Video.Adjustments.Gamma = 10;
VlcControl.Video.Adjustments.Saturation= 50;

But the image quality did not change. also i change VlcControl.Video.AspectRatio property.

How can i Enhance movie quality?


Solution

  • I ran into this problem and I determined that VLC seems to ignore these settings until the video actually starts playing. The workaround I came up with for my WinForm app was to start the video stream, and then repeatedly reapply the settings for awhile. I am sure there is a better way to do this, but for now, this gets the job done 100% of the time:

    this.VlcControl.Play();
    this.Show();
    
    int counter = 0;
    while (counter < 20)
    {
        Debug.WriteLine(this.VlcControl.State);
        counter += 1;
        Application.DoEvents();
        Thread.Sleep(100);
        this.VlcControl.Video.Adjustments.Enabled = true;
        this.VlcControl.Video.Adjustments.Saturation = 1.35f;
    }