Page 2 of 3

Could you please help me also for Same Problem

Posted: 08 Feb 2007 07:24
by mohanaryal
Hello Odysee,

can you guide me to control Aspect ratio, and Crop via code.
aryalm@vri.co.in
Thanks
Mohan Raj Aryal

Can you help me to Control Aspect Ratio and Crop from .net

Posted: 08 Feb 2007 07:44
by mohanaryal
Hello Tappen

I became able to play the MP4 video to my picturebox within windows form. Now I want to change the aspect ratio and crop for the same. The aspect ratio, and crop control i found in vlc player simple by right clicking on it.

thank you

Posted: 09 Feb 2007 06:57
by mohanaryal
Hi,

can you provide me the Chris Meadowcroft's VLC code in vs 2003 in c#.

Please you will be thankful

Mohan
Hi everybody, I made a project in VS 2005 to use LibVlc.cs.

I first created a Windows Application (containing Form1.cs and Program.cs), then I made a class called LibVlc.cs.

In Form1.cs, I only have:

Code: Select all

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace CustomVlcPlayer { public partial class Form1 : Form { public Form1() { InitializeComponent(); LibVlc.LibVlc vlc = new LibVlc.LibVlc(); vlc.Initialize(); MessageBox.Show(vlc.LastError); vlc.VideoOutput = pictureBox1; vlc.PlaylistClear(); vlc.AddTarget("F:\\....\\matrix.mpg"); vlc.Play(); } } }
I cannot import the libvlc.dll file, when i did right click on the project then "add reference...", search the libvlc.dll file and "ok" i have the error message :

Une reference a "D:\....\libvlc.dll" n'a pas pu etre ajoutee. Assurez vous que le fichier est accessible et qu'il s'agit d'un assembly valide ou d'un composant COM

If I run the project without libvlc.dll in my project, I have this error :
could not find libvlc
This is normal !

Am I doing something wrong ? if yes, can someone help me with that and give me the correct solution to succeed?

thank you very much.

ParKiN

Video conferencing For Deaf People

Posted: 18 Feb 2007 07:28
by adilfazal
Hi Odysee,
I m working on Video conferencing solution for deaf people for charity purpose. I m using Window Media Video Codec 9 but it not give desire result. I have experince in C# please send me C# wraper at this address adilfazal@yahoo.com
and please tell me using this can i receive 20 frps at 128Kbps

Regards,
Adil Fazal

Posted: 19 Feb 2007 19:32
by olixelle
hello :)

well i used ur code to display rtsp stream.
It works.
But...
Display quality is not really good and channel changing is very slow.
I do not use any options to read a stream.
Before, i used vlc activex and it worked greatly

do u have any idea ?

thanks :)

Read DVD folder using libvlc

Posted: 19 Feb 2007 21:49
by kevint03
Hi Odysee,

First, thank you for your good work.

I am new to VideoLan. After reading your post regarding C# wraparound for libvlc, I am interested in creating a little video player for fun. I have a question for you. In you wrapper, there is a TargetAdd function that allows us to add a file to the playlist to play. I wonder if it can accept the whole directory, and inteligently fill the playlist with with only media files. In other word, I would like to create the same feature that VideoLan player's Open Directory function does.

Thanks,
Kevin

Posted: 19 Feb 2007 21:52
by olixelle
hello kevin,

addtarget can only receive a file or a playlist
u have to parse files in directory by yourself and then u add each item to the playlist usin addtarget wrapper

Loading dvd folder

Posted: 20 Feb 2007 08:53
by kevint03
Hi Odysee,

Yes, I can read the folder and fill in the playlist with media files one by one, but I don't have the ability to jump from one chapter to another. It seems that there are dvd navigation file in the folder that help link all the media files together. I guess I need to look at the VideoLan player source code to find out how it does with its function Open Directory.

Thanks,
Kevin

Problem On Multiple Playbacks (in Win XP)

Posted: 28 Feb 2007 11:40
by mohanaryal
Hi,
I am using Odysee's LibVlc class for my customized player. The output video I am displaying on a picturebox. when i play one time or for some time like 1 hour, 2 hour etc. it works fine. But if I do the continuous play then the picturebox displays nothing sometimes after 3 hour sometimes after 5 hours etc. My other contentent are working properly within my player.

I have few doubts:

- Is there any log provision ??
- I have reinitialized the LibVlc object each time changing video, is it the right way of doing? because on simple stop and play the error comes earlier than above.
- is there any windows problem when we use vlc control continuously.
- Is there any services to be enabled or disabled in windows XP which are disturbing?

My contents are MPEG4 HD contents. I am using VLC 8.5. my OS is WINXP.

Please help me, i tried forum search but didn't find any possible answer. If it is already answered please pass me the url because i m getting trouble on search.

Mohan

Re: Usage of libvlc.dll in C#

Posted: 09 Jul 2007 18:16
by tvproducer
How can I get the Stats information?

For example, using the following I can get the Meta Information from your .NET control:

const String Meta_information = "Meta-information";
public string GetMetaInfo(string strMetaParam) {
using (VlcObject vobj = new VlcObject
(this.vlcHandle, ObjectType.VLC_OBJECT_INPUT)) {
if (vobj.SubObject != IntPtr.Zero) {
IntPtr resultString = IntPtr.Zero;
input_Control(vobj.SubObject,
input_query_e.INPUT_GET_INFO,
Meta_information, strMetaParam, ref
resultString);
string res = Marshal.PtrToStringAnsi
(resultString);
return BaseTools.UTF8ToIso8859(res);
}
}
return "";
}

But a similar approach does not work for the Statistical Data from a stream?
For example, I tried to get the Statistical data using this function but it doesn't work:

const String Stats_information = "Stats-information";
public string GetStatsInfo(string strStatsParam) {
using (VlcObject vobj = new VlcObject(this.vlcHandle,
ObjectType.VLC_OBJECT_STATS))
{
if (vobj.SubObject != IntPtr.Zero) {
IntPtr resultString = IntPtr.Zero;
input_Control(vobj.SubObject,
input_query_e.INPUT_GET_INFO,
Stats_information, "Decoded blocks", ref
resultString);
string res = Marshal.PtrToStringAnsi
(resultString);
return BaseTools.UTF8ToIso8859(res);
}
}
return "";
}

Could you tell me how to get any of Statistical Information above using your .NET interface?
/* Input */ "Input"
INPUT_ADD( "Read at media", read_bytes_text, "0" );
INPUT_ADD( "Input bitrate",
input_bitrate_text, " 0" );
INPUT_ADD( "Demuxed", demux_bytes_text ,"0");
INPUT_ADD( "Stream bitrate", demux_bitrate_text, "0" );
/* Sout */ "Streaming"
SOUT_ADD( "Sent packets",
sout_sent_packets_text, " 0" );
SOUT_ADD( "Sent bytes", sout_sent_bytes_text, "0" );
SOUT_ADD( "Send rate", sout_send_bitrate_text, "0" );
/* Vout */ "Video"
VIDEO_ADD( "Decoded blocks", video_decoded_text, "0" );
VIDEO_ADD( "Displayed frames", displayed_text, " 0" );
VIDEO_ADD( "Lost frames", lost_frames_text, "0" );
/* Aout */ "Audio"
AUDIO_ADD( "Decoded blocks", audio_decoded_text, " 0" );
AUDIO_ADD( "Played buffers", played_abuffers_text, "0" );
AUDIO_ADD( "Lost buffers", lost_abuffers_text, "0" );
thanks!!

Re: Usage of libvlc.dll in C#

Posted: 20 Sep 2007 10:29
by publicENEMY
tappen

there are no implementation for VlcUserControl_Resize() event in VlcUserControl.Designer.cs. have anyone ACTUALLY try this?

can you provide a simple tutorial to interface VLanControl or more information on VLanControl.

from what i understand, thera are two way to use VLanControl. one is from VlcUserControl, a inherited UserControl class and the other one is from NativeLibVlc class. NativeLibVlc is the VideoLan interop class. VlcUserControl is a class that you can treat like any other windows forms. VideoLan usage documentation applies to NativeLibVlc. While there are no usage documentation for VlcUserControl. for example, do i need to explicitly initialize VlcUserControl?

thanks in advance.

Re: Usage of libvlc.dll in C#

Posted: 15 Dec 2007 18:00
by sarahwyt
Hi,

I need to embed VLC into my C# application so as to display the live video that is being captured by my web camera.

Anyone can help?


Thanks!

Sarah

Re: Usage of libvlc.dll in C#

Posted: 17 Dec 2007 03:19
by arogan
Is there any way to get/set the current title using libvlc? I'm talking about when you are playing a dvd iso I need to be able to get/set the current dvd title #.

Re: Usage of libvlc.dll in C#

Posted: 04 Jan 2008 08:47
by mikele
First of all, thanks for your work Odysee, it works like a charm, it's very clean and easy to understand.

I've been reading libvlc's documentation but my programming skills are not enough to find a solution, so I hope someone here can help me. I'm using Odysee's code to play some audio and video online streams, and I'd like to ask libvlc a couple of things about those streams, for example which codecs are being used and the bitrate of the stream. Since VLC shows this info, I think I should be able to get it from libvlc, but I don't know which function I should use.

Any help will be really appreciated!
Thanks in advance!

Re: Usage of libvlc.dll in C#

Posted: 14 Jan 2008 16:08
by equitel
Hello,

Anybody kowns how to get the bit-rate and packets recived?.

Please, write me caddress at gmail.com

Thanks,

Re: Usage of libvlc.dll in C#

Posted: 16 Jan 2008 07:58
by howdini
Hi, i've been struggling with this bitrate issue myself. I can see that the vlc player can retrieve the current bitrate of a stream in real time. How can one emulate this. Below is my c# code written in an attempt to do this. So far it just bugs out on the dll call. Where am i going wrong.
Also, is one supposed to use the mediacontrol_get_stream_information() library function to retrieve this info.
(Placed this code in the nativelicVlc.cs)

[StructLayout(LayoutKind.Sequential)]
struct strInfo
{
public IntPtr width;
public IntPtr height;
public IntPtr aspect_ratio;
public Int64 bitrate;
public IntPtr codec;
public IntPtr author;
}

static extern strInfo mediacontrol_get_stream_information(IntPtr vlc, mediacontrol_PositionKey pKey, VlcError err);

public long GetStreamInfo()
{
strInfo sif;
sif.bitrate = 0;
try
{
using (VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))
{
if (vobj.SubObject != IntPtr.Zero)
{
sif = mediacontrol_get_stream_information(vobj.SubObject, mediacontrol_PositionKey.mediacontrol_MediaTime ,
VlcError.Exception);
return Convert.ToInt64(sif.bitrate);
}
}
}
catch (Exception)
{ }
return lng;
}

Re: Usage of libvlc.dll in C#

Posted: 16 Jan 2008 10:48
by equitel
Hello,

I have error, I haven`t more ideas, I try with the folow code but ocurrs the same.

sif = mediacontrol_get_stream_information(p_input, mediacontrol_PositionKey.mediacontrol_MediaTime, ref vpobj.exception);

Do you have more ideas?

Andrés

Re:

Posted: 19 Jan 2008 08:32
by ssssssssssss
Hi,
here is a sample for c#.

I have also written a wrapper in managed c++ (assembly)! If you want, i can mail you the project!

ciao Odysee
Hi, could you share it with me ?
My Email: wanliyou@gmail.com
Thanks!

Re: Usage of libvlc.dll in C#

Posted: 19 Jan 2008 12:28
by Cheetah
Hi there,

Does anyone have a full project for use of VLC in Visual Studios?

Could you please email it to me: ruudbarron@hotmail.com

Thanks.

EDIT: Or upload it here?

Re: Usage of libvlc.dll in C#

Posted: 19 Jan 2008 19:46
by Jean-Baptiste Kempf
You can't compile VLC in Visual Studio, btw...

Any VS guru ?

Re: Usage of libvlc.dll in C#

Posted: 20 Jan 2008 16:32
by Cheetah
So I can't use this within my C#.NET application?

All I want to do is play videos through VLC player? - I thought that was what this thread was for :s

Re: Usage of libvlc.dll in C#

Posted: 28 Jan 2008 20:41
by sr55

Code: Select all

Functions.LibVlc vlc = new Functions.LibVlc(); vlc.Initialize(); vlc.VideoOutput = pictureBox1; vlc.PlaylistClear(); vlc.AddTarget("S:\\test.avi"); vlc.Play();
Thats the code I used to make it work. I did change the namespace in my applicaiton to Fucntions.LibVLC though so that line would need changed. Also pictureBox1 needs to be changed to the name of your picturebox.

That code just when inside the button clicked code.

Hope that helps.

Re: Usage of libvlc.dll in C#

Posted: 30 Jan 2008 05:12
by iamnotgeorge
Hi All,

I am writing an application in C# which is using VLC(libvlc.dll) to play internet radio. The player is nice and able to play. I can get the now playing event or poll the playing state ram, but how can I get any "Fail to play event"?? For example, invalid link, network disconnect, cannot decode etc etc ....

Thanks you for any reply and hints.

Re: Usage of libvlc.dll in C#

Posted: 30 Jan 2008 09:16
by equitel
Hello,

I am interested playing internet radio, now I can only visualize video stream.

Can you share the code?

Send me at caddress@gmail.com

Regards, Andrés

Re: Usage of libvlc.dll in C#

Posted: 31 Jan 2008 11:03
by iamnotgeorge
Hello,

I am interested playing internet radio, now I can only visualize video stream.

Can you share the code?

Send me at caddress@gmail.com

Regards, Andrés
I am using the sample code on the first page... nothing special for internet radio... just add the radio link by addtarget like open other media file, so I would say the player is "nice" as I do nothing to handle...