Page 1 of 1

Get the codec name.

Posted: 24 Dec 2008 15:57
by Khenatram
Hi,

I am using the following code snippet to get the name of the codec of currently playing video. I am using the following code but I am getting “demux” as result, am I doing something wrong here?

unsafe struct demux_t
{
//VLC_COMMON_MEMBERS;

/* Module properties */
IntPtr p_module;

/* eg informative but needed (we can have access+demux) */
char *psz_access;
//public char *psz_demux;
public IntPtr psz_demux;
char *psz_path;

/* input stream */
IntPtr s ; /* NULL in case of a access+demux in one */

/* es output */
IntPtr es_out_t ; /* our p_es_out */

/* set by demuxer */
IntPtr demux_t1; /* demux one frame only */
IntPtr pf_control;

/* Demux has to maintain them uptodate
* when it is responsible of seekpoint/title */
struct info
{
uint i_update; /* Demux sets them on change,
Input removes them once take into account*/
/* Seekpoint/Title at demux level */
int i_title; /* idem, start from 0 (could be menu) */
int i_seekpoint; /* idem, start from 0 */
} ;
IntPtr *p_sys;
};

public string GetMetaInfo()
{
string res = "";
using (VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_DEMUX))
{
if (vobj.SubObject != IntPtr.Zero)
{
demux_t demux = new demux_t();

demux = (demux_t)Marshal.PtrToStructure(vobj.SubObject, typeof(demux_t));
unsafe
{
res = Marshal.PtrToStringAnsi(demux.psz_demux);
}
}
}
return res;
}


Regards,
Ram

Re: Get the codec name.

Posted: 24 Dec 2008 18:50
by Jean-Baptiste Kempf
When you say 'name', you mean 'Mpeg2 Video' ?

Re: Get the codec name.

Posted: 25 Dec 2008 06:36
by Khenatram
When you say 'name', you mean 'Mpeg2 Video' ?
I mean the video Codec name Like MPEG2, MPEG4, DIV1 that we select in transcoding options of stream output window of VLC player.

I just want to know whether the video stream that I am playing in my c# windows application is in MPEG4V video.

Thanks a lot.

Re: Get the codec name.

Posted: 25 Dec 2008 06:37
by Khenatram
When you say 'name', you mean 'Mpeg2 Video' ?

Re: Get the codec name.

Posted: 25 Dec 2008 12:55
by Jean-Baptiste Kempf
You want the demuxer name or the codec name?

Re: Get the codec name.

Posted: 25 Dec 2008 13:57
by Khenatram
You want the demuxer name or the codec name?
Hi,

As per my knowledge

MPEG is a Codec name and
MPV4 (MPEG V4) is a Demuxer.

Correct me if I am wrong.
I want to know whether it is MPEG 4 or not.

Thanks.

Regards,
Ram

Re: Get the codec name.

Posted: 26 Dec 2008 17:07
by Jean-Baptiste Kempf
Well, MPEG4 is a big standard and some parts are codecs and some parts are demuxer

MPEG 4 part 2 aka mp4v is a codec
MPEG 4 aka mp4/mov is a muxer.

Re: Get the codec name.

Posted: 29 Dec 2008 06:30
by Khenatram
Well, MPEG4 is a big standard and some parts are codecs and some parts are demuxer

MPEG 4 part 2 aka mp4v is a codec
MPEG 4 aka mp4/mov is a muxer.

Hi j-b,

Thanks for the reply.

I want to determine the codec name of the current video stream that I am playing in my C# application.
Can i get it by using "ObjectType.VLC_OBJECT_DECODER" object?

Re: Get the codec name.

Posted: 05 Jan 2009 06:56
by Khenatram
Can anybody help me in retrieving the codec name?

Re: Get the codec name.

Posted: 07 Jan 2009 13:48
by Khenatram
Found an alternative.

Read the log file using "libvlc_log_open " and then read "Decoder" and "Demuxer" objects which contains the decoder and demuxer is used to play the current video. :)

Regards,
Ram