Open james-craven opened 1 year ago
I've also noticed that if you just import exactly what you need from moviepy, the issue goes away. For example, instead of
import moviepy.editor as mp
you would instead use
from moviepy.audio.io.AudioFileClip import AudioFileClip
I have the same issue, also Mac, but my situation is worse, because I want to use the preview video, there is no way to get around this bug, if I want to preview, than I would have to import moviepy.editor, the bug will show up
I found a work around for those who have to import moviepy.editor(e.g. you want to use preview), just quit the pygame after the App init_ui(),
if you are using Qt, manually quit pygame will solve the problem
class SomeApp(QWidget):
def __init__(self):
super().__init__()
self.init_ui()
#just add this line
pygame.quit()
if you want to use something like preview later, this hack wouldn't get in the way, probably it's just gonna start another pygame instance
Expected Behavior: One Keypress Event on QPlainTextEdit
Actual Behavior: Two Keypress Events (it seems, I haven't actually confirmed this is what is happening behind the scenes. I just know that any letter key press gets put in twice. That and the backspace key doesn't work).
Steps to Reproduce the Problem
Install pyqt5, moviepy, and pygame and run the code above.
Specifications
Pretty sure it has to do with moviepy starting an instance of pygame if it sees that it's installed. This could just be a simple matter of the end user not having pygame installed in the environment if they're not using it for the current project.. But I figured i'd report this happening in case anyone else runs into the same issue.
I think what is happening is the running instance of pygame registers a keypressed event at the same time pyqt5 does and so both events get inputted into the QPlainTextEdit. Then again, backspace key doesn't seem to work at all. I'm not really sure what the heck the conflict is to be honest. Hope this helps. I just uninstalled pygame to resolve the issue with my project but maybe you'd want to let end users decide if they want to start an instance of pygame instead of automatically starting it with moviepy. Hope this helps.