Problems in playing multiple video streams in VC application

This forum is about all development around libVLC.
rarao
Blank Cone
Blank Cone
Posts: 11
Joined: 18 Apr 2009 09:18

Problems in playing multiple video streams in VC application

Postby rarao » 24 Sep 2009 09:19

I am using Core 2 Duo with 3GB RAM and Windows Vista OS, libvlc 0.9.9 library.

I am making an application to display 3 video streams (approx 4 Mb/s bitrate each) using microsoft visual studio 8. When i start displaying all the 3 videos at the same time (say in a for loop), there is an obvious surge in Physical memory usage (as seen in Task manager) and because of this the frames are frozen within 5 secs of playing, after some time and VLC tries to recover from this after a steady state (in memory usage %) is reached but ends up playing videos with corrupted frames and eventually the application crashes. Some digging in details of problems points to a dll called liblibmpeg2_plugin.dll.

My observation is this problem occurs whenever the rate of change in memory usage is high and not on absolute % of memory usage.

When i used "Minimize number of threads" option in VLC (Preferences->Advanced), the sudden surge is reduced to large extent but still i find the problem of frozen videos and eventual crash but after, relatively longer duration of time.

My aim is to display 8 videos eventually........ which looks far away at this stage :-).

Is there any away i can avoid this issue. Has anybody faced this issue before under Windows?

Rao

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: Problems in playing multiple video streams in VC application

Postby Jean-Baptiste Kempf » 24 Sep 2009 13:43

Can you try to do --codec avcodec in your libVLC call?
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.

rarao
Blank Cone
Blank Cone
Posts: 11
Joined: 18 Apr 2009 09:18

Re: Problems in playing multiple video streams in VC application

Postby rarao » 27 Sep 2009 06:51

Can you try to do --codec avcodec in your libVLC call?
I tried the --codec avcodec suggestion ,...but it didnt help.

Additional info:
The input to the multiple instances of the libvlc object in my MSVC application, is from a multicast address.

memory handling:
I feel that it all depends on how the libvlc is handling the memory at the time of playing the stream. I believe that function "libvlc_media_player_play" will launch multiple threads for playing a single stream of video and each of them might require memory for decoding and other functions etc.., and this memory obviously will be allocated according to requirements, probably, based on the bit-rate of the incoming stream etc...if this has to be done for all the 8 instances of vlc at one time....i am not sure how vlc handles this in windows vista environment???. Some times the memory required is of the order of 1 GB for 6 instances of vlc to stream 4 Mb/s videos.

I do not know the internals of vlc player.my question is..... What if i know the bit-rate of stream before creating an vlc instance....can it help in allocating the memory at the time of creating an instance of VLC rather than allowing this memory to be allocated at the time of playing. Because i would know beforehand what is the bitrate of the stream i am going to play...The reason why i am suggesting this is because...if i play the 6 streams one after the other by giving a delay of 2 to 3 minutes before playing the next one.....the chances of not crashing is very very high.

The following is the code i am using for my application.....

String myarg0 = "-I";
String myarg1 = "dummy";
String myarg2 = "--plugin-path=.\\plugins";
String MRL;
IntPtr, mp1, med1;

....................
String[] myargs = { myarg0, myarg1, myarg2};
// Create a new instance of libvlc object
vlc_inst = libvlc_new(3, myargs, ref ex);

//Create a media player
mp1 = libvlc_media_player_new(vlc_inst, ref ex);

//Assuming that the server is multicasting the video at the below IP:Port
MRL = "udp://@ 235.1.1.1:12000";

//Create a new media
med1 = libvlc_media_new(vlc_inst, MRL, ref ex);

// Attach the media to player
libvlc_media_player_set_media(mp1, med1, ref ex);

//Release the media...no longer required....
libvlc_media_release(med1);

// Give the handle to a window (handle of a picture box control) for the vlc to render the video
libvlc_media_player_set_drawable(mp1, wnd, ref ex);

//Play the video
libvlc_media_player_play(mp1, ref ex);


regards
Rao

xuhuandong
New Cone
New Cone
Posts: 4
Joined: 22 Dec 2009 04:22

Re: Problems in playing multiple video streams in VC application

Postby xuhuandong » 22 Dec 2009 04:29

hi,i'm a vlc newer,can you tell me how can play multiple video streams? tx~

xuhuandong
New Cone
New Cone
Posts: 4
Joined: 22 Dec 2009 04:22

Re: Problems in playing multiple video streams in VC application

Postby xuhuandong » 23 Dec 2009 01:48

anybody can help please


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 42 guests