Page 1 of 1

How to obtain statics about stream using LibVLC

Posted: 16 Jan 2008 11:17
by equitel
Hello,

I want to get the stream information using libvlc, I thought about the the function mediacontrol_get_stream_information but doesn't work. Please somebody can help me. The code that doesn't work is bellow, thanks

public long GetStreamInfo3()
{
long l = 0;
strInfo sif;
sif.bitrate = 0;

try
{
using (VlcPlaylistObject vpobj = new VlcPlaylistObject(this.vlcHandle))
{
if (vpobj.SubObject != IntPtr.Zero)
{
IntPtr p_input = libvlc_playlist_get_input(ref vpobj.libvlc, ref vpobj.exception);
if (vpobj.exception.WasExceptionRaised())
{
this.lastErrorMessage = Marshal.PtrToStringAnsi(vpobj.exception.psz_message);
}
else
{
try
{
sif = mediacontrol_get_stream_information(p_input,
mediacontrol_PositionKey.mediacontrol_MediaTime,
ref vpobj.exception);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
libvlc_input_free(p_input);
}
}
}
}
}
catch (Exception ex)
{
this.lastErrorMessage = ex.Message;
}

return (long)sif.bitrate;
}

Re: How to obtain statics about stream using LibVLC

Posted: 27 Mar 2008 17:25
by kaiser
Hi,
did you managed how to get the statistics from a stream? I´m also searching about how to do that.

Greetings,

Kaiser