How to know if the stream is playing ?

This forum is about all development around libVLC.
Maloupi
Blank Cone
Blank Cone
Posts: 25
Joined: 06 Apr 2011 14:34
VLC version: 2.1.0-git
Operating System: Windows / Linux
Location: Lyon (France)

How to know if the stream is playing ?

Postby Maloupi » 04 May 2011 11:23

Hi,

I'm using libvlc_vlm_play_media to stream live cameras.
I need to know if the stream is playing or not (if an error occurs for example).
How can i do this ? Which function do i have to use ?

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: How to know if the stream is playing ?

Postby Sébastien Escudier » 04 May 2011 11:32


Maloupi
Blank Cone
Blank Cone
Posts: 25
Joined: 06 Apr 2011 14:34
VLC version: 2.1.0-git
Operating System: Windows / Linux
Location: Lyon (France)

Re: How to know if the stream is playing ?

Postby Maloupi » 04 May 2011 11:33

Thank you.
Is there a tutorial or a quick help on how to use it ?

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: How to know if the stream is playing ?

Postby Sébastien Escudier » 04 May 2011 11:48


Maloupi
Blank Cone
Blank Cone
Posts: 25
Joined: 06 Apr 2011 14:34
VLC version: 2.1.0-git
Operating System: Windows / Linux
Location: Lyon (France)

Re: How to know if the stream is playing ?

Postby Maloupi » 04 May 2011 11:56

Thank you

Maloupi
Blank Cone
Blank Cone
Posts: 25
Joined: 06 Apr 2011 14:34
VLC version: 2.1.0-git
Operating System: Windows / Linux
Location: Lyon (France)

Re: How to know if the stream is playing ?

Postby Maloupi » 04 May 2011 15:59

For information :
I'm finally using the libvlc_vlm_get_media_instance_time function.
If the time is > 0, i consider that my stream is really playing.

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: How to know if the stream is playing ?

Postby Sébastien Escudier » 04 May 2011 16:05

yes.
But with events you wouldn't need to call the function until the media is actually started.
And you are notified when it ends/errors

Maloupi
Blank Cone
Blank Cone
Posts: 25
Joined: 06 Apr 2011 14:34
VLC version: 2.1.0-git
Operating System: Windows / Linux
Location: Lyon (France)

Re: How to know if the stream is playing ?

Postby Maloupi » 04 May 2011 16:33

With events i can't distinguish which media i am looking at.
I added several broadcast streams to a vlc instance (with libvlc_vlm_add_broadcast)
If i want to know if, for example, the second stream is playing, i don't know how to do because the event manager is for one instance (libvlc_VlmMediaInstanceStatusPlaying), not one stream.

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: How to know if the stream is playing ?

Postby Sébastien Escudier » 04 May 2011 16:40

Not true...
in the events callback parameter, you have a field psz_media_name
so you know which media it is.

Maloupi
Blank Cone
Blank Cone
Posts: 25
Joined: 06 Apr 2011 14:34
VLC version: 2.1.0-git
Operating System: Windows / Linux
Location: Lyon (France)

Re: How to know if the stream is playing ?

Postby Maloupi » 04 May 2011 16:56

Sorry, my fault, i didn't see it.
I will look at this again and better ;-)
Thank you.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 17 guests