tidal-dl-ng icon indicating copy to clipboard operation
tidal-dl-ng copied to clipboard

[Help] Hidden command window when ffmpeg is doing it's thing?

Open mversion opened this issue 1 year ago • 7 comments

I need Help.

Each time a track is extracted, a command prompt window briefly pops up and disappears. In the meantime stealing focus away from whatever application I got running. Any way to have ffmpeg do its thing in the background?

What operating system are you seeing the problem on?

None

Your settings

Win
v0.15.6

mversion avatar Aug 01 '24 01:08 mversion

The issue seems to be with the library being used ffmpeg-python in Windows when its a compiled exe like pyinstaller and no console. Someone should probably put in an issue over there to add a check for Windows and add a way to to pass in and argument to hide the window sorta how I patched it below.

Locally I was able to fix this by patching the site-packages\ffmpeg\_run.py file. and then when i compile it with pyinstaller noconsole it no longer pops up any console window when its dealing with the HIRES mp4 to flac extractions.

At the top find import subprocess Add this as a new line under that from subprocess import CREATE_NO_WINDOW

Now find in the file args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream and add this to the end , creationflags=CREATE_NO_WINDOW

Should now look like: args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream, creationflags=CREATE_NO_WINDOW

JustinRoper avatar Sep 12 '24 06:09 JustinRoper

@JustinRoper seems I'm a bit lost, but where in the overall setup (Windows 11 with tidal_dl_ng + pre-compiled ffmpeg.exe) should this patch be applied?

loddar66 avatar Nov 19 '24 18:11 loddar66

isn't this already fixed in latest versions of the program?

orbittwz avatar Feb 18 '25 17:02 orbittwz

well, I'm already using the most recent version, but the 'problem' still exists... seems I need to look for a fixed ffmpeg version - or try and install Python and compile it myself

Image

loddar66 avatar Feb 25 '25 16:02 loddar66

wdym fixed? just get latest ffmpeg binary and point the setting to that executable with FULL path...

orbittwz avatar Feb 25 '25 18:02 orbittwz

I already used the latest nightly builds from both repositories (replacing my previous 'stable' version from last September). None of them works w/o briefly opening the console window. Nevertheless, in the end I get the files I want- it's just a little annoying.

https://github.com/BtbN/FFmpeg-Builds/releases https://github.com/GyanD/codexffmpeg/releases

Image

loddar66 avatar Feb 25 '25 18:02 loddar66

I see, well... there is a PR waiting... hope it will be implemented

orbittwz avatar Feb 25 '25 21:02 orbittwz