C# Wrapper for libvlc 0.9.0 - Testers Required

This forum is about all development around libVLC.
surf_uk
New Cone
New Cone
Posts: 5
Joined: 23 Oct 2008 18:13

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby surf_uk » 23 Oct 2008 18:18

First thanks Marx for a great wrapper.

I'm not sure wich version I have of the wrapper and are unable to register any events, have these been implememted? if so where are the new versions?
I've spent the last few days building a C# wrapper to the new API. Anything that has been depreciated has been removed. So far, I've implemented most of the API and I'm able to play media files and attach the process to a
The following are yet to be implemented. If I get some time this weekend, I should get the bulk of it done.

libvlc_event
All I want to do is get a ibvlc_MediaPlayerEndReached

Thanks

publicENEMY
Cone that earned his stripes
Cone that earned his stripes
Posts: 104
Joined: 14 May 2007 05:04
Location: Malaysia

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby publicENEMY » 24 Oct 2008 06:01

is this library compatible with the latest vlc(0.9.4)? is it actively developed? approximately, when can we expect an update?

thanks.

surf_uk
New Cone
New Cone
Posts: 5
Joined: 23 Oct 2008 18:13

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby surf_uk » 24 Oct 2008 11:30

All I want to do is get a ibvlc_MediaPlayerEndReached
I made a rubbish work-around:

Code: Select all

//declare timer timer = new Timer(); timer.Interval = 500; timer.Tick += new EventHandler(TimerOnTick); timer.Enabled = true; //do something when ended void TimerOnTick(object obj, EventArgs ea) { Console.WriteLine("Media position : " + Math.Ceiling(libvlc_media_player.get_position(ref ex)*100) + "%"); if (Math.Ceiling(libvlc_media_player.get_position(ref ex) * 100) > 99) { //do something useful } }
Are there any fully functional alternatives, such as (although I haven't tested them):

C#
http://meedios.svn.sourceforge.net/view ... Auxiliary/

Java:
http://mailman.videolan.org/pipermail/v ... 46719.html
Last edited by surf_uk on 24 Nov 2008 10:38, edited 1 time in total.

Flow
Blank Cone
Blank Cone
Posts: 14
Joined: 23 Nov 2006 20:31

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Flow » 24 Oct 2008 22:14

Hello,

I've worked on libvlc with C++
I would like to know how to use the wrapper to use libvlc with C#

Thank you.
Flo.

win32nipuh
New Cone
New Cone
Posts: 2
Joined: 26 Oct 2008 13:27

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby win32nipuh » 27 Oct 2008 09:58

How can I play FLV files (local and remote) using wrapper?

Regards

arogan
New Cone
New Cone
Posts: 3
Joined: 17 Dec 2007 03:16

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby arogan » 28 Oct 2008 20:38

All I want to do is get a ibvlc_MediaPlayerEndReached
I made a rubbish work-around:

Code: Select all

//declare timer timer = new Timer(); timer.Interval = 500; timer.Tick += new EventHandler(TimerOnTick); timer.Enabled = true; //do something when ended void TimerOnTick(object obj, EventArgs ea) { Console.WriteLine("Media position : " + Math.Ceiling(libvlc_media_player.get_position(ref ex)*100) + "%"); if (Math.Ceiling(libvlc_media_player.get_position(ref ex) * 100) > 99) { //do something useful } }
Are there any fully functional alternatives, such as (although I haven't tested them):

C#
http://meedios.svn.sourceforge.net/view ... Auxiliary/

Java:
http://mailman.videolan.org/pipermail/v ... 46719.html

I tried the meedios one and it worked fine. I'm having trouble finding some missing functionality. Specifically, I'm looking for the setVariable functions of old so I can send the hotkey presses to vlc (I used it for dvd navigation and other things).

basically I'm looking for something equivalent to:
enmErr = VLC_VariableSet(m_iVlcHandle, "key-pressed", valKey);

[DllImport("libvlc")]
static extern VlcError __var_Set(IntPtr p_vlc, String name, vlc_value_t value);

static extern Error VLC_VariableSet(int iVLC, string Name, vlc_value_t value);


Getting the meedios stuff running was quite easy:
Grab the gnu tarball for videolan.interop:
http://meedios.svn.sourceforge.net/view ... n.Interop/
add the project to your solution, add a project reference, add using VideoLan for the namespace.

Code: Select all

private VideoLan.VideoLanClient vlc; private VideoLan.VlcMediaPlayer video; //init stuff: vlc = new VideoLan.VideoLanClient(@"C:\Program Files\VideoLAN\VLC"); owner = yourcontrol; // (I used a picturebox) video = vlc.NewMediaPlayer(owner.Handle); //play a file: VideoLan.VlcMedia desc = vlc.NewMedia(aFile); video.Load(desc); desc.Dispose(); //cleanup when you are done playing the video: video.Dispose(); vlc.Dispose();

Kairos
Blank Cone
Blank Cone
Posts: 45
Joined: 01 Mar 2008 01:49
Operating System: Windows
Location: Scottsdale, Az
Contact:

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Kairos » 28 Oct 2008 23:11

I tried the meedios one and it worked fine. I'm having trouble finding some missing functionality. Specifically, I'm looking for the setVariable functions of old so I can send the hotkey presses to vlc (I used it for dvd navigation and other things).

basically I'm looking for something equivalent to:
enmErr = VLC_VariableSet(m_iVlcHandle, "key-pressed", valKey);

[DllImport("libvlc")]
static extern VlcError __var_Set(IntPtr p_vlc, String name, vlc_value_t value);

static extern Error VLC_VariableSet(int iVLC, string Name, vlc_value_t value);
arogan, I'm glad you like the MeediOS wrapper. I wrote it to fit my needs, that's why I never got around to support the MediaList or vlm stuff. Unfortunately, the functionality your looking for no longer exists in libvlc. If you look at my source code you will see the '__var_Set' stuff is all there inside the VlcObject class under the folder obsolete. If you try to call any of those functions you will get an error saying 'the entry point could not be found'. I too miss those function because now there is no way to do on the fly adjustments of the basic filter settings like brightness, contrast, hue, gamma, and saturation.

arogan
New Cone
New Cone
Posts: 3
Joined: 17 Dec 2007 03:16

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby arogan » 28 Oct 2008 23:26

I tried the meedios one and it worked fine. I'm having trouble finding some missing functionality. Specifically, I'm looking for the setVariable functions of old so I can send the hotkey presses to vlc (I used it for dvd navigation and other things).

basically I'm looking for something equivalent to:
enmErr = VLC_VariableSet(m_iVlcHandle, "key-pressed", valKey);

[DllImport("libvlc")]
static extern VlcError __var_Set(IntPtr p_vlc, String name, vlc_value_t value);

static extern Error VLC_VariableSet(int iVLC, string Name, vlc_value_t value);
arogan, I'm glad you like the MeediOS wrapper. I wrote it to fit my needs, that's why I never got around to support the MediaList or vlm stuff. Unfortunately, the functionality your looking for no longer exists in libvlc. If you look at my source code you will see the '__var_Set' stuff is all there inside the VlcObject class under the folder obsolete. If you try to call any of those functions you will get an error saying 'the entry point could not be found'. I too miss those function because now there is no way to do on the fly adjustments of the basic filter settings like brightness, contrast, hue, gamma, and saturation.
LOL, I had just found your little \obsolete folder and hooked it all in getting all excited and boom got the 'the entry point could not be found'. Doh! Oh well. Thanks Karios for all the hard work. It was an incredibly clean and easy to follow/use wrapper. I will miss __var_set. I was using it to do all sorts of things like toggle audio tracks, cycle deinterlacing modes, aspect ratios, dvd menu navigation (arrow keys, enter), cycle subtitles, etc. Some things I see you can sort of duplicate through libvlc_audio and libvlc_video but not every thing. I don't see a way to set deinterlacing mode on the fly. Anyways, if anybody has any ideas how to duplicate some of the functionality I listed in this post 0.9.0 world please share.

publicENEMY
Cone that earned his stripes
Cone that earned his stripes
Posts: 104
Joined: 14 May 2007 05:04
Location: Malaysia

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby publicENEMY » 29 Oct 2008 05:27

Kairos

Thank you for sharing your interop with us. Maybe you can start a new thread so that anyone can focus on developing or enhancing your interop. By the way, did you get to render vlc in wpf(i mean, full wpf features support)?

Thanks. Im gonna download it and test it.

publicENEMY
Cone that earned his stripes
Cone that earned his stripes
Posts: 104
Joined: 14 May 2007 05:04
Location: Malaysia

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby publicENEMY » 29 Oct 2008 06:07

Kairos

I tried VideoLanPlayer.UI. Is there any particular reason that you choose panel as the video container? just curious.

thanks.

overall, i would say great effort.

publicENEMY
Cone that earned his stripes
Cone that earned his stripes
Posts: 104
Joined: 14 May 2007 05:04
Location: Malaysia

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby publicENEMY » 29 Oct 2008 06:17


Kairos
Blank Cone
Blank Cone
Posts: 45
Joined: 01 Mar 2008 01:49
Operating System: Windows
Location: Scottsdale, Az
Contact:

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Kairos » 29 Oct 2008 19:06

publicENEMY, I started a new thread for my responses in order not to derail this one.

viewtopic.php?f=14&t=52021&p=169063#p169063

Jeremiah
Blank Cone
Blank Cone
Posts: 53
Joined: 16 Oct 2008 09:31

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Jeremiah » 30 Oct 2008 12:45

is this library compatible with the latest vlc(0.9.4)? is it actively developed? approximately, when can we expect an update?

thanks.
It works very with latest vlc lib(0.9.4).

i have a question guys.

Do anyone use the funciton video_get_height(ref libvlc_exception_struct ex)?

why my return value is 0?

Prakash
New Cone
New Cone
Posts: 3
Joined: 20 Oct 2008 13:02

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Prakash » 03 Nov 2008 12:28

Hi all,
can anybody help me in solving this exception " 'System.AccessViolationException' occurred in Marx_libvlc_wrapper.dll"
while running the wrapper i got this exception. One more query is it useful for http streaming??


Thanks in Advance

Regards,
Prakash.

buhochileno
New Cone
New Cone
Posts: 1
Joined: 03 Nov 2008 20:19

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby buhochileno » 03 Nov 2008 20:23

Hi guys:

First post to the forum, so Hi to all and keep the good work..!!!

Sorry if is not the correct forum, but I'm very interesting in use and help with the .NET interface for VLC, so my question is where can I get a fresh copy of the source or where can a check out the last version (svn repo?).

And also make some questions:

1) I'm a c#/mono programmer so I wonder if someone test this libvlc wrapper in c# on linux?
2) the current wrapper is not a wrapper arround a ActiveX control right?
3) the native function wrappers are also in C# not VS.NET C++ right?
and finally...
4) what is the current status of the vlc streaming capabilities of LibVlc and/or the .NET wrapper?

Thanks in advance, and any help direction it would be very appreciated.

Cheers,

Mauricio

jshort86
New Cone
New Cone
Posts: 4
Joined: 04 Nov 2008 17:05

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby jshort86 » 07 Nov 2008 12:33

Hi

I was wondering if this .NET wrapper is available for download, as I am trying to find a .NET wrapper which will allow me to stream video from my VB.NET application through the libvlc class?

Any feedback would be greatly appreciated?

Best Regards
Jack


jshort86
New Cone
New Cone
Posts: 4
Joined: 04 Nov 2008 17:05

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby jshort86 » 07 Nov 2008 16:11

Hi

Thanks thats great I have the file now.

I was wondering if I could get some help in setting this up from my VB.NET application.

Am I able to use imports or do I need to use DLLIMPORT to set this up.

And can someone confirm that this library will allow me to stream video over UDP, from my VB.NET application?

Thanks
Jack

Zeussy
New Cone
New Cone
Posts: 1
Joined: 08 Nov 2008 11:58

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Zeussy » 08 Nov 2008 13:25

thanks for the great wrapper, been very useful so far. Building a touch screen interface for my media box.

We watch a lot of anime in this house :) So being able to list and set the subtitle track is important. Currently I am just using the arguments for libvlc_core to specify my preference, but that does not help if the subtitle track has been named something obscure like "Styled Subs". Setting the sub track ID is not preferable just in case there are other language subs and English is not the first in the list. Is there a way to get the subtitles listed. I cannot see any way in the libvlc documentation, or in the wrapper. Perhaps I overlooked something?

Thanks in advance.

benshole
New Cone
New Cone
Posts: 6
Joined: 29 Sep 2008 18:06

Changing Media

Postby benshole » 13 Nov 2008 19:13

Hey Guys,

Using the C# wrapper in an application and i need to rapidly change from one piece of media to another.

I *assumed* this could be done by re-initiating a libvlc_media object with a new file path. Then assign the libvlc_media_player the changed media object.

When i do this i get an exception about the libvlc_core handle being invalid on the media object the 2nd time it is called.
I havn't disposed of the core object or modified it in any way. So its a little perplexing!

Also hopefully just a small one that i have missed in the thread somewhere.
In the wrapper the get_time and get_length calls were missing. If anyone needs these calls i have built a modified dll containing them.

Thanks a lot!

Ben

sun_yiqin
New Cone
New Cone
Posts: 4
Joined: 11 Nov 2008 03:08

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby sun_yiqin » 14 Nov 2008 08:35

Thanks for the wrapper, It is really nice. Sorry for my poor English...
Now I am trying to play a kind of TS stream from a TV usb device. The stream contain 3 channels at the same time.
I can switch by using the VLC player, just need to change the Playback-->Programm on the navigater.

How can I do the same thing by using the wrapper? I want to separate the 3 channels.
Any one can help me? Thanks very much!

BexX
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Jul 2008 00:26

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby BexX » 17 Nov 2008 14:48

You are setting up the frequency and the other stuff, by adding mrl-options to your mediadiscriptor, right? Then you just have to add ":programs=[SID]" as option to your mediadiscriptor objekt.

sun_yiqin
New Cone
New Cone
Posts: 4
Joined: 11 Nov 2008 03:08

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby sun_yiqin » 20 Nov 2008 03:10

You are setting up the frequency and the other stuff, by adding mrl-options to your mediadiscriptor, right? Then you just have to add ":programs=[SID]" as option to your mediadiscriptor objekt.
You mean "libvlc_media.add_option(options, ref ex);"? I tried setting the options as you said, but it doesn't work. What does the "SID" mean? Is it the program ID of the TS stream? But the program ID is always changing.

drainey
New Cone
New Cone
Posts: 6
Joined: 06 May 2008 06:17

VB.net samples

Postby drainey » 20 Nov 2008 08:15

I am after a VB.net sample using the wrapper. Does anyone have such a beast? A working example of would be greatly appreciated. Even if it in C# i will port to VB and post for others to use.

BexX
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Jul 2008 00:26

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby BexX » 22 Nov 2008 14:04

Hi guys:
Sorry if is not the correct forum, but I'm very interesting in use and help with the .NET interface for VLC, so my question is where can I get a fresh copy of the source or where can a check out the last version (svn repo?).
I would suggest using this wrapper instead:
viewtopic.php?f=14&t=52021&start=15
1) I'm a c#/mono programmer so I wonder if someone test this libvlc wrapper in c# on linux?
both wrappers work, with some few modifications. i am going to post my changes to the meedios wrapper in the corresponding thread.
2) the current wrapper is not a wrapper arround a ActiveX control right?
no
3) the native function wrappers are also in C# not VS.NET C++ right?
and finally...
no
4) what is the current status of the vlc streaming capabilities of LibVlc and/or the .NET wrapper?
does work, by adding stream output options to the mrl.
You are setting up the frequency and the other stuff, by adding mrl-options to your mediadiscriptor, right? Then you just have to add ":programs=[SID]" as option to your mediadiscriptor objekt.
You mean "libvlc_media.add_option(options, ref ex);"? I tried setting the options as you said, but it doesn't work. What does the "SID" mean? Is it the program ID of the TS stream? But the program ID is always changing.
SID is the service identifier that should be in any DVB stream. Imho it describes the Video and Audio PIDs belonging to a channel.
Here is some Code i wrote for the meedios Wrapper mentioned above:

Code: Select all

// Main.cs created with MonoDevelop // User: bexx at 1:15 AM 11/20/2008 // // To change standard headers go to Edit->Preferences->Coding->Standard Headers // using System; using VideoLan; using System.Threading; namespace DVBsharp { public interface VlcDvbChannel { String[] mrlOptions { get; } } public class SChannel : VlcDvbChannel { private readonly String name; private readonly int frequency; private readonly int symbolrate; private readonly int sid; private readonly bool horizontal; public SChannel(String name, int frequency, int symbolrate, int sid, bool horizontal) { this.name = name; this.frequency = frequency; this.symbolrate = symbolrate; this.sid = sid; this.horizontal = horizontal; } public String Name { get { return name; } } public int Frequency { get { return frequency; } } public int Symbolrate { get { return symbolrate; } } public int Sid { get { return sid; } } public bool isHorizontal { get { return horizontal; } } public String[] mrlOptions { get { return new String[] {":dvb-frequency="+frequency, ":dvb-srate="+symbolrate, ":dvb-voltage="+(horizontal?"18":"13"), ":program="+sid}; } // program does work for streaming, but does not for playing } } class MainClass { public static void Main(string[] args) { // init libvlc VideoLanClient vlc = new VideoLanClient(new String[]{}); // mrl VlcMedia media = vlc.NewMedia("dvb://"); SChannel chan1 = new SChannel("Das Erste", 11836000, 27500000, 28106, true); foreach (string option in chan1.mrlOptions) media.AddOption(option); //player VlcMediaPlayer player = vlc.NewMediaPlayer(IntPtr.Zero, media); player.StateChanged += new EventHandler<StateChangedEventArgs>(StateChanged); // Thread.Sleep(10000); player.Play(); Thread.Sleep(10000); player.Video.FullScreen = true; Thread.Sleep(30000); player.Stop(); } private static void StateChanged(object sender, StateChangedEventArgs e) { Console.WriteLine("State: " + e.NewState); } } }
This is working on ubuntu with an new VideoLanClient Constructor, and should work on windows, when you adjust the "mrlOptions" property to your needs.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 9 guests