Code: Select all
"--vout-filter=deinterlace", "--deinterlace-mode=blend"
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();
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);
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()
Hi secaro.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..Does anyone know how to solve this ?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()
I have tried with VB.net express edition 2008 and Visual Studio 2005 and get the same errors in vb.net and c#.net
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..Does anyone know how to solve this ?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()
I have tried with VB.net express edition 2008 and Visual Studio 2005 and get the same errors in vb.net and c#.net
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();
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";
}
Looks to me like you're creating a new player control each time you press the 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?Code: Select all
bool vlc_startstop(int mode) //0 - START PLAYER; 1 - STOP PLAYER { VlcPlayerControl vlc = new VlcPlayerControl();
dooh! good point! thanks.Looks to me like you're creating a new player control each time you press the button?
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();
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();
Code: Select all
PlayerOutput po = new PlayerOutput(vlcWin.Window);
Return to “Development around libVLC”
Users browsing this forum: No registered users and 20 guests