Snapshot: save into a .jpg file?

This forum is about all development around libVLC.
tiliona
New Cone
New Cone
Posts: 8
Joined: 21 Nov 2008 14:12

Snapshot: save into a .jpg file?

Postby tiliona » 28 Nov 2008 10:10

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!

Arite
Big Cone-huna
Big Cone-huna
Posts: 2478
Joined: 26 Jun 2007 20:40
VLC version: 3.0.20
Operating System: Debian Testing|Win10

Re: Snapshot: save into a .jpg file?

Postby Arite » 28 Nov 2008 10:30

Have you tried "jpeg" instead (might work :))?

Arite.
Don't use PMs for support questions.

tiliona
New Cone
New Cone
Posts: 8
Joined: 21 Nov 2008 14:12

Re: Snapshot: save into a .jpg file?

Postby tiliona » 28 Nov 2008 10:35

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!

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Snapshot: save into a .jpg file?

Postby erwan10 » 28 Nov 2008 11:33

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)

andy3d
New Cone
New Cone
Posts: 1
Joined: 11 Mar 2011 12:01

Re: Snapshot: save into a .jpg file?

Postby andy3d » 11 Mar 2011 15:05

hi - is there a function in one of the plug-ins that provides snapshot functionality in jpg?
thanks,
andy


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 10 guests