Clone Output of VideoView to external Monitor

This forum is about all development around libVLC.
DanielK117
New Cone
New Cone
Posts: 6
Joined: 20 Feb 2021 20:56

Clone Output of VideoView to external Monitor

Postby DanielK117 » 23 Mar 2021 18:39

Hi there,
I have a C# application which uses a LibVLC VideoView.
I am trying to play a video both as a small preview in my application, and in full screen on an external monitor.

So far I am using the following solution:
When creating the MediaPlayer object, I'm using the command line options "--clone-count", "--video-x" and "--video-y".
This creates a seperate window ("Direct3d Output"), which is located on the secondary monitor.
However, I cannot switch this "Direct 3D output" to full screen, so that it has no Window-Borders and the Windows-Taskbar is not visible.
Is there any way to do that? Or is there any other reasonable solution to clone the video from the VideoPlayer-Control to a separate monitor in fullscreen?

My Code:

Code: Select all

string[] vlcParameter = new string[] { @"--video-splitter=clone", @"--clone-count=2", @"--video-x=" + secondaryMonitor.WorkingArea.Left, @"--video-y=" + secondaryMonitor.WorkingArea.Top, @"--video-on-top" }; vlc = new LibVLC(true, vlcParameter);

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: Clone Output of VideoView to external Monitor

Postby mfkl » 24 Mar 2021 02:40

Is there any way to do that? Or is there any other reasonable solution to clone the video from the VideoPlayer-Control to a separate monitor in fullscreen?
Not really. When you use the clone feature, you lose all .NET GUI integration as libvlc will create its own Window to draw on. You could use win32 functions to find and manage that window yourself once libvlc has created it, but it's not really ideal.
The other option, which isn't great either, is to have 2 seperate playbacks with 2 mediaplayers and 2 video views.
https://mfkl.github.io

DanielK117
New Cone
New Cone
Posts: 6
Joined: 20 Feb 2021 20:56

Re: Clone Output of VideoView to external Monitor

Postby DanielK117 » 26 Mar 2021 20:01

I found a solution with the following Command line parameters, that works almost perfect:

@"--video-splitter=clone",
@"--clone-count=2",
@"--video-x=" + x,
@"--video-y=" + y,
@"--no-video-deco",
@"--no-embedded-video",
@"--width=" + secondaryMonitor.Bounds.Width,
@"--height=" + secondaryMonitor.Bounds.Height

The only problem is, that if a video has another resolution than the screen, the Height and Width-Parameter are not working.
It works fine for Images, but not for videos.

For example:
Monitor: 3440x1440
Video: 1920x1080
--> Current problem: Video is only shown in 1920x1080, the rest is normal desktop
--> Intended behaviour: Video is centered on the screen, black borders on the left and right side.

Is there any Command line option to force the Video-Resolution to the Monitor-Resolution with black borders.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 35 guests