yjg30737 / pyqt-graphics-video-item-video-player

Video(mp4 file only) player using QGraphicsVideoItem. Control widget at the bottom is shown/hidden followed by cursor's movement.
MIT License
16 stars 1 forks source link
pyqt pyqt-examples pyqt-tutorial pyqt-video-player pyqt5 pyqt5-application pyqt5-desktop-application pyqt5-examples pyqt5-gui pyqt5-tutorial pyqt5-video-player python python3 python37 qgraphicsvideoitem qgraphicsview qt

pyqt-graphics-video-item-video-player

Video(mp4 file only) player using QGraphicsVideoItem. Control widget at the bottom is shown/hidden followed by cursor's movement.

Note: You need K-Lite Codec to play the video with this.

Requirements

PyQt5 >= 5.8

Setup

python -m pip install git+https://github.com/yjg30737/pyqt-graphics-video-item-video-player --upgrade

Included Packages

Usage

This video player is mp4 only.

You can set the video file by dropping it to the window. That is the only way.

Example

Code Sample

from PyQt5.QtWidgets import QApplication
from pyqt_graphics_video_item_video_player.videoPlayer import VideoPlayer

if __name__ == "__main__":
    import sys

    app = QApplication(sys.argv)
    videoPlayer = VideoPlayer()
    videoPlayer.show()
    app.exec_()

Result

1. Preview of interaction between cursor movement and control widget visibility

https://user-images.githubusercontent.com/55078043/151730859-9eb8e104-9a59-4e13-9407-2a1642211221.mp4

Control widget is going to show when

Control widget is going to hide when

2. Preview of watching video with the pyqt-graphics-video-item-video-player and using control widget to navigate the video (Example video is result video of pyqt-find-replace-text-widget.) (Note: Style of slider and buttons are set to old version in the example.)

https://user-images.githubusercontent.com/55078043/147399585-e251d5fd-6285-4dce-9922-75d0a230ceb3.mp4

Note

QGraphicsVideoItem's video quality is worse than QVideoWidgets.

You maybe wonder why did i make this in the first place.

Because for some reasons, I can't show the control widget (which has transparent background) over the QVideoWidget.

I'm still trying to figure out the way to solve this problem.

One more thing, There are some flaws in timer feature and button toggling. I will fix it.