Basically, the vlc part of my program looks like:
Code: Select all
const char * const vlc_args[] =
{
“--verbosity=2”,
“--arg-1”,
“--arg-2”,
“--snapshot-format=jpg”,
“--arg-x”
};
this->instance = libvlc_new(sizeof(vlc_args) / (sizeof(vlc_args[0]), vlc_args);
const char * const media_loc[] = {"path/to/file.avi"};
this->media = libvlc_media_new_path(this->instance, media_loc[0]);
int id = this->_pqwVideoPlaybackWidget->winId(); //QWidget which hosts the vlc player
this->player = libvlc_media_player_new(this->instance);
libvlc_media_player_set_media(this->player, this->media);
libvlc_media_player_set_xwindow(this->player, id)
libvlc_media_player_play(this->player);
Code: Select all
libvlc_video_take_snapshot(this->player, 0, "/Pictures/Dir", this->_pqwVideoPlaybackWidget->height(), this->_pqwVideoPlaybackWidget->width());
Interestingly, if I open a command line and run:
"vlc path/to/file.avi --verbose=2 --snapshot-format=jpg" and then use Shift+S to take a screenshot, the resulting file is saved as a jpg, as expected.
I have tried using "jpeg" in my config args (made no difference), as well as specifying the full filename with the .jpg extension as the third parameter of the libvlc_video_take_snapshot function. Doing that does yield a jpg file, at least in name. It is still encoded with the png module, however, and thus cannot be opened.
I have also tried using VLC 3.0.16.1 on another machine with the same version of RHEL8 and Qt 5, with the same results. I have exhausted all existing ideas for now, so I say thank you in advance for any help offered, and wish you all a happy weekend.