Python How To Create Media Player In PyQt5

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ธ.ค. 2024

ความคิดเห็น • 92

  • @arminrad5357
    @arminrad5357 2 ปีที่แล้ว +2

    If you cant play MP4 files, try to convert the file to WMV and it will work

  • @irisbotlsec
    @irisbotlsec ปีที่แล้ว

    Amazing! How can I add picture in picture?

  • @gdaliygarmiza4723
    @gdaliygarmiza4723 4 ปีที่แล้ว +1

    Hi, Parwiz! Thank you very much for your useful videos. But I can't get the QMediaPlayer to work with this code under MacOs (High Sierra) (. And unfortunately, I cannot find the solution on any forum. It doesn't give out any errors. Just hanging when trying to play a video or audio file. Its state is "playing", but nothing is actually played. I can just toggle between play/pause states of the button without any changes. Do you have any ideas, what can I do with this? Thank you in advance!

    • @hewhoshallliveinpeace5676
      @hewhoshallliveinpeace5676 4 ปีที่แล้ว

      Im not really a mac user but could video format be the cause? I know you're not getting any errors but it could be that PyQt5 recognises the format, but cant read it due to software restrictions

  • @alihussainfarzad9943
    @alihussainfarzad9943 4 ปีที่แล้ว

    😘😘😘😘😘
    بهترینی عزیز همیشه موفق باشی

  • @liyue8772
    @liyue8772 3 ปีที่แล้ว +2

    Hi Parwiz,
    Thank you so much for this great great video. Does the QMediaPlayer use the codec installed on my Windows computer? Somehow, I can’t play MP4 (H264) with this player but I can play MP4 using VLC and Windows Media Player. Could you please let me know how I can play MP4 using this player?

    • @ParwizForogh
      @ParwizForogh  3 ปีที่แล้ว

      have you installed the required codec that i have said in the video, there is no problem it is working with Mp4 videos., also you can run your file via terminal and in there you will receive the error.

    • @liyue8772
      @liyue8772 3 ปีที่แล้ว

      Hi Parwiz, thank you so much for replying my message. I played this video from the beginning to the end but didn’t see installation of codec. Is it in another video?@@ParwizForogh

    • @ParwizForogh
      @ParwizForogh  3 ปีที่แล้ว

      @@liyue8772 You can just watch my newest video and i have mentioned the required codec th-cam.com/video/45sPjuPJ3vs/w-d-xo.html

    • @liyue8772
      @liyue8772 3 ปีที่แล้ว

      @@ParwizForogh Hi Parwiz,
      Thank you so much for the link! I just went to Patreon, I'm now a proud supporter of your program! I'm writing a player that plays 2 videos in Python, do you have any video examples of enlarging video (full screen) and zoom back down?

    • @ParwizForogh
      @ParwizForogh  3 ปีที่แล้ว

      @@liyue8772 Thanks, no for right now i don't have any video, but QtMultiMedia is a big module, and i have a plan in the future that build a complete media player with more functionalities

  • @anthoulapatsinakidou6530
    @anthoulapatsinakidou6530 2 ปีที่แล้ว

    Thanks for the amazing video! It really helped a lot! I was wondering if there is a way to display an ellipse on top of the video playing in this media player cause i cant seem to make it appear. Thanks in advance!

  • @el07694
    @el07694 4 ปีที่แล้ว

    Hello,
    Do you suggest me to use python-vlc to play audio files or the built in media player of pyqt5?

  • @Scienox
    @Scienox ปีที่แล้ว

    It's possible to launch a youtube video ? Like url and follow a live video Yt?

  • @stoyboy1044
    @stoyboy1044 4 ปีที่แล้ว +3

    i completly copied your code and its still not working installed all the modules.
    i can select a video but when i press play nothing happens :/

    • @prachipoddar6
      @prachipoddar6 4 ปีที่แล้ว

      I am facing the same problem, plz let me know if you have figured it out

    • @abdalla9
      @abdalla9 4 ปีที่แล้ว

      i face a problem like yours: you can download and install the K-Lite then the video will work without any error but i don't know if your problem like mine or not my error was: "DirectShowPlayerService::doRender: Unresolved error code 0x80040266 (IDispatch error #102)"

  • @abdalla9
    @abdalla9 4 ปีที่แล้ว

    it is very useful video but i want to know how do you know the code lines you write?? i mean that should i do if i want to add more buttons that is not in your video ==> how to know its name and libraries in pyqt5 ??? "i ask about advice"

  • @siswanto-7370
    @siswanto-7370 4 ปีที่แล้ว

    nice tutorial,
    btw, how to enable/disable Left/Right audio channels, since my video has 2 channels, music and vocal audio track.

  • @FactFlame_Network
    @FactFlame_Network ปีที่แล้ว

    Thanks for the source code bro because I got some errors 😅

  • @HarjotSingh-li1ns
    @HarjotSingh-li1ns 3 ปีที่แล้ว

    Nice video but i want to add screen shot feature in it how to do so plz help

  • @ADR-SAMBOX
    @ADR-SAMBOX 4 ปีที่แล้ว

    Amigo obrigado por posta os videos se puder me ajudar agradeço caso não saiba do mesmo jeito obrigado .
    Como eu faço para colocar um texto sobre o video tipo o video ta passando mostra ele em cima do video no pyqt5 ?

  • @murraymacdonald4959
    @murraymacdonald4959 4 ปีที่แล้ว +2

    Great stuff. Thank you.

  • @sarthakgupta3508
    @sarthakgupta3508 4 ปีที่แล้ว +1

    In video 19.30 the video is not play in my system please help

  • @digitalmachine0101
    @digitalmachine0101 6 หลายเดือนก่อน

    Good information

  • @bilalbede3407
    @bilalbede3407 3 ปีที่แล้ว

    for filename list error change
    self.mediaPlayer.setMedia(QMediaContent(QUrl.fromLocalFile(filename[0])))

  • @mehdismaeili3743
    @mehdismaeili3743 2 ปีที่แล้ว

    Excellent.

  • @dtdzung7138
    @dtdzung7138 4 ปีที่แล้ว

    Thank you for the great video. Follow your guide I can play the video with the size 640x360 but it doesn't work when I try with the video size 1280x720. Does the video size matter? What can be the problem?

  • @YarinSk8er
    @YarinSk8er 3 ปีที่แล้ว

    Hey man first of all thanks for the explanation,
    for me it doesn't work much i open a video and when i press play the video doesn't play and the whole window shuts down do u have any solution?

  • @olankendrickcanobas5184
    @olankendrickcanobas5184 4 ปีที่แล้ว

    hi bro.can u help me make a video player that can embed network url using python or java? thank you very much!!

  • @onuraltunisik
    @onuraltunisik 4 ปีที่แล้ว

    How can I set size of videoplayer ? For example I want to set it 250x250 from the (50,50) pixel

  • @engineeringresponse4406
    @engineeringresponse4406 4 ปีที่แล้ว

    Can you add previous, next and step forward and backward frame by frame buttons ?

    • @ParwizForogh
      @ParwizForogh  4 ปีที่แล้ว

      next time i will add, but you can extend this media player and there are alot that you can do

  • @naveenkumarm7339
    @naveenkumarm7339 4 ปีที่แล้ว

    Great.
    Just one Question when to use "QDialog" and "QMainWindow" ?

    • @jianchangchen7548
      @jianchangchen7548 3 ปีที่แล้ว

      QMainWindow contains a menu bar, of course, you can choose it

  • @Revalium
    @Revalium 4 ปีที่แล้ว

    Thank you for your videos, how can i make the MainWindow transparent ? i load the ui file with uic.loadUi() . and what about others like pushButtons and frames opacity control?? can you help me please ?

    • @Revalium
      @Revalium 4 ปีที่แล้ว

      به به ! من نفهمیدم ایرانی هستی واقاً دمت گرم با آموزشات عالیه ! موفق باشی

    • @ParwizForogh
      @ParwizForogh  4 ปีที่แล้ว

      تشکر البته مه از افغانستان هستم و آه بخاطر تغیر اوپستی ما ایتو کدام چیز مخصوص نداریم اما میتانی با استفاده از استایل شیت این کار ره انجام بدهی
      Qt Style Sheet

    • @Revalium
      @Revalium 4 ปีที่แล้ว

      Parwiz Forogh بازم موفق باشی
      MainWindow has a system background and css can not remove it ! This is my problem . The another classes are ok

    • @keymediastudioitself
      @keymediastudioitself 3 ปีที่แล้ว

      opacityLevel = .7
      class Window(QWidget):
      def __init__(self):
      super(Window, self).__init__()
      ...
      self.setWindowOpacity(opacityLevel)

  • @ruhatkahraman7529
    @ruhatkahraman7529 4 ปีที่แล้ว

    hi first off all when ı was write code (ı want to just open window) why can not open?(under the class code)

  • @yesican5205
    @yesican5205 หลายเดือนก่อน

    Thank you.

  • @srejusjayakumar
    @srejusjayakumar 4 ปีที่แล้ว

    Did it support mkv or mp4 files

  • @FatimaAli-zu8fd
    @FatimaAli-zu8fd 4 ปีที่แล้ว

    which python version you are using?

    • @ParwizForogh
      @ParwizForogh  4 ปีที่แล้ว

      iam using python 3.6

    • @mukkarrammoin6513
      @mukkarrammoin6513 4 ปีที่แล้ว

      Have you solve your error? If yes then please help me how to remove the error. i read your comment on blog.

  • @LNippur
    @LNippur 4 ปีที่แล้ว

    Thanks, with this I will expand an unfinished example in PyQt4 that uses phonon and that is not available for PyQt5 now. I think I can achieve it even when I started watching Python 5 days ago and I was excited to see that with very few lines of code I could download files and even resume. I was trying to do the same with freepascal \ Lazarus and some libraries failed with the resume and others did not work. So here I am making my way walking with the Python language, mimicking that of "walker there is no way, it makes way when walking". (Translated from Spanish to English by Google)

  • @dbksoundsolutions9908
    @dbksoundsolutions9908 4 ปีที่แล้ว

    can someone help please trying to get pyqt5 install files but having a hard time. Thanks in advance

    • @mrittunjoysarkar4795
      @mrittunjoysarkar4795 4 ปีที่แล้ว

      is there any way to contact you?

    • @abdalla9
      @abdalla9 4 ปีที่แล้ว

      what is your problem ???
      you can contact me on discord to send me the error to solve your problem, it may be i faced before

  • @celloucisse7548
    @celloucisse7548 4 ปีที่แล้ว +2

    Ça n'a pas fonctionné chez moi. L'erreur c'est quand j'essaye de faire jouer la vidéo. Ça joue pas

    • @mukkarrammoin6513
      @mukkarrammoin6513 4 ปีที่แล้ว

      j'ai la même erreur. Pouvez-vous résoudre votre erreur. si oui, aidez-moi

  • @josephrogers9431
    @josephrogers9431 3 ปีที่แล้ว

    Hi, I seem to be getting an error here anybody know a work around for this?
    File "c:/Users/Jo Ming/Documents/Motion3.0/openpose/build/examples/MotionScripts/motionGUI.py", line 1
    from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QHBoxLayout,
    ^
    SyntaxError: trailing comma not allowed without surrounding parentheses

    • @henryvictor8071
      @henryvictor8071 3 ปีที่แล้ว

      Remove the last comma after QHBoxLayout

  • @giftedlyl
    @giftedlyl 3 ปีที่แล้ว

    9:55

  • @ruotianzhang3139
    @ruotianzhang3139 2 ปีที่แล้ว

    Thanks mate!

  • @karanghorai5517
    @karanghorai5517 4 ปีที่แล้ว +3

    It doesn't work

    • @ParwizForogh
      @ParwizForogh  4 ปีที่แล้ว

      what is the error

    • @karanghorai5517
      @karanghorai5517 4 ปีที่แล้ว +3

      Video not being played even after loading the video and clicking on the play button

    • @abdalla9
      @abdalla9 4 ปีที่แล้ว

      i face a problem like yours: you can download and install the K-Lite then the video will work without any error but i don't know if your problem like mine or not my error was: "DirectShowPlayerService::doRender: Unresolved error code 0x80040266 (IDispatch error #102)"

    • @adityakhandelwal7925
      @adityakhandelwal7925 3 ปีที่แล้ว

      I was facing the same problem. After searching, I found the solution. install K-lite Codec in your PC and the video player will work then.

  • @papugg7393
    @papugg7393 ปีที่แล้ว

    LIKE BRO I LOVE YOU THANKS

  • @angelcotoc4286
    @angelcotoc4286 2 ปีที่แล้ว

    Te quiero mucho gringito me salvaste :)

  • @LabhamJain
    @LabhamJain 3 ปีที่แล้ว

    thanks

  • @alihunain86
    @alihunain86 4 ปีที่แล้ว +1

    IDispatch error #102

  • @ruhatkahraman7529
    @ruhatkahraman7529 4 ปีที่แล้ว

    ı can not window please help me

  • @alihunain86
    @alihunain86 4 ปีที่แล้ว

    Please tell me solution of this error

  • @AbdurRahimm
    @AbdurRahimm 4 ปีที่แล้ว

    bro sound doesn't work .. what can i solve this

    • @kit00001
      @kit00001 3 ปีที่แล้ว

      pyqt5 media moudle doesnt work mp4 file ,because it use directshow render,how to solve it?yes you can use ffmpeg or other encoder,or lazy way embbed player window inside the windowwidget

  • @ruhatkahraman7529
    @ruhatkahraman7529 4 ปีที่แล้ว

    ı can open media player but ı can not player video help me

    • @douglasnicolas8206
      @douglasnicolas8206 4 ปีที่แล้ว

      Me too, u can solved?

    • @ВладимирТиунов-б8ю
      @ВладимирТиунов-б8ю 4 ปีที่แล้ว

      ​@@douglasnicolas8206 did u find solution?

    • @YarinSk8er
      @YarinSk8er 3 ปีที่แล้ว

      @@ВладимирТиунов-б8ю did u guys found solution?

    • @adityakhandelwal7925
      @adityakhandelwal7925 3 ปีที่แล้ว

      @@ВладимирТиунов-б8ю I was facing the same problem. After searching, I found the solution. install K-lite Codec in your PC and the video player will work then.

  • @joeljohn1217
    @joeljohn1217 4 ปีที่แล้ว

    how to play video with no media player but with audio?

    • @ParwizForogh
      @ParwizForogh  4 ปีที่แล้ว

      than that is not media player it should be audio player

    • @syedhamza6779
      @syedhamza6779 2 ปีที่แล้ว

      just dont add setvideooutput

  • @shafinatiq3507
    @shafinatiq3507 4 ปีที่แล้ว

    love the video gave a thumbs up but whoever finding the "DirectShowPlayerService::doRender: Unresolved error code 0x80040266 (IDispatch error #102)" should download k-light-codec-pack and install it in the project file where you are writing your python file
    link of the codec pack:
    www.codecguide.com/download_k-lite_codec_pack_basic.htm

  • @EverythingOS-du1rv
    @EverythingOS-du1rv 3 ปีที่แล้ว

    Source code?

  • @kanwaradnan4849
    @kanwaradnan4849 4 ปีที่แล้ว +1

    2nd viewer

  • @Mick3y_Mous3
    @Mick3y_Mous3 4 ปีที่แล้ว +1

    doesn't work...

    • @adityakhandelwal7925
      @adityakhandelwal7925 3 ปีที่แล้ว

      install K-lite Codec in your PC and the video player will work then.