libvlcnet - .NET library based on libvlc

This forum is about all development around libVLC.
Idsa
Blank Cone
Blank Cone
Posts: 78
Joined: 22 Oct 2009 10:59

Re: libvlcnet - .NET library based on libvlc

Postby Idsa » 14 Jan 2010 19:13

Helkaraxe, try to change your muxer to mp4. Muxer is set at InternalObjects folder (don't remember project and class).

Helkaraxe
New Cone
New Cone
Posts: 4
Joined: 14 Jan 2010 15:53

Re: libvlcnet - .NET library based on libvlc

Postby Helkaraxe » 15 Jan 2010 17:07

Idsa, Thank you so much, it worked!!!!

DieBagger
New Cone
New Cone
Posts: 7
Joined: 20 Jan 2010 23:55

Re: libvlcnet - .NET library based on libvlc

Postby DieBagger » 21 Jan 2010 00:26

Hi, first of all: great library, thx a lot!

I have a few questions:
  • Is it possible to somehow capture mouse events when libvlc is running (mouse click events on the control)?
  • Can I set the Deinterlace modes?
  • Is it possible to activate the teletext mode when watching an rtsp stream?
thx

DieBagger
New Cone
New Cone
Posts: 7
Joined: 20 Jan 2010 23:55

Re: libvlcnet - .NET library based on libvlc

Postby DieBagger » 23 Jan 2010 16:02

Ok, I got the deinterlacing running by setting startup parameters:

Code: Select all

"--vout-filter=deinterlace", "--deinterlace-mode=blend"
Does anyone know if it is possible to change the values after initialisation?

thx

antrikshdigisign
New Cone
New Cone
Posts: 2
Joined: 30 Dec 2009 07:29

Re: libvlcnet - .NET library based on libvlc

Postby antrikshdigisign » 09 Feb 2010 08:38

hi,
This is really very good wrapper.
I am trying to write a application that streams Media and camera on HTTP.
I am using c# 2.0 (2005) and libvlcNet wrapper.
I wrote following code:-


This code works fine with media streaming, but when I try to stream camera, I hear a buzzing sound followed by Application crash which says that there was some problem with msvcrt.dll.

Code: Select all

MediaLibraryFactory mediaLibraryFactory; mediaLibraryFactory = new VlcMediaLibraryFactory(new string[] { "--no-snapshot-preview", "--ignore-config", "--no-osd", "--plugin-path", System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "plugins") }); PlayerOutput po = new PlayerOutput(vlcWindowControl1.Window); po.NetworkStreams.Add(new OutputNetworkStream(NetworkProtocol.HTTP, "192.168.100.22", 1234)); Player player = mediaLibraryFactory.CreatePlayer(po); player.SetMediaInput(new MediaInput(MediaInputType.Device, "dshow:// :dshow-vdev=" + VideoDevice + " :dshow-adev=" + AudioDevice + " :dshow-size=")); player.Volume = 100; player.Play();

am I doing anything wrong, or is it a bug? please tell me how to fix this!


thanks in advance

sincerely,
Antriksh

Helkaraxe
New Cone
New Cone
Posts: 4
Joined: 14 Jan 2010 15:53

Re: libvlcnet - .NET library based on libvlc

Postby Helkaraxe » 09 Mar 2010 16:35

When I'm recording from a IP camera and it is desconnected, I receive a OnEndReached event but after that, any operation with the Player object blocks the application, and it doesn't respond any more. any body can tell me how to handle this kind of situation?

Thank you very much!!!!

andri
New Cone
New Cone
Posts: 1
Joined: 19 Mar 2010 16:41

Re: libvlcnet - .NET library based on libvlc

Postby andri » 19 Mar 2010 16:44

Has anyone tried this on a 64bit OS, and had luck?

I've been using it successfully on 32bit xp and vista but in win7 64bit I am having complete computer freezes.

also is there a build which uses version > 1.0.0

nuptjinlu
New Cone
New Cone
Posts: 1
Joined: 18 Mar 2010 09:27

Re: libvlcnet - .NET library based on libvlc

Postby nuptjinlu » 22 Mar 2010 03:59

hi,ewood.
I have some problems on doing record function.
I have realised how to record a network steam to my local file.
See this code :

Code: Select all

string uri = "mms://61.136.113.41/nytv_1"; DZ.MediaPlayer.Io.MediaInput mediaInput = new DZ.MediaPlayer.Io.MediaInput(MediaInputType.NetworkStream, uri); OutFile outfile = new OutFile("D:\\record.mp4"); vlcPlayerControl1.playerOutput.Files.Add(outfile); vlcPlayerControl1.Play(mediaInput);
But this have a problem.Under the scene,how can we record a steam within a PLAYING state stream?
that is to say,how can we add a option to the player dynamicly, without stop the PLAYING stream and initialise an other connection which take much time!
I have tried this way: invoke ((DZ.MediaPlayer.Vlc.VlcPlayer)vlcPlayerControl1.Player).currentMediaInternal.addOption(MyOptions) function in event-handler,but it can't work.
Can you tell me a solution about this problem ? Thank,you.
Anybody else who know this can tell me too. thanks all the same !

coder_gate
Blank Cone
Blank Cone
Posts: 24
Joined: 12 Mar 2010 07:34

Re: libvlcnet - .NET library based on libvlc

Postby coder_gate » 22 Mar 2010 10:09

can you upload source record on QTcreator

secaro
Blank Cone
Blank Cone
Posts: 13
Joined: 25 Feb 2008 17:53

Howto open network stream ?

Postby secaro » 29 Mar 2010 01:07

Hello.

I have been trying out libvlcnet and it seems very good but i have some problems. I have been able to open files and play them and i have been able to stream files over network.

My problem is that i cant open network streams. I get the following error: VlcTimeOutException was unhandled, Timeout waiting required state.

Here is VB.NET code..

Code: Select all

Dim mediaLibraryFactory As MediaLibraryFactory mediaLibraryFactory = New VlcMediaLibraryFactory(New String() {"--no-snapshot-preview", "--ignore-config", "--no-osd", "--plugin-path", System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly.Location), "plugins")}) Dim po As PlayerOutput = New PlayerOutput(vlc1.Window) Dim player As Player = mediaLibraryFactory.CreatePlayer(po) Dim input As New MediaInput(MediaInputType.NetworkStream, "http://85.196.91.162/VTV-LO)") player.SetMediaInput(input) player.Volume = 30 player.Play()
Does anyone know how to solve this ?

I have tried with VB.net express edition 2008 and Visual Studio 2005 and get the same errors in vb.net and c#.net

rzar
New Cone
New Cone
Posts: 8
Joined: 13 May 2009 13:54

Re: Howto open network stream ?

Postby rzar » 29 Mar 2010 17:48

Hello.

I have been trying out libvlcnet and it seems very good but i have some problems. I have been able to open files and play them and i have been able to stream files over network.

My problem is that i cant open network streams. I get the following error: VlcTimeOutException was unhandled, Timeout waiting required state.

Here is VB.NET code..

Code: Select all

Dim mediaLibraryFactory As MediaLibraryFactory mediaLibraryFactory = New VlcMediaLibraryFactory(New String() {"--no-snapshot-preview", "--ignore-config", "--no-osd", "--plugin-path", System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly.Location), "plugins")}) Dim po As PlayerOutput = New PlayerOutput(vlc1.Window) Dim player As Player = mediaLibraryFactory.CreatePlayer(po) Dim input As New MediaInput(MediaInputType.NetworkStream, "http://85.196.91.162/VTV-LO)") player.SetMediaInput(input) player.Volume = 30 player.Play()
Does anyone know how to solve this ?

I have tried with VB.net express edition 2008 and Visual Studio 2005 and get the same errors in vb.net and c#.net
Hi secaro.

Try to change timeout parameter VlcPlayer.WaitingRequiredStateTimeout.
This parameter used by library when state of media expected to change.
Maybe it have too low value.

rz

secaro
Blank Cone
Blank Cone
Posts: 13
Joined: 25 Feb 2008 17:53

Re: libvlcnet - .NET library based on libvlc

Postby secaro » 29 Mar 2010 18:26

Thanks a lot for the tip. The problem was that i was using Player instead of VlcPlayer. Now i can receive streams :)

normschaef
New Cone
New Cone
Posts: 1
Joined: 29 Mar 2010 22:09

Re: libvlcnet - ?? libvlc not loaded

Postby normschaef » 29 Mar 2010 22:21

Hi all:

I'm having trouble getting my app to build. I'm in VS2008, the libvlc.dll is in my \bin\debug folder with my .exe, as well as the videoLan.Interop.dll running Win7 64-bit.
Additionally, I've added a reference to the videoLan.interop

However, when I try to build the app, I get an "unable to load libvlc.dll" error.
I've set the advance compile function for x86 and .NET framework 2.0. (also tried 3.0 and 3.5)

Any advice? Stupid thing that I'm overlooking?

TIA for any help.
Norm

Helkaraxe
New Cone
New Cone
Posts: 4
Joined: 14 Jan 2010 15:53

Re: Howto open network stream ?

Postby Helkaraxe » 01 Apr 2010 22:42

Hello.

I have been trying out libvlcnet and it seems very good but i have some problems. I have been able to open files and play them and i have been able to stream files over network.

My problem is that i cant open network streams. I get the following error: VlcTimeOutException was unhandled, Timeout waiting required state.

Here is VB.NET code..

Code: Select all

Dim mediaLibraryFactory As MediaLibraryFactory mediaLibraryFactory = New VlcMediaLibraryFactory(New String() {"--no-snapshot-preview", "--ignore-config", "--no-osd", "--plugin-path", System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly.Location), "plugins")}) Dim po As PlayerOutput = New PlayerOutput(vlc1.Window) Dim player As Player = mediaLibraryFactory.CreatePlayer(po) Dim input As New MediaInput(MediaInputType.NetworkStream, "http://85.196.91.162/VTV-LO)") player.SetMediaInput(input) player.Volume = 30 player.Play()
Does anyone know how to solve this ?

I have tried with VB.net express edition 2008 and Visual Studio 2005 and get the same errors in vb.net and c#.net


You must go to the class VlcPlayer and change the value of the timeOut member. It has a default value that is very small, chose the one you need.

Buzz_Litebeer
New Cone
New Cone
Posts: 1
Joined: 15 Apr 2010 06:34

Re: libvlcnet - .NET library based on libvlc

Postby Buzz_Litebeer » 15 Apr 2010 06:39

Howdy,

I am trying to get video and audio from a Rovio robot. I have used some of the examples and have been partially successful.

What I am attempting to do is create a video from the RTSP stream from the rovio.

When I place a VLC player control on my main form (using C#) and use the following code

Code: Select all

DZ.MediaPlayer.Io.MediaInput mi = new DZ.MediaPlayer.Io.MediaInput(DZ.MediaPlayer.Io.MediaInputType.NetworkStream, "rtsp://" + MyRovio.httpaddress + "/webcam"); //if (!vlcPlayerControl.IsInitialized) //{ // vlcPlayerControl.Initialize(); //} DZ.MediaPlayer.MediaLibraryFactory mediaLibraryFactory; mediaLibraryFactory = new DZ.MediaPlayer.Vlc.VlcMediaLibraryFactory(new string[] { "--no-snapshot-preview", "--ignore-config", "--no-osd", "--plugin-path" , System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Environment.CurrentDirectory), "plugins") }); PlayerOutput po = new PlayerOutput(vlcWindowControl1.Window); DZ.MediaPlayer.Io.OutFile of = new OutFile(@"C:\codingProjects\test.mp4"); po.Files.Add(of); DZ.MediaPlayer.Player player = mediaLibraryFactory.CreatePlayer(po); player.SetMediaInput(mi); player.Volume = 100; player.Play();
It successfully plays the audio/video from the RTSP stream, but it only creates an empty file at C:\codingProjects\test.mp4.

What am I doing wrong here. I have been trying to figure this out for several days.

To give an idea of what I am trying to do, is every time my rovio detects an object in front of it (using its IR sensor) I want it to save 10 seconds of video.

So far I can get the audio and video to display in the app, but as noted above it will not save to a file.

Can anyone help? This would be greatly appreciated. this RTSP streaming to a file has gotten be down a bit.

Hell, if you know of a good method of doing this using some other library (with helpful example code?) that would be great.

Like I said, the code above connects to the rovio and plays it in the window, and when I send the player.Stop() command it does have a file created, but the file is empty.

Again thanks for the help in advance.

SteveRicketts
Blank Cone
Blank Cone
Posts: 53
Joined: 29 May 2008 00:10

Re: libvlcnet - .NET library based on libvlc

Postby SteveRicketts » 13 May 2010 00:00

I'm trying to incorporate the libnlc control into my C# program running in Mono on openSUSE. I've placed the dll's into project/bin/debug with the rest of the code. When I hit the VlcPlayer.Initialize() statement, the program hangs. No errors are recorded. Can anyone give me some direction on what might be causing the problem?

VlcPlayer = new VlcPlayerControl();

VlcPlayer.Initialize();
<-- hangs here
VlcPlayer.PositionChanged += new EventHandler(VlcPlayer_PositionChanged);

VlcPlayer.StateChanged += new EventHandler(VlcPlayer_StateChanged);

theVideo = new MediaInput(MediaInputType.File, theURL);


Thanks,

Steve

zodiak
New Cone
New Cone
Posts: 9
Joined: 10 Jul 2010 10:15

Re: libvlcnet - .NET library based on libvlc

Postby zodiak » 10 Jul 2010 13:12

Hello All,

I'm just starting with C# and using this wrapper and I managed to place two buttons on a form, one for START and another for STOP. I load an mp3 file and press the start button and the file starts. cool. The problem is that I cannot stop the file when I press the STOP button.

I start the VLC instance on the START button click event handler, all is well. When I press the STOP button, how can I stop or pause the file?

The relevant part of the code is below:

Code: Select all

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using DZ.MediaPlayer.Io; using DZ.MediaPlayer.Vlc.WindowsForms; using DZ.MediaPlayer.Common; using DZ.MediaPlayer.Vlc.Windows; namespace SERVER10072010 { public partial class Form1 : Form { string PathtoFile; public Form1() { InitializeComponent(); } bool vlc_startstop(int mode) //0 - START PLAYER; 1 - STOP PLAYER { VlcPlayerControl vlc = new VlcPlayerControl(); if (mode == 0) //start player { vlc.Initialize(); vlc.Visible = false; MediaInput input = new MediaInput(MediaInputType.File, PathtoFile); vlc.Play(input); return true; } else if (mode == 1)// stop player { vlc.Stop(); //SO THIS IS THE PROBLEM, its like this section of code doesn't know vlc is playing, so nothing happens and the player keeps going! return true; } else return false; } private void button1_Click(object sender, EventArgs e) { if (!vlc_startstop(0)) label1.Text = "COULD NOT START PLAYER"; } private void openFileToolStripMenuItem_Click(object sender, EventArgs e) { openFileDialog1.ShowDialog(); PathtoFile = openFileDialog1.FileName; label1.Text = PathtoFile; } private void button2_Click(object sender, EventArgs e) { if (!vlc_startstop(1)) label1.Text = "COULD NOT STOP PLAYER"; }
vlc.IsInitialized seems to never be true whenever the file is playing and I press the STOP button.

Any good ideas to help me sort this out?

Many TIA,
Rui

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: libvlcnet - .NET library based on libvlc

Postby sherington » 10 Jul 2010 16:16

I start the VLC instance on the START button click event handler, all is well. When I press the STOP button, how can I stop or pause the file?

Code: Select all

bool vlc_startstop(int mode) //0 - START PLAYER; 1 - STOP PLAYER { VlcPlayerControl vlc = new VlcPlayerControl();
Looks to me like you're creating a new player control each time you press the button?

zodiak
New Cone
New Cone
Posts: 9
Joined: 10 Jul 2010 10:15

Re: libvlcnet - .NET library based on libvlc

Postby zodiak » 10 Jul 2010 19:42

Looks to me like you're creating a new player control each time you press the button?
dooh! good point! thanks.

drixs
New Cone
New Cone
Posts: 2
Joined: 14 Jul 2010 05:23

Re: libvlcnet - .NET library based on libvlc

Postby drixs » 14 Jul 2010 05:46

hi, i'm using this library to make an application that can broadcast multimedia (video and audio) through http.
the wrapper works well so far, but while i'm trying to broadcast flv file the video doesn't appear at the window, only the sound of the video.
here is the code, it's works well with avi or mp4 files

Code: Select all

using DZ.MediaPlayer.Io; using DZ.MediaPlayer.Vlc.WindowsForms; using DZ.MediaPlayer; using DZ.MediaPlayer.Vlc; Player player; VlcWindowControl vlcWin; MediaInput FileIn = new MediaInput(MediaInputType.File, file); MediaLibraryFactory mm = new DZ.MediaPlayer.Vlc.VlcMediaLibraryFactory(new string[] { "--ignore-config", "--no-osd", "--plugin-path", System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "plugins") }); PlayerOutput po = new PlayerOutput(vlcWin.Window); po.Window.Width = 258; po.Window.Height = 280; DZ.MediaPlayer.Io.OutputNetworkStream ons = new OutputNetworkStream(NetworkProtocol.HTTP, "192.168.0.102", 8000); po.NetworkStreams.Add(ons); player = mm.CreatePlayer(po); player.SetMediaInput(FileIn); player.Play();

if i'm not trying to broadcast the video using this code, there is no problem at playing flv, mp4, avi file

Code: Select all

using DZ.MediaPlayer.Io; using DZ.MediaPlayer.Vlc.WindowsForms; using DZ.MediaPlayer; using DZ.MediaPlayer.Vlc; Player player; VlcWindowControl vlcWin; MediaInput FileIn = new MediaInput(MediaInputType.File, file); MediaLibraryFactory mm = new DZ.MediaPlayer.Vlc.VlcMediaLibraryFactory(new string[] { "--ignore-config", "--no-osd", "--plugin-path", System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "plugins") }); PlayerOutput po = new PlayerOutput(vlcWin.Window); po.Window.Width = 258; po.Window.Height = 280; player = mm.CreatePlayer(po); player.SetMediaInput(FileIn); player.Play();
any advice?

zodiak
New Cone
New Cone
Posts: 9
Joined: 10 Jul 2010 10:15

Re: libvlcnet - .NET library based on libvlc

Postby zodiak » 15 Jul 2010 13:38

Hello,

I have been trying to stream through http an mp3 file using this library, but so far I'm losing the battle. I have tried to adapt the streaming code examples elsewhere on this thread but none seems to work which is fustrating because they are all streaming video and audio and that is even more complex than what I need.

I have successfully used the library to open a file and play it on my computer and now I would like to extend that concept and stream that file out.

Any pointers on how I could acheive that? Perhaps some sample code?

Thank you!

For reference, I tried to run drixs' code above (thanks!) and I couldn't make it work. I seem to have trouble with this line:

Code: Select all

PlayerOutput po = new PlayerOutput(vlcWin.Window);
but do i need that if I'm just streaming audio and I don't realy want to play it on the local machine??

flai
New Cone
New Cone
Posts: 2
Joined: 24 Jul 2010 15:19

Re: libvlcnet - .NET library based on libvlc

Postby flai » 27 Jul 2010 19:46

Can someone show working project in C #, which would play the video stream from the Internet.

darkalive
New Cone
New Cone
Posts: 2
Joined: 04 Aug 2010 16:19

Re: libvlcnet - .NET library based on libvlc

Postby darkalive » 04 Aug 2010 17:09

Hello,

Actually, I'm not a C# programmer, but in the part of project, I needed to play RTSP stream in C# via libvlc.

Up to this post, I read all posts, unfortunately, I can not understand anything.

My program is supposed to be just playing RTSP stream in a full screen, But sample codes very large and too complicated to understand for me.

Also, I can not add libvlc.dll into my project by using add reference. It gives an error.

Basicly, what can I do ?

BlackJad
New Cone
New Cone
Posts: 6
Joined: 05 Aug 2010 14:52

Re: libvlcnet - .NET library based on libvlc

Postby BlackJad » 05 Aug 2010 17:15

I need to play a video from a memorystream or byte array ... not directily from a specific file ...

Anyone have some ideas how to implement this function, if it's possible whit this library?

Tnx!

anhlunnhaque
Blank Cone
Blank Cone
Posts: 18
Joined: 01 Sep 2006 21:36

Re: libvlcnet - .NET library based on libvlc

Postby anhlunnhaque » 11 Sep 2010 04:10

hello..

Can somebody please show me where in this great libvlcnet wrapper that I can insert some code in that I can tell the player to start playing at 30 seconds mark and play audio stream 2? I am new at C# and when I start debugging..I got lost and can't find out where I can insert some code to change the star playing position and switching audio stream...please help.

Thanks!


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 20 guests