libvlc_video_take_snapshot() in C#

This forum is about all development around libVLC.
hussam_2000
Blank Cone
Blank Cone
Posts: 65
Joined: 03 Aug 2010 21:03

libvlc_video_take_snapshot() in C#

Postby hussam_2000 » 27 Dec 2010 22:52

Hello,
im having trouble taking snapshots , im using VLC1.1.4 in a winform C# app. Everyting works great except for libvlc_video_take_snapshot. when i ask for a snapshot nothring happenes :

code:

Code: Select all

[DllImport("libvlc")] internal static extern void libvlc_video_take_snapshot(IntPtr p_media_player, [MarshalAs(UnmanagedType.LPStr)] string psz_filepath, uint i_width, uint i_height);

Code: Select all

public void TakeSnapShot(String file, int width, int height) { uint width_1 = (uint)width; uint height_1 = (uint)height; LibVlc.libvlc_video_take_snapshot(Handle, file, width_1, height_1); } public int Height { get { int rtn = LibVlc.libvlc_video_get_height(Handle); return rtn; } } public int Width { get { int rtn = LibVlc.libvlc_video_get_width(Handle); return rtn; } }



so when i click to take a snapshot ..

Code: Select all

private void toolStripButton4_Click(object sender, EventArgs e) { TakeSnapShot("photo.png",Width,Height); //also tried "C:\\snapshotFolders\\photo.png" // tried having Width and Height set to equal "0" as a default }
nothing happenes,no crahsed , and no lagging ( as some people experienced with 9.8.0 and other DLLs) . when i researched the subject , i found out that some people got the file to be generated without images ( in C++) and others had exceptions and crahses ( also in C++) but i have not found anyone who got this feature to work in C#. The function looks simple but doesnt work for me . Does it have to do with the arg string ? do i ned to enable the snapshot feature ?

my args are:

Code: Select all

args = new string[] { "-I", "dummy", "--ignore-config", @"--plugin-path=C:\Users\bin\Debug\plugins"};
Thank you :(

hussam_2000
Blank Cone
Blank Cone
Posts: 65
Joined: 03 Aug 2010 21:03

Re: libvlc_video_take_snapshot() in C#

Postby hussam_2000 » 28 Dec 2010 21:59

Nevermind ... got it :)

henrymark
Blank Cone
Blank Cone
Posts: 46
Joined: 11 Aug 2009 09:55

Re: libvlc_video_take_snapshot() in C#

Postby henrymark » 03 Mar 2011 08:02

Excuse me, could you share your method? I have the same problem! Thx A Lot!


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 13 guests