libvlc_new always return null in vlc 2.1.3
Asked Answered
V

2

0

libvlc_new always return null. I have copied libvlc.dll and libvlccore.dll in debug folder of my solution directory.

We have also tried calling libvlc_new(0,null) and set the environment variable "VLC_PLUGIN_PATH " to plugins directory, with same result.

Any pointer what is going wrong/ or what is the best way to access libVlc API programmitically in .net environment.

PLEASE FIND CODE SNIPPET BELOW deveopled in C#, VS2010.

IntPtr instance, player ;
string[] args = new string[] {
"-I", "dummy", "--ignore-config",
@"--plugin-path=D:\plugins",
"--vout-filter=deinterlace", "--deinterlace-mode=blend"
};
instance = LibVlc.libvlc_new(args.length, args);
IntPtr media = LibVlc.libvlc_media_new_location(instance, @"rtsp://username assword@IP_address/path");
player = LibVlc.libvlc_media_player_new_from_media(media);
LibVlc.libvlc_media_player_set_hwnd(player, panel1.Handle);
LibVlc.libvlc_media_player_play(player);

we have done P/Invoke for corresponding library calls as:

[DllImport("D:\\myvlc\\myvlc\\bin\\Debug\\libvlc", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr libvlc_new(int argc, [MarshalAs(UnmanagedType.LPArray,
ArraySubType = UnmanagedType.LPStr)] string[] argv);

[DllImport("D:\\myvlc\\myvlc\\bin\\Debug\\libvlc", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr libvlc_media_new_location(IntPtr p_instance,
[MarshalAs(UnmanagedType.LPStr)] string psz_mrl);

[DllImport("D:\\myvlc\\myvlc\\bin\\Debug\\libvlc", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr libvlc_media_player_new_from_media(IntPtr media);

[DllImport("D:\\myvlc\\myvlc\\bin\\Debug\\libvlc", CallingConvention = CallingConvention.Cdecl)]
public static extern void libvlc_media_player_set_hwnd(IntPtr player, IntPtr drawable);

[DllImport("D:\\myvlc\\myvlc\\bin\\Debug\\libvlc", CallingConvention = CallingConvention.Cdecl)]
public static extern void libvlc_media_player_play(IntPtr player);
Vada answered 9/4, 2014 at 14:27 Comment(1)
Found solution, all u need to do is to copy plugins folder to the debug directory of your visual studio solution folder. Hope this would save some time for others trying the same thing. I have been trying this for almost 1 day.Vada
V
0

Found solution, all you need to do is to copy plugins folder to the debug directory of your visual studio solution folder. Hope this would save some time for others trying the same thing. I have been trying this for almost 1 day.

Vada answered 23/6, 2015 at 11:16 Comment(0)
D
3

The param --plugin-path" was ignored.

By copying the whole plugin directory works with 2.1.3.

Dola answered 21/5, 2014 at 12:42 Comment(0)
V
0

Found solution, all you need to do is to copy plugins folder to the debug directory of your visual studio solution folder. Hope this would save some time for others trying the same thing. I have been trying this for almost 1 day.

Vada answered 23/6, 2015 at 11:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.