Stretching Video and Images
Posted: 03 Feb 2017 23:10
I'm attempting to play video and images inside a Qt QFrame. I have to set the QFrame dimensions manually, and need to stretch the video to match the QFrame dimensions.
No matter what I do I can't seem to get the video to stretch to both the horizontal and vertical. I want to change the video and not the widget.
I've attempted calculating the aspect ratio and setting the input to transcode as an output with a set width and height.
Any other ideas or methods out there are greatly appreciated. Thank you.
Note: I've read just about every post on this topic and haven't found that I would be able to stretch video/images to match their parent frame.
No matter what I do I can't seem to get the video to stretch to both the horizontal and vertical. I want to change the video and not the widget.
I've attempted calculating the aspect ratio and setting the input to transcode as an output with a set width and height.
Any other ideas or methods out there are greatly appreciated. Thank you.
Note: I've read just about every post on this topic and haven't found that I would be able to stretch video/images to match their parent frame.
Code: Select all
/* Create a new LibVLC media descriptor */
_m = libvlc_media_new_path(_vlcinstance, (const char *)(file.toUtf8()));
libvlc_media_add_option(_m, ":transcode{vcodec=mp4v,width=400,height=200}");
libvlc_video_set_aspect_ratio(_mp, "9:3");
libvlc_media_player_set_media(_mp, _m);
HWND windowID = reinterpret_cast<HWND>(this->winId());
/* Get our media instance to use our window */
libvlc_media_player_set_hwnd(_mp, windowID);
libvlc_media_player_set_position(_mp, 0);
/* Play */
libvlc_media_player_play(_mp);