0

I have created vlcControl added on my windows form. I would like to know how can get rid of black bars on my vlc videos (image consumes black space). An example is shown below: enter image description here

I have tried the line vlc --aspect-ratio 16:9 -L -f /directory/to/file/filename. The line changes the aspect ratio but did not work as expected. I have tried the following lines of code:

Line 1:

vlcCustomer.Play(new Uri("rtsp://192.168.1.10/2/media/video1"), ":network-caching=50 :aspect-ratio=16:9 -L -f /directory/to/file/filename");

Line 2:

vlcCustomer.Play(new Uri("rtsp://192.168.1.10/2/media/video1"), ":network-caching=50 vlc --aspect-ratio 16:9 -L -f /directory/to/file/filename");
haldo
  • 14,512
  • 5
  • 46
  • 52
Richard
  • 439
  • 1
  • 6
  • 25

3 Answers3

0

No need to use CLI args for this, libvlc has an API for changing aspect ratio and it is available in Vlc.DotNet. Example: https://github.com/ZeBobo5/Vlc.DotNet/blob/f0d3e2aca37500ccd2710c8b9b286ccc485f1636/src/Samples/Samples.WinForms.Advanced/Sample.cs#L167

mfkl
  • 1,914
  • 1
  • 11
  • 21
0

The thing is that your control will have the same size, whatever the aspect ratio you give to it, and it will need to fill with black bars. to get rid of it, you will need to resize your control and center it based on the aspect ratio you can get from the media info.

cube45
  • 3,429
  • 2
  • 24
  • 35
0

Modify this code according to your screen and paste after your code:

VideoWidth = "1280";
VideoHeight = "750";
VlcControl2.Video.AspectRatio = VideoWidth + ":" + VideoHeight;
Sorry IwontTell
  • 466
  • 10
  • 29