Code: Select all
private void stream(string VideoPath)
{
mediaInput = new MediaInput(MediaInputType.NetworkStream, VideoPath);
MediaLibraryFactory mediaLibraryFactory;
string set = @"#transcode{vcodec=h264,vb=1152,scale=1,width=640,height=480,acodec=mpga,ab=32,channels=1,samplerate=8000}";
mediaLibraryFactory = new DZ.MediaPlayer.Vlc.VlcMediaLibraryFactory(new string[]
{
":no-sout-rtp-sap :no-sout-standard-sap :sout-keep",
set,
"--plugin-path", System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Environment.CurrentDirectory), "plugins")
});
PlayerOutput po = new PlayerOutput(vlcWindowControl1.Window);
OutputNetworkStream ons = new OutputNetworkStream(NetworkProtocol.RTP, "127.0.0.1", 5445);
po.NetworkStreams.Add(ons);
player = mediaLibraryFactory.CreatePlayer(po);
player.SetMediaInput(mediaInput);
player.Play();
}
Now, NO.Can I use libvlcnet in a commercial application?
If so, are there any restrictions? actions that needs to be done?
If not, is there a way to purchase a license to do that?
Code: Select all
VlcDeployment vd = VlcDeployment.Default;
vd.Install(true);
Console.Write("VLC Deployed.");
var mediaLibraryFactory = new VlcMediaLibraryFactory(new string[]
{
"--no-snapshot-preview",
"--ignore-config",
"--no-osd",
"--plugin-path",
Path.Combine(System.Diagnostics.Process.GetCurrentProcess().StartInfo.WorkingDirectory, "plugins")
});
var output = new DZ.MediaPlayer.Io.PlayerOutput();
var player = mediaLibraryFactory.CreatePlayer(output);
var input = new DZ.MediaPlayer.Io.MediaInput(DZ.MediaPlayer.Io.MediaInputType.File, fileName);
player.SetMediaInput(input);
player.Play();
Code: Select all
if(playerOutput.IsWindowDefined)
((DoubleWindowBase) playerOutput.Window).PlayerVisibleInternal = true;
Code: Select all
if(playerOutput.IsWindowDefined)
getCurrentMediaPlayerInternal().SetDisplayOutput((int) ((DoubleWindowBase) playerOutput.Window).GetActiveWindowHandleInternal());
Hi dss2000. This is behavior of VLC itself, but I think you can control that and disable it by using parameters to VlcMediaLibraryFactory constructor. Refer to vlc --help to find out that parameter.Hi everyone! I'm having problems with libvlcnet, specifically while trying to get a single video frame (for a batch console thumbnailing application).
....After that, it WORKED. But not as expected. A Window is automatically (hey, i didn't asked for that!) created, titled "VLC - Direct3D output"Code: Select all
if(playerOutput.IsWindowDefined) getCurrentMediaPlayerInternal().SetDisplayOutput((int) ((DoubleWindowBase) playerOutput.Window).GetActiveWindowHandleInternal());
....
Thanks in advance!!!!
Code: Select all
Dim VlcPlayerControl As New VlcPlayerControl
Dim MediaInputx As New MediaInput(MediaInputType.File, "myvideo")
VlcPlayerControl.Parent = me
VlcPlayerControl.Dock = DockStyle.Fill
VlcPlayerControl.Play(MediaInputx)
If you want me to push somewhere else also - no problem. Please, feel free to contact me by e-mail I provided in previous post.How about making it official on git.videolan.org?
Code: Select all
long current = GetCurrentFrame();
long desired = GetDesiredFrame(distance);
if (desired > (current + 50)) {
JumpToFrame(desired);
}
else {
StepOne();
}
That was easy...Hi all,
I'm trying to get a Network Stream Output but haven't had much success yet. So how can I define a Player that gives me a Network Stream?
Thanks for your replay!
Best regards
Oddes
Code: Select all
try
{
if((this.vlcpc.IsDisposed)||(this.vlcpc == null))
{
this.vlcpc = new VlcPlayerControl();
this.vlcpc.Initialize();
this.vlcpc.Visible = true;
}
if (!this.vlcpc.IsInitialized) {
this.vlcpc.Initialize();
}
MediaInput input = new MediaInput( MediaInputType.NetworkStream, "rtsp://admin:admin@192.168.1.44:8557/video.mp4");
this.vlcpc.Visible = true;
if ((VlcPlayerControlState.IDLE == this.vlcpc.State) || (VlcPlayerControlState.PAUSED == this.vlcpc.State))
{
Rectangle rbmp = new Rectangle();
Bitmap bmp= new Bitmap(this.ClientSize.Width,this.ClientSize.Height * 1 / 3);
rbmp.Location = new Point(0,this.ClientSize.Height * 1 / 3);
rbmp.Size = new Size(this.ClientSize.Width,this.ClientSize.Height * 1 / 3);
this.vlcpc.DrawToBitmap(bmp , rbmp);
this.pb.Image = bmp;
this.vlcpc.Play(input);
}
}
catch (Exception e1)
{
MessageBox.Show("Carles Lloret: "+e1.ToString());
}
Code: Select all
[quote]OPTIONS rtsp://207.207.160.4:8554/xmedia?dev=103&objid=103&authorizationid=b39cea1565ce2444c9185a31afeb88574008 RTSP/1.0
CSeq: 1
User-Agent: VLC media player (LIVE555 Streaming Media v2009.03.22)
RTSP/1.0 200 OK
CSeq: 1
Date: Sat, Sep 24 2011 11:33:53 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, SET_PARAMETER
DESCRIBE rtsp://207.207.160.4:8554/xmedia?dev=103&objid=103&authorizationid=b39cea1565ce2444c9185a31afeb88574008 RTSP/1.0
CSeq: 2
Accept: application/sdp
User-Agent: VLC media player (LIVE555 Streaming Media v2009.03.22)
RTSP/1.0 200 OK
CSeq: 2
Date: Sat, Sep 24 2011 11:33:55 GMT
Server: VideoNEXT v271
Content-Base: rtsp://207.207.160.4:8554/h264media/
Content-Type: application/sdp
Content-Length: 429
v=0
o=- 1316576079161558 1 IN IP4 207.207.160.4
s=Media Presentation
i=h264media
t=0 0
a=tool:VideoNEXT streamer v2.7.1
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:Media Presentation
a=x-qt-text-inf:h264media
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=42001E;sprop-parameter-sets=Z0IAHuKQKDPz4C3AQEB4eJEV,aM48gA==
a=control:track1
SETUP rtsp://207.207.160.4:8554/h264media/track1 RTSP/1.0
CSeq: 3
Transport: RTP/AVP;unicast;client_port=64768-64769
User-Agent: VLC media player (LIVE555 Streaming Media v2009.03.22)
RTSP/1.0 200 OK
CSeq: 3
Date: Sat, Sep 24 2011 11:33:55 GMT
Transport: RTP/AVP;unicast;destination=180.190.232.217;client_port=64768-64769;server_port=53364-53365
Session: 1
PLAY rtsp://207.207.160.4:8554/h264media/ RTSP/1.0
CSeq: 4
Session: 1
Range: npt=0.000-
User-Agent: VLC media player (LIVE555 Streaming Media v2009.03.22)
RTSP/1.0 200 OK
CSeq: 4
Date: Sat, Sep 24 2011 11:33:55 GMT
Range: npt=0.000-
Session: 1
RTP-Info: url=rtsp://207.207.160.4:8554/h264media/track1;seq=63388
TEARDOWN rtsp://207.207.160.4:8554/h264media/ RTSP/1.0
CSeq: 5
Session: 1
User-Agent: VLC media player (LIVE555 Streaming Media v2009.03.22)
RTSP/1.0 200 OK
CSeq: 5
Date: Sat, Sep 24 2011 11:34:01 GMT[/quote]
It allows users to get the video from the stream and watch it in a form or ImageBox... but what about capturing still images from a rtsp stream (an IP camera).Today the first public version of library has been released. Library provides basic functionality to play a movies and music files. If you looking for a simple solution to implement features like playing mediafiles, transcoding into another formats or network streaming, it may be useful for you. Library includes .NET interop code, abstract classes, Windows Forms user controls and sample player written using Windows Forms.
Project homepage at SourceForge : https://sourceforge.net/projects/libvlcnet/
Works on Microsoft .NET 2.0, 3.5, releases for Linux planned in the future.
The sources and binaries is available under GPL at SourceForge:
https://sourceforge.net/project/showfil ... _id=242685
To build library using NAnt, execute command like this:To use library you should place libvlc dll files into the same folder as your program. See sample from 'trunk/samples' directory in the sources package.nant /t:net-2.0 clean build zip
Your opinion and feedback is more than greatly appreciated.
Return to “Development around libVLC”
Users browsing this forum: No registered users and 10 guests