0

When using a compiled a program that utilizes FFMPEG (Not library, but the path to the exe), and a GUI library; that has a function that uses FFMPEG, a console window from FFMPEG will quickly open and disappear.

I have a github repo that can be used to reproduce the bug: https://github.com/nednoodlehead/ffmpegthreading

I also have a quick youtube video showing what the bug looks like, and what it should look like: https://www.youtube.com/watch?v=tCZ0z9E5Iyw

A few things to note with this:

1). This will only occur when the app is compiled. Running this in a virtual environment works as expected. I run it from my IDE all the time with no console flashing. (as seen in video)

2). It will only flash while a GUI is present. So using a regular script to call the same command that produces the bug will NOT cause the bug

3). The bug was tested in Tkinter and PyQt5 and produced the same result (flashing console)

4). Threading is NOT needed to reproduce this bug, it just makes the debugging a bit easier

5). Using the ffmpeg module does not work as my entire project is based around an interface for PyDub (Which uses ffmpeg)

6). This solution does not work for me: How to hide console output of FFmpeg in Python? (Because this uses the module, while I use the exe)

7). I am using auto-py-to-exe to compile (which uses pyinstaller)

8). Running 'ffmpeg -version' (in regular cmd (same result in venv)) gives: ffmpeg version N-106605-gf67403edb3-20220413

I would appreciate any help, this is tying my brain up.

  • Are you using `pydub` for anything more than reading the data? If my [`ffmpegio` package](https://github.com/python-ffmpegio/python-ffmpegio) serves your need, you can give it a try, and I'd be willing to make changes to address your UI issue as it is one of my future use case. – kesh Aug 29 '22 at 05:08
  • Sounds like you are actually asking about Windows, but it's not clear from your question. – tripleee Aug 29 '22 at 05:15
  • Does this help? https://stackoverflow.com/questions/34828142/cmd-console-game-reduction-of-blinking Or this? https://pythonawesome.com/a-python-module-to-update-the-console-without-flashing/ – tripleee Aug 29 '22 at 05:22
  • To answer your questions: 1). Pydub is used to read data, turn it into an 'audiosegment', then call pydub.playback._play_with_simpleaudio on it (Which relies on ffmpeg). I could try your package, see how it works but I have written 400 lines to handle how the audiosegment is handled, so minor inconvenience. 2). I think this may be windows specific, but I dont have a linux box to test on. 3). Those do not work unfortunately. – NedNoodleHead Aug 29 '22 at 16:25

0 Answers0