Page 1 of 1

some question about snapshot

Posted: 19 Mar 2015 08:38
by robertzh
1.hi, guys,i use parameter as following:
vlc_argv[vlc_argc++] = "--snapshot-format=jpg";

but i get the file is also png format, the first 4 bytes is 89,50,4e 47, it means 'PNG'
2.another question is can vlc snapshot to memory buffer, not to file?
because i want to process it latter, if save to file, i need read from file;

Re: some question about snapshot

Posted: 01 Aug 2015 09:43
by xuanvuongspkt
Hi, are you have a answer for your problem ? Can you share it to me
Thanks !!!

Re: some question about snapshot

Posted: 03 Aug 2015 12:51
by jocomau
The code for libvlc_video_take_snapshot on 2.0.7 was:
int
libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
const char *psz_filepath,
unsigned int i_width, unsigned int i_height )
{
assert( psz_filepath );

vout_thread_t *p_vout = GetVout (p_mi, num);
if (p_vout == NULL)
return -1;

/* FIXME: This is not atomic. Someone else could change the values,
* at least in theory. */
var_SetInteger( p_vout, "snapshot-width", i_width);
var_SetInteger( p_vout, "snapshot-height", i_height );
var_SetString( p_vout, "snapshot-path", psz_filepath );
var_SetString( p_vout, "snapshot-format", "png" );
var_TriggerCallback( p_vout, "video-snapshot" );
vlc_object_release( p_vout );
return 0;
}
So it was forced every time png format, I don't know on more recent versions