Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Extra flags for GUI applications embedding youtube-dl on Windows #18311

Open
Faith001 opened this issue Nov 26, 2018 · 0 comments
Open

Comments

@Faith001
Copy link

@Faith001 Faith001 commented Nov 26, 2018

  • I've verified and I assure that I'm running youtube-dl 2018.11.23

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

Description of your issue, suggested solution and other information

Every time we get to conversion with ffmpeg, a console window opens up for the remainder of ffmpeg's operation due to the way Windows handles new processes being spawned.

Would it be possible for an extra extra option to be passed when embedding youtube-dl, denoting that the application is graphical so that the calls to the postprocessor can go from

https://github.com/rg3/youtube-dl/blob/d19600df07128c73ef7242af7e1cd8c819951aba/youtube_dl/postprocessor/ffmpeg.py#L164

https://github.com/rg3/youtube-dl/blob/d19600df07128c73ef7242af7e1cd8c819951aba/youtube_dl/postprocessor/ffmpeg.py#L199

to

handle = subprocess.Popen(cmd, stderr=compat_subprocess_get_DEVNULL(), stdout=subprocess.PIPE, stdin=subprocess.PIPE, creationflags=0x08000000)

and

p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, creationflags=0x08000000)

respectively.

Where 0x08000000 is CREATE_NO_WINDOW as per https://docs.microsoft.com/en-us/windows/desktop/procthread/process-creation-flags

This would also require a platform check since this would only work on Windows.
I've tried this and it works , would've made a pull request but I'm not too familiar with the codebase, just managed to track down where and how ffmpeg was being called to patch it for myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.