QMediaPlayer with reduced video resolution
-
Hi all, I was using
QLabelwith setting pixmal and some external package (OpenCV) for reading & downsampling the video frames before displaying them in the GUI.I was thinking to transition from
QLabeltoQMediaPlayer+QVideoWidgetcombination. Problem is, my videos are very high-res and the result is lagging even on a better PC. I do not need the display of the videos in full res, hence the original solution with resizing the frame + usingQLabel. I do not need audio either. I need possibility to go to specific frame in my video (that requires closing & re-opening video stream in OpenCV, which is also not perfect).Is there any way to smartly do it while using
QMediaPlayer? I cannot pre-process full videos as the overhead is too much here, I need to downscale every time only the specific frame to be shown next. However, I could not find any possibilities like this in the docs.I have both solutions, i.e. with
QLabelandQMediaPlayertechnically working, but I am not sure for which I should decide. So I thought to ask someone with more experience: is it better to go withQLabelfor such a use case (downsampled frames, no audio, navigation in video available), or are there some significant advantages in usingQMediaPlayer? Is there any workaround to downsample the frames while usingQMediaPlayer? Maybe even option to user to dynamically select the quality he'd need (imaging something like quality selection in YouTube video)?Thanks in advance for advices.
-
Hi,
Version of Qt are you using ?
-
@SGaist said in QMediaPlayer with reduced video resolution:
Version of Qt are you using ?
Oh, apologies, it was some time after midnight and somehow I forgot to include that. I am on Qt6 via PySide6, but I guess this is a general question to Qt widgets, it is not really related to Python. The video has really high res (>4000x3000), while it is enough for me to visualize ~400x300 preview.
-
S SGaist moved this topic from General and Desktop on
-
So the backend uses ffmpeg however I don't think that you currently can delegate the resizing to it.
You could do it in a sink though but I am unsure about the performance of it.