Several videos in the same application

This forum is about all development around libVLC.
ronhash
New Cone
New Cone
Posts: 5
Joined: 21 Jan 2013 15:42
VLC version: 2.0.5
Operating System: Windows

Several videos in the same application

Postby ronhash » 21 Jan 2013 15:50

Hello there,
I need to open several windows playing videos in a c++ ms-windows application, allowing the user to control each of them (play/pause location etc...)
As a simple test I created a window, created 4 media_player instances (libvlc_media_player_new), assigned each of them to a window (libvlc_media_player_set_hwnd), and played all 4 videos.
The result was that the CPU was exploding... is there a better way to do this? is there any limitation on the number of videos that can be played concurrently?
Thanks!

Rémi Denis-Courmont
Developer
Developer
Posts: 15228
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Several videos in the same application

Postby Rémi Denis-Courmont » 21 Jan 2013 17:02

Of course, the hardware has limitations.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

joseAndresGomezTovar
Blank Cone
Blank Cone
Posts: 30
Joined: 07 Nov 2012 11:21
VLC version: 2.1.2
Operating System: Windows 7
Location: Madrid - Spain

Re: Several videos in the same application

Postby joseAndresGomezTovar » 21 Jan 2013 18:25

I recommend you to use GPU-Z
http://www.techpowerup.com/gpuz/

ronhash
New Cone
New Cone
Posts: 5
Joined: 21 Jan 2013 15:42
VLC version: 2.0.5
Operating System: Windows

Re: Several videos in the same application

Postby ronhash » 23 Jan 2013 10:01

Of course, the hardware has limitations.
I understand that there might be some limitations, is there any way that I can prioritize the update of the video window, and give the UI higher priority for example?
The problem is that the UI becomes non-responsive - I would prefer to lower the frame-rate for example.

ronhash
New Cone
New Cone
Posts: 5
Joined: 21 Jan 2013 15:42
VLC version: 2.0.5
Operating System: Windows

Re: Several videos in the same application

Postby ronhash » 23 Jan 2013 10:12

I recommend you to use GPU-Z
http://www.techpowerup.com/gpuz/
When I run the 4 videos, I do see that the GPU is getting close to 100%:
Image
This is my card data:
Image
My question is how can I control this...
Thanks.

Rémi Denis-Courmont
Developer
Developer
Posts: 15228
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Several videos in the same application

Postby Rémi Denis-Courmont » 23 Jan 2013 21:22

It's up to your application to prioritize its UI thread if it wants to. Whether that will work effectively is quite dubious though.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

ronhash
New Cone
New Cone
Posts: 5
Joined: 21 Jan 2013 15:42
VLC version: 2.0.5
Operating System: Windows

Re: Several videos in the same application

Postby ronhash » 24 Jan 2013 09:53

OK, I think U have a solution - I am working in Windows 7, so changing vlc to use Direct2D (--vout=direct2d) lowered the GPU Load to around 20% while running 4 video windows, and the application is fully responsive now.
Is there any downside to using Direct2D (expect it being platform specific)?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Several videos in the same application

Postby Jean-Baptiste Kempf » 24 Jan 2013 18:58

no.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 45 guests