Page 1 of 1

Image capture

Posted: 28 Feb 2007 19:12
by DMora
Hello all,

We want to use VCL player in a C++ Builder project to make video processing. We are trying it using the ActiveX component, but we need to capture single frames into memory. Which is not being simple...

The snapshot function (not available in activeX) only sends the image to a file. Does anyone have any idea how can we capture single frames using the ActiveX component or using the VCL DLL to a Picture GUI component?

Thanks for help,

Posted: 28 Feb 2007 20:59
by DMora
It is probably important to say that we are using DVDs.

Posted: 10 Apr 2007 07:44
by matt271
i been trying to do this also. let me know if you have any success.

Re: Image capture

Posted: 19 Jul 2007 19:20
by cmacholz
I also need this functionality. Haven't found a solution so far.

Re: Image capture

Posted: 04 Aug 2007 22:39
by andreaplanet
I also need this functionality. I'm available to write some code for VLC if someone give me a suggestions for the right path...
I just need to export some frames to a file.

Re: Image capture

Posted: 17 Aug 2007 18:13
by cmacholz
Add this code to the NativeLibVLC.cs

Works for *.jpg or *.png file names. I found that the jpg are not created correctly, but most image viewers can render it correctly.

//Craig added 7/19/2007
public bool SaveCurrentView(string file)
{
bool worked = false;
try
{
using (VlcPlaylistObject vpobj = new VlcPlaylistObject(this.vlcHandle))
{
if (vpobj.SubObject != IntPtr.Zero)
{
IntPtr p_input = libvlc_playlist_get_input(ref vpobj.libvlc, ref vpobj.exception);
if (vpobj.exception.WasExceptionRaised())
{
this.lastErrorMessage = Marshal.PtrToStringAnsi(vpobj.exception.psz_message);
}
else
{
try
{
libvlc_video_take_snapshot(p_input, file, ref vpobj.exception);
if (!vpobj.exception.WasExceptionRaised())
{
worked = true;
}
else
{
worked = false;
}
}
finally
{
libvlc_input_free(p_input);
}
}
}
}
}
catch (Exception ex)
{
this.lastErrorMessage = ex.Message;
}
return worked;

}