abhiTronix / vidgear

A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features :fire:
https://abhitronix.github.io/vidgear
Apache License 2.0
3.39k stars 255 forks source link

Writegear ffmpeg creationflag #375

Closed ibtsam3301 closed 1 year ago

ibtsam3301 commented 1 year ago

Added Feature: Detached Subprocess Creation for Windows

In this pull request, I've added a new feature to enable detached subprocess creation on Windows within the writegear module. This enhancement enhances the process management capabilities of the module.

Requirements / Checklist

Context

This can be useful while creating an exe file for a python script that uses writegear. On windows even after creating the exe file in windowed mode or no-console mode, the ffmpeg.exe command line window would pop up while its being used by write gear.

Types of changes

welcome[bot] commented 1 year ago

Thanks so much for opening your first PR here, a maintainer will get back to you shortly!

In the meantime:

abhiTronix commented 1 year ago

@ibtsam3301 Look good except, we don't need extra variable for the same, a optional flag might work better.

abhiTronix commented 1 year ago

@ibtsam3301 One question, Why not CREATE_NO_WINDOW ?

What I know:

The difference is in what the started process can do. In both cases it won't have a console. But with the CREATE_NO_WINDOW option it can call AttachConsole(ATTACH_PARENT_PROCESS) and get access to the parent's console window (if available). That explicitly will not work when you specify DETACH_PROCESS. The only option then is for the started process to use AllocConsole() to create its own console.

Or in other words, you can be sure that the started process will never be able to chatter into your own console by using DETACH_PROCESS.

abhiTronix commented 1 year ago

@ibtsam3301 I'm merging this PR, and will make necessary changes that are required. Also we don't need this flag for logging mode where we are debugging stuff. Thank you,

welcome[bot] commented 1 year ago

Congrats on merging your first pull request here! :tada: You're awesome! Alt Text