More libvlc in C#

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
mmuhammad
New Cone
New Cone
Posts: 7
Joined: 27 Apr 2007 16:22
Location: Germany

C#, RTSP, VLC

Postby mmuhammad » 27 Apr 2007 16:33

Hallo everybody;
This is my first post.. and also I am new to C#
First of all I would like to thanks Tappen for the nice program he provided.
Second allow me to introduce my self:
My name is Muhammad I am now doing my master thesis in Germany where I have in the first phase to build an application which is a media player that can support RTSP streaming from DSS.
Now I need some help in this player, that is :
* is there a doc for the VLCControl.dll
* I wanna play, pause, stop my video --- done! but pause and stop and then replay is very slow?? does any one knows the answer, its even with a local file????
* I wanna go to a specific location --- also how to do this.?
* I wanna get a frame, at a specific time, --- of course u know --- how to do this???
* How can I talk to Darwin streaming server, through RTSP, by getting some info from it??
* can we use this code to deal with a movie on frame level???
* Finally this question is for you guys, who may have got the same problem: When I try to compile the VLanControl to get the VLanControl.dll, I an getting an error in the file "VlcUserControl.Designer.cs" that says:
Error 3 'VLanControl.VlcUserControl' does not contain a definition for 'VlcUserControl_Resize' D:\My Documents\Visual Studio 2005\Projects\VLCNetInterface\VlcUserControl.Designer.cs
Do u know the solution for this..

I think thats it for now????

Thanks in advance for all of u...
:D
Muhammad Muhammad

lazaruz
Blank Cone
Blank Cone
Posts: 16
Joined: 01 May 2007 09:48

Postby lazaruz » 01 May 2007 20:08

Hi

Does anyone know how to turn of the automatic loading of a textfile?

When I have a .srt for example named exactly like the .avi, the subtitle is loaded automaticly.

Can I turn this on/off and can I load a specific text-file?

I couldn't find anything in libvlc so...

I'm using Tappen's .NET Interface.

lazaruz
Blank Cone
Blank Cone
Posts: 16
Joined: 01 May 2007 09:48

Postby lazaruz » 03 May 2007 10:19

I got the subtitle issue solved, I just needed to add "no-sub-autodetect-file" to the AddAndPlay-method.

Code: Select all

vlcUserControl1.AddAndPlay(filename, "no-sub-autodetect-file");
Now I'm wondering If any of you know why I can't start the equalizer?
I tried doing it like this but nothing happens...

Code: Select all

vlcUserControl1.AddAndPlay(filename, "no-sub-autodetect-file\naudio-filter=equalizer\nequalizer-preset=rock");

mmuhammad
New Cone
New Cone
Posts: 7
Joined: 27 Apr 2007 16:22
Location: Germany

Re: C#, RTSP, VLC

Postby mmuhammad » 03 May 2007 23:39

Hallo everybody;
This is my first post.. and also I am new to C#
First of all I would like to thanks Tappen for the nice program he provided.
Second allow me to introduce my self:
My name is Muhammad I am now doing my master thesis in Germany where I have in the first phase to build an application which is a media player that can support RTSP streaming from DSS.
Now I need some help in this player, that is :
* is there a doc for the VLCControl.dll
* I wanna play, pause, stop my video --- done! but pause and stop and then replay is very slow?? does any one knows the answer, its even with a local file????
* I wanna go to a specific location --- also how to do this.?
* I wanna get a frame, at a specific time, --- of course u know --- how to do this???
* How can I talk to Darwin streaming server, through RTSP, by getting some info from it??
* can we use this code to deal with a movie on frame level???
* Finally this question is for you guys, who may have got the same problem: When I try to compile the VLanControl to get the VLanControl.dll, I an getting an error in the file "VlcUserControl.Designer.cs" that says:
Error 3 'VLanControl.VlcUserControl' does not contain a definition for 'VlcUserControl_Resize' D:\My Documents\Visual Studio 2005\Projects\VLCNetInterface\VlcUserControl.Designer.cs
Do u know the solution for this..

I think thats it for now????

Thanks in advance for all of u...
:D
Hey Guys i need help urgently...
Please at least tell me how to get a frame image at a specific time???
Please, please
Muhammad Muhammad

Tappen
Cone that earned his stripes
Cone that earned his stripes
Posts: 150
Joined: 30 Oct 2006 07:55

Postby Tappen » 04 May 2007 02:53

FYI

There was a bug in my NativeLibVlc class that I fixed recently: the Stop function was actually calling Pause. This led to the inability to properly clear the playlist and occasion bugs where a new item would be added to the playlist but then the previous item would play instead. It is around line 1552 in NativeLibVlc.cs and is fixed in the Wiki.

Tappen

mmuhammad
New Cone
New Cone
Posts: 7
Joined: 27 Apr 2007 16:22
Location: Germany

About building the VLCvontrol

Postby mmuhammad » 04 May 2007 10:43

Hi Tappen
I really appreciate if u replied;

Now I need some help:

First I wanna know exactly how to build the VLCcontrol.dll...
because i am getting the error mentioned above.

second I wanna get an image of a frame at a particular time.

Thanks in advance.
Muhammad Muhammad

mmuhammad
New Cone
New Cone
Posts: 7
Joined: 27 Apr 2007 16:22
Location: Germany

Everything up is done except

Postby mmuhammad » 10 May 2007 16:58

Hallo every body..
I have created a player that can play and stream from DSS.
and in local files, I can navigate to whatever location I need in the file. But this can't happen while streaming, Does any one knows how to do this??
Another this does any one knows MP4 compiler, that can extract frames from MP4 files???

Thanks in advance!!!!!!!!!!!!!!!!!!!!!!
Muhammad Muhammad

mmuhammad
New Cone
New Cone
Posts: 7
Joined: 27 Apr 2007 16:22
Location: Germany

ABout VLC

Postby mmuhammad » 17 May 2007 09:58

Hallo everybody...
I would like to say for any one who would like to develop a streaming application with VLC.. is to use the LIVe555 as a streaming servers.....
Muhammad Muhammad

Master T
New Cone
New Cone
Posts: 3
Joined: 18 May 2007 13:05

Postby Master T » 18 May 2007 13:39

First of all, thanks for the great control.

I have some questions.

How can I change the equaliser settings while the file plays ?
How can I set the subtitle file during the playing?
Can I change the output while the player is running, for example start streaming or saving to the disk?
How can I do it before the player is running? I tried adding an sout option when calling AddToPlayList, but it did not work.
And last question: is there a list of options I can pass to the AddToPlaylist method?

Thanks for your help,


MT

lazaruz
Blank Cone
Blank Cone
Posts: 16
Joined: 01 May 2007 09:48

Postby lazaruz » 19 May 2007 12:00

Master T:

I have a workaround for the subtitle problem because I don't think it's possible to do ones you started the movie

I start of with this:

Code: Select all

string[] options = { "no-sub-autodetect-file" }; vlcUserControl1.AddToPlayList(filename_short, new FileInfo(filename).Name, options);
Then I load a sub-file like this:

Code: Select all

private double tmp_pos; private void InitNewSub(string subfile) { tmp_pos = vlcUserControl1.Position; vlcUserControl1.AddAndPlay(filename_short, "no-sub-autodetect-file\nsub-file=" + subfile); }
And in a timer I put this:

Code: Select all

if (vlcUserControl1.IsPlaying) { trackPos.Maximum = vlcUserControl1.Length; // Has the movie reloaded with new options? if (tmp_pos > 0 && vlcUserControl1.Position != tmp_pos) { vlcUserControl1.MoveToPosition(new TrackPosition(0, tmp_pos)); tmp_pos = 0; } }
So basically, take the position the movie has, reload the movie with the new options and jump to the old position...

Hope this helps.

mmuhammad
New Cone
New Cone
Posts: 7
Joined: 27 Apr 2007 16:22
Location: Germany

About Streaming

Postby mmuhammad » 19 May 2007 12:11

Hallo everybody..

I have found a problem with streaming from "LIVE555ServerMedia" and "onDemandTestrtspServer", the problem is:

That when I pause the media lets say at time = 20 secs. and if I waited 10 seconds the resume playing...
The player doesn't continue from time = 20 secs...
But it adds more time....
and these are: 10 secs for the waited (pausing period).... also 10 more seconds i dont know why...

That is it jumps to time=40secs..
PLEASE HELLLLLLLPPPPPPPPPPPP!!!
Muhammad Muhammad

Master T
New Cone
New Cone
Posts: 3
Joined: 18 May 2007 13:05

Postby Master T » 20 May 2007 15:35

...
Hope this helps.
Yes it does :)
one question: where can I get info on the possible options of the addandplay command ?


MT

lazaruz
Blank Cone
Blank Cone
Posts: 16
Joined: 01 May 2007 09:48

Postby lazaruz » 20 May 2007 17:57

Master T:
I'm not sure all will work but here's a list

http://wiki.videolan.org/VLC_command-line_help

Master T
New Cone
New Cone
Posts: 3
Joined: 18 May 2007 13:05

Postby Master T » 22 May 2007 21:31

I want to correct something I said earlier:
you can add the vout as an option to the play command to stream to a file

Something else entirely: I have found a bug

Code: Select all

private void button_Click(object sender, EventArgs e) { VlcUserControl control = new VlcUserControl(); Controls.Add(control); Controls.Remove(control); control.Dispose(); }
click the button twice to freeze your application

ssundar.d
New Cone
New Cone
Posts: 2
Joined: 30 May 2007 10:24

Need help for C# interface for VLAN

Postby ssundar.d » 30 May 2007 10:40

Dear Tappen and others,

Need Help for using the Vlan usercontrol in ASP.Net 2.0 Application...if so what are the steps need to follow to implement it..

for your information i have used the C# code provided by you(Tappen) for creating windows usercontrol.. let me clear with the windows Application first and later try with the web one..

1.I have Created the VLanControl UserControl using C#
2.I added the user control dll in Tool Box
3.got 2 controls named vlcuserControl and InnerVlcWindow
4.I dragged and droped the 2 controls in the form
5.and i manually added the dll named libvlc.dll and folder Pluggins in the bin\Debug folder of the windows Application.
6.Then i used the code to play the video file... but failed in the task
6.1 error shows that the vlc is not initialised
7. I used vlan version 0.8.6b

please let me know whether the steps i took are correct and please provide me the relevant steps and if possible provide me the Sample C# code to use this Vlan Usercontrol.. for both windows and web if possible.

Thanks for ur help

ssundar.d
New Cone
New Cone
Posts: 2
Joined: 30 May 2007 10:24

Need VLan Control for ASP.Net 2.0

Postby ssundar.d » 30 May 2007 12:53

Hi everybody,

The VLanControl for windows application w/o intalling the vlan package works fine...

the libvlc.dll for windows application depends on the vlc player i.e., it needs the vlan package to be installed in the current machine and it works fine if the package was installed..

so vlancontrol is best compare to libvlc.dll

and now my requirement is i need to use the vlancontrol as a webcontrol in ASP.net 2.0...

does any body has the same or any help highly appreciated.

thanks for all

CodeZilla
Blank Cone
Blank Cone
Posts: 11
Joined: 28 Jun 2007 15:40

Re: About building the VLCvontrol

Postby CodeZilla » 28 Jun 2007 17:05

Hi Tappen
I really appreciate if u replied;

Now I need some help:

First I wanna know exactly how to build the VLCcontrol.dll...
Hi there,

same question how to create the DLL file? Can someone provide me a download link? That would be great.

-AlexBar-
New Cone
New Cone
Posts: 1
Joined: 13 Jul 2007 11:36

More libvlc in C#

Postby -AlexBar- » 18 Jul 2007 11:02

How I can zoom my video?
This code doesn't work properly:

Code: Select all

vlcControl.SetConfigVariable("zoom", "0.5");
Can I retrieve information about video (codecs, bitrate, etc.)??

sukhjinder
New Cone
New Cone
Posts: 6
Joined: 03 Aug 2007 14:40

Function Call was successfull or not

Postby sukhjinder » 04 Aug 2007 11:52

Nice Work Done Tappen

Few Questions

1) How to Get Event Notifications whenever a Media File Ends
2) How to Find out whether the Last Function call was Successful or not (and reason) in particular Play(), AddAndPlay(...) Methods

I've just started using VLC for my playback needs so I may need more assistance from this forum soon

Thanks...

ror27
New Cone
New Cone
Posts: 6
Joined: 11 Aug 2007 05:02
Operating System: Windows/GentooLinux
Contact:

Re: More libvlc in C#

Postby ror27 » 11 Aug 2007 05:45

Nice work on this.

Just a couple of things I came across, sorry if they've already been updated.

In Set/Get ConfigVariable within NativeLibVlc.cs, CONFIG_ITEM.CONFIG_ITEM_STRING is the same as Module, Directory, File... so

Code: Select all

case CONFIG_ITEM.CONFIG_ITEM_DIRECTORY: case CONFIG_ITEM.CONFIG_ITEM_FILE: case CONFIG_ITEM.CONFIG_ITEM_MODULE: case CONFIG_ITEM.CONFIG_ITEM_STRING: __config_PutPsz(vlc.SubObject, name, value); break;
Enables run-time setting of Visualization etc.

Also misc new bindings:

Code: Select all

[DllImport("libvlc")] static extern float libvlc_input_get_fps(IntPtr p_input, ref libvlc_exception_t p_exception); [DllImport("libvlc")] static extern int libvlc_input_has_vout(IntPtr p_input, ref libvlc_exception_t p_exception); ... public bool HasVideo { get { 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 { int has_vout = libvlc_input_has_vout(p_input, ref vpobj.exception); if (!vpobj.exception.WasExceptionRaised()) { return (has_vout != 0); } } finally { libvlc_input_free(p_input); } } } } } catch (Exception ex) { this.lastErrorMessage = ex.Message; } return false; } } public float InputFPS { get { 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 { float fps = libvlc_input_get_fps(p_input, ref vpobj.exception); if (!vpobj.exception.WasExceptionRaised()) { return fps; } } finally { libvlc_input_free(p_input); } } } } } catch (Exception ex) { this.lastErrorMessage = ex.Message; } return float.NaN; } }
Also implementing the bindings for reading the message log would be nice, but I didn't have time to do it myself.

Thanks!

sukhjinder
New Cone
New Cone
Posts: 6
Joined: 03 Aug 2007 14:40

Change Config Variables DURING PLAYBACK

Postby sukhjinder » 12 Aug 2007 15:16

Hi Guys,

We know that to play a visualisation, delay audio, subs, etc.
we can

SetConfigVariable(VariableName, value);
VlcUserControl.AddAndPlay(fileName, Options);

then the Audio/Video File starts to Play from the BEGINNING with ALL the Effects/Config-Options Applied.

Now suppose you want to run the visualisation after half the song has played,
Or you want to adjust the Subtitles after the movie has started to play
Or Change the Equalizer preset (Pop, Rock, FullBassTreble) say halfway down your Audio/Video.

HOW TO DO THAT???

It can be done, We know VLC does that. vlclib.dll provides for that but HOW can it be done in C#???

Any Ideas???

Thanks...

Once you figure that out You can do most thing an Audio-Video Application is meant to do...

lazaruz
Blank Cone
Blank Cone
Posts: 16
Joined: 01 May 2007 09:48

Re: More libvlc in C#

Postby lazaruz » 16 Aug 2007 10:27

sukhjinder

I posted some code in an earlier message in this thread concerning subtitles, I tried it with visualizations and it works exactly the same.
So basically, take the position the movie has, reload the movie with the new options and jump to the old position...
If you look at how VLC behaves I think it does something like this to because there is a little pause when you change the visual effect.

sukhjinder
New Cone
New Cone
Posts: 6
Joined: 03 Aug 2007 14:40

Re: More libvlc in C#

Postby sukhjinder » 16 Aug 2007 12:05

Thanks for the Reply. I tried your approach before posting my message. Yes it does work but the response time is not very comforting. I stop the movie, set the config vars, restart the movie and then seek to the last saved position. The restarting part takes a lot of time. That is not very comfortable. I needed some way to adjust the subtitles' timing during the movie playback. Imagine if the user had to adjust the time 5-10 times to get to the proper value. That would mean a lot of breaks in the movie. But I guess that the user needs to fix the Subtitles' timing using some external tool to avoid all that jerking in the movie.

Still waiting for some options...

Thanks...
Last edited by sukhjinder on 03 May 2008 19:31, edited 1 time in total.

MaitreDede
New Cone
New Cone
Posts: 2
Joined: 06 May 2008 16:46
VLC version: 0.8.6f
Operating System: Vista, Ubuntu

Re: More libvlc in C#

Postby MaitreDede » 06 May 2008 17:27

Hello World !

I have compiled .net interface from wiki.
To use it, is it required to register the dll with regasm ?
Because I have a reference to the interface project, but video does not play.
Or is there a way to do it without regasm ?

dakarai
New Cone
New Cone
Posts: 1
Joined: 04 Jun 2008 16:44

Re: More libvlc in C#

Postby dakarai » 04 Jun 2008 16:48

Hey MaitreDede!

I had the same problem

After looking so much for the problem I solve It changing this code in "NativeLibVlc.cs":

Code: Select all

static NativeLibVlc() { //NativeLibVlc.vlcInstallDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase).Substring(6); //NativeLibVlc.vlcInstallDirectory = Environment.CurrentDirectory; NativeLibVlc.vlcInstallDirectory = QueryVlcInstallPath(); }
Good Luck!


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 1 guest