libvlc_video_take_snapshot hardcoded PNG format
Hi!
I have noticed that passing --snapshot-format=jpg
as option upon initialisation seems to be ignored, as the saved snapshots still are in PNG format (and size).
I took a quick look at the libvlc_video_take_snapshot
method in video.c:
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. All parameters should be passed at once
* (obviously _not_ with var_*()). Also, the libvlc object should not be
* used for the callbacks: that breaks badly if there are concurrent
* media players in the instance. */
var_Create( p_vout, "snapshot-width", VLC_VAR_INTEGER );
var_SetInteger( p_vout, "snapshot-width", i_width);
var_Create( p_vout, "snapshot-height", VLC_VAR_INTEGER );
var_SetInteger( p_vout, "snapshot-height", i_height );
var_Create( p_vout, "snapshot-path", VLC_VAR_STRING );
var_SetString( p_vout, "snapshot-path", psz_filepath );
var_Create( p_vout, "snapshot-format", VLC_VAR_STRING );
var_SetString( p_vout, "snapshot-format", "png" );
var_TriggerCallback( p_vout, "video-snapshot" );
vout_Release(p_vout);
return 0;
}
and I can't help but notice that the snapshot-format seems to be hardcoded instead of a parameter (var_SetString( p_vout, "snapshot-format", "png" );
), but honestly I'm out of my depth looking at the VLC source code in C.
I appreciate this is not a major issue, nor a priority, but it would be great if, in the future, the snapshot format could be passed as parameter.
Thank you!