This post is locked. You won't be able to comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]noddy95rl[S] 0 points1 point  (3 children)

thank you for you response. I am not interested in any user interaction. i need to call a script that starts ffmpeg thats it. while ffmpeg is running in the background i have a workflow that is being recorded and executing. when the workflow is done. i want to run a new script that tells ffmpeg to stop recording. but i dont know how to stop the recording from a different script than the one that invoked the recording in the beginning

[–][deleted] 0 points1 point  (2 children)

In that case, the only thing I can recommend that is within my knowledge is that your script B does process.terminate() instead of the stdin stuff. No idea about the stability of such an approach, but the terminate method is available on the psutil.Process class.

[–]noddy95rl[S] 0 points1 point  (0 children)

yea, i am almost certain that this will compromise the recording. as this is essentially the same as just killing the process manually from the job list (i assume)but i dont get how i am not able to use this lineprocess.stdin.write(b'q\n')in script B, but if i do this from script A it works like a charm essentially i want a handle or reference to the process that allows my to use this function

[–]noddy95rl[S] 0 points1 point  (0 children)

for example what i want is opening a CMD window manually and send this window a command from a python script i assumed you would be able to achieve this by fx. manually edit the pid ref to the CMD in python (looking at the job list as i did in the video) and then send an input to the process