ChatGpt+人工修正 PyQt5 实现简易视频播放器

支持功能:
1. 视频播放速度调整
2. 视频声音调整
3. 视频当前播放帧截帧(用的ffmpeg 怎么装自己百度去,截取准确度很高,QT自带的截帧那玩意信号不触发,不好使)
4. 视频暂停

# !/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
@author  : [email protected]
@des     :

"""
import uuid
import sys
import subprocess
import traceback
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QImage, QPainter, QPixmap
from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout, QLabel, QSlider, QPushButton, \
    QFileDialog
from PyQt5.QtMultimedia import QMediaPlayer, QMediaContent
from PyQt5.QtMultimediaWidgets import QVideoWidget

class VideoPlayer(QMainWindow):
    def __init__(self):
        super().__init__()

        self.setWindowTitle("视频播放器")
        self.setGeometry(100, 100, 800, 600)

        self.player = QMediaPlayer(self)
        self.video_widget = QVideoWidget(self)

        self.speed_con = 1

        self.player.setVideoOutput(self.video_widget)

        main_layout = QVBoxLayout()

        controls_layout = QHBoxLayout()

        self.play_button 

猜你喜欢

转载自blog.csdn.net/CXY00000/article/details/131794082
今日推荐