我正在使用PythonOpenCV录制进程的视频,并希望能够通过命令行输入打开/关闭相机。目前,我使用命令行输入打开相机,但必须按某个键停止视频馈送并保存视频,这并不理想
我尝试使用pyautogui模块使用第二个程序触发第一个视频录制脚本结束录制所需的按键,但它不起作用
如果有可能让程序A开始录制并继续录制,直到它被程序B触发,这将实现我想要做的。睡眠方法不起作用,因为进程长度变化很大
理想情况下,要启动的输入如下所示:
camera_recording_program.exe --save C:/path --camera 1
要停止的输入如下所示:
camera_stop_program.exe --end True
我尝试过各种组合,包括使用python输入和在命令行上运行子流程,但没有任何运气。我无法让这两个程序相互通信。此外,该程序是用python编写的,将使用PyInstaller转换为exe文件
谢谢大家!
试试这个:
或者你也可以试试this
这里还有一些选项:How to stop another already running script in python?https://www.raspberrypi.org/forums/viewtopic.php?t=245623
相关问题 更多 >
编程相关推荐