Get the codec name.

This forum is about all development around libVLC.
Khenatram
Blank Cone
Blank Cone
Posts: 61
Joined: 11 Nov 2008 10:55
VLC version: 0.8.6.i
Operating System: Windows

Get the codec name.

Postby Khenatram » 24 Dec 2008 15:57

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

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: Get the codec name.

Postby Jean-Baptiste Kempf » 24 Dec 2008 18:50

When you say 'name', you mean 'Mpeg2 Video' ?
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.

Khenatram
Blank Cone
Blank Cone
Posts: 61
Joined: 11 Nov 2008 10:55
VLC version: 0.8.6.i
Operating System: Windows

Re: Get the codec name.

Postby Khenatram » 25 Dec 2008 06:36

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.

Khenatram
Blank Cone
Blank Cone
Posts: 61
Joined: 11 Nov 2008 10:55
VLC version: 0.8.6.i
Operating System: Windows

Re: Get the codec name.

Postby Khenatram » 25 Dec 2008 06:37

When you say 'name', you mean 'Mpeg2 Video' ?

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: Get the codec name.

Postby Jean-Baptiste Kempf » 25 Dec 2008 12:55

You want the demuxer name or the codec name?
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.

Khenatram
Blank Cone
Blank Cone
Posts: 61
Joined: 11 Nov 2008 10:55
VLC version: 0.8.6.i
Operating System: Windows

Re: Get the codec name.

Postby Khenatram » 25 Dec 2008 13:57

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

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: Get the codec name.

Postby Jean-Baptiste Kempf » 26 Dec 2008 17:07

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.
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.

Khenatram
Blank Cone
Blank Cone
Posts: 61
Joined: 11 Nov 2008 10:55
VLC version: 0.8.6.i
Operating System: Windows

Re: Get the codec name.

Postby Khenatram » 29 Dec 2008 06:30

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?

Khenatram
Blank Cone
Blank Cone
Posts: 61
Joined: 11 Nov 2008 10:55
VLC version: 0.8.6.i
Operating System: Windows

Re: Get the codec name.

Postby Khenatram » 05 Jan 2009 06:56

Can anybody help me in retrieving the codec name?

Khenatram
Blank Cone
Blank Cone
Posts: 61
Joined: 11 Nov 2008 10:55
VLC version: 0.8.6.i
Operating System: Windows

Re: Get the codec name.

Postby Khenatram » 07 Jan 2009 13:48

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


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 22 guests