More libvlc in C#

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
corvusvideo
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Mar 2008 16:14

How to set the title C# Wiki Version using 0.9.x

Postby corvusvideo » 05 Jun 2008 13:45

I am using a modified version of the Wiki C# control and libvlc 0.9 (mainly vlc_current_object replaced by vlc_object_get and a few other tweeks). It works well but I have one nagging thing I can't figure out.

By default the file name is shown on-screen. Under the ActiveX version of 0.9 you can get around this by setting the "name" argument of .playlist.add

Code: Select all

//Note: blank char as second argument prevents file name displayed on top of video axVLCPlugin21.playlist.add(filePath, @" ", options);
Can anyone tell me the equivellant operation in libvlc 0.9 ? When I saw that the C# control from the Wiki had a call that was similar

Code: Select all

string[] options = new string[] { ":no-overlay", ":drop-late-frames"}; vlc1.AddToPlayList(filePath, @" ", options);
I thought I was on to something but the second parameter is not used for anything.

Any help greatly appreciated.

P.S. I am using 0.9.x because I need the sound to continue to be heard when I do a SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, "rate", .... to something other than 1X and that part works great! Thanks VideoLan for the excellent control !!!

corvusvideo
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Mar 2008 16:14

Solved : How to set the title C# Wiki Version using 0.9.x

Postby corvusvideo » 05 Jun 2008 14:17

Duh.... Found it....

Add the option ":no-video-title-show" and it works like a charm!

Code: Select all

string[] options = new string[] { ":no-overlay", ":drop-late-frames", ":no-video-title-show" }; vlc1.AddToPlayList(filePath, " ", options);

jcvu
New Cone
New Cone
Posts: 2
Joined: 13 Jun 2008 19:47

Re: Function Call was successfull or not

Postby jcvu » 13 Jun 2008 19: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...
There is a method from libvic
static extern int __var_AddCallback(IntPtr vlc, String variable, VarChangedCallback cb,
IntPtr param);

but i cant figure out what to pass in for the variable.
Can someone expert in this implement that call to have a callback when the media file ends?

ssteffen
New Cone
New Cone
Posts: 1
Joined: 10 Jul 2008 18:15

Re: More libvlc in C#

Postby ssteffen » 10 Jul 2008 18:30

Hi,

I am trying to set up a C# interface that has two vlcUserControls and I am trying to make them switch
what they are playing while maintaining the time position.

The idea is that the user goes through a process of loading two files from two different openFileDialogs.
Then when the videos are playing the use can hit a "switch" button that flips the videos being played,
so the video playing in vlcUserControl1 gets played in vlcUserControl2, and vice versa,
and each video is played resuming where it left off at the other control.

The actual switching takes place fine, but its the position that wont work, i am using the MoveToPosition function,
but it wont work, it just keeps resetting the video at the beginning.

Here is what i have done so far, (note: this only switches from vlcControl1 to control2, it doesnt go the other way yet.)

Code: Select all

pos1 = this.vlcUserControl2.Position; //pos1 is a double, declared earlier in the program, this command also executes properly vlcUserControl1.AddAndPlay(openFileDialog2.FileName, ""); //Switch occurs (works) vlcUserControl1.MoveToPosition(new TrackPosition(0, pos1)); //problem area
I have tried debugging a great deal, and everything except the MoveToPosition function is doing what i want.
Also, i found that if i DONT switch, then it tracks to the proper position.

is this even possible? If so, how? If not, is there a workaround i can do?
Thanks

cybercockroach
Blank Cone
Blank Cone
Posts: 19
Joined: 11 Jul 2008 03:35

Re: More libvlc in C#

Postby cybercockroach » 11 Sep 2008 03:19

Is it possible to get the series of images(may be Bitmap) before render to Target window by using C# wrapper written by Tappen? or Is there another way to do something like that?
because i would like to do some image processing before images go to Target window.

Thanks

innerspace
Blank Cone
Blank Cone
Posts: 28
Joined: 10 Aug 2008 22:47
VLC version: 0.8.6
Operating System: Windows / OsX
Location: Thailand & England

Re: More libvlc in C#

Postby innerspace » 14 Nov 2008 04:57

I had exactly the same problem for ages, although I was using Shuttle in the .net wrapper rather than MoveToPosition.

It turned out that I was calling the Shuttle(position) before the file had started playing.

A simple while loop solved the problem.

while (videoPlayer.IsPlaying == false) { System.Threading.Thread.Sleep(100); }//pause until started playing

Hi,

I am trying to set up a C# interface that has two vlcUserControls and I am trying to make them switch
what they are playing while maintaining the time position.

The idea is that the user goes through a process of loading two files from two different openFileDialogs.
Then when the videos are playing the use can hit a "switch" button that flips the videos being played,
so the video playing in vlcUserControl1 gets played in vlcUserControl2, and vice versa,
and each video is played resuming where it left off at the other control.

The actual switching takes place fine, but its the position that wont work, i am using the MoveToPosition function,
but it wont work, it just keeps resetting the video at the beginning.

Here is what i have done so far, (note: this only switches from vlcControl1 to control2, it doesnt go the other way yet.)

Code: Select all

pos1 = this.vlcUserControl2.Position; //pos1 is a double, declared earlier in the program, this command also executes properly vlcUserControl1.AddAndPlay(openFileDialog2.FileName, ""); //Switch occurs (works) vlcUserControl1.MoveToPosition(new TrackPosition(0, pos1)); //problem area
I have tried debugging a great deal, and everything except the MoveToPosition function is doing what i want.
Also, i found that if i DONT switch, then it tracks to the proper position.

is this even possible? If so, how? If not, is there a workaround i can do?
Thanks


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 12 guests