Page 1 of 1

Snapshot: save into a .jpg file?

Posted: 28 Nov 2008 10:10
by tiliona
Dear all,

I use cygwin and VLC.0.9.6.
I want to take some snapshots of a video whenever I press any keys of the keyboard in 'jpg' format.

So I change the extension parameter from"png" to "jpg" of the function:
var_SetString( p_vout, "snapshot-format", "jpg" );
within the function:
void libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, char *psz_filepath,
unsigned int i_width, unsigned int i_height, libvlc_exception_t *p_e )
placed before the main program.

I get these errors:

Code: Select all

In function 'void libvlc_video_take_snapshot*, char*, unsigned int, unsigned int, libvlc_exception_t* )': error: 'vout_thread_t' undeclared <first use this function> error: <Each undeclared identifier is reported only once for each function it appears in.> error: 'p_vout' undeclared <first use this function> error: 'GetVout' undeclared <first use this function> ... error: invalid use of undefined type 'struct libvlc-media-player_t' /usr/include/vlc/libvlc_strustures.h:125: error: forward declaration of 'libvlc-media-player_t' ... error: 'var_SetString' undeclared <first use this function> error: 'VOUT_SNAPSHOT' undeclared <first use this function>
I include all the header files in the "include" directory, my compiling command line in cygwin is:
g++ test.cpp -lvlc -o test
Could anyone help me please? Any help would be appreciated!
Thanks in advance!

Re: Snapshot: save into a .jpg file?

Posted: 28 Nov 2008 10:30
by Arite
Have you tried "jpeg" instead (might work :))?

Arite.

Re: Snapshot: save into a .jpg file?

Posted: 28 Nov 2008 10:35
by tiliona
Thank you for answering me.

I've tried "jpeg" but I still get the same errors.
I think it may due to linking errors.
Does anyone have any ideas?!

Thanks in advance!

Re: Snapshot: save into a .jpg file?

Posted: 28 Nov 2008 11:33
by erwan10
void libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, char *psz_filepath,
unsigned int i_width, unsigned int i_height, libvlc_exception_t *p_e )
This function only supports png image format (hardcoded in source code src/control/video.c line 133).
If you stick to libvlc API, this is the only format available.

You can of course replicate the few lines of code from src/control/video.c (133 and a few more) and replace png with jpeg. That should work for vlc 0.9.x (As of today in vlc 1.x.x, you can no longer retrieve internal pointers to p_vout from libvlc)

Re: Snapshot: save into a .jpg file?

Posted: 11 Mar 2011 15:05
by andy3d
hi - is there a function in one of the plug-ins that provides snapshot functionality in jpg?
thanks,
andy