I'm using Python 3.5. I'm launching ffmpeg to record a file but I can't seem to kill the process. I've tried this:
import os
import subprocess
pro = subprocess.Popen(recordcommand, shell=True)
...
do some things; wait for a stop command to come in
...
if msg =='STOP':
pro.kill()
My process starts fine but it never stops. I do not get any errors. I've checked the API and thought I was doing things right. Can anyone tell me where I'm going wrong? Thanks!
Edit: Fixed pro.kill to pro.kill() but still not working. Here's the command I'm sending:
C:/Users/User/Desktop/ffmpeg-20150928-git-235381e-win64-static/bin/ffmpeg.exe -f dshow -crossbar_video_input_pin_number 2 -i video="ATI AVStream Analog Capture" -f mpegts -fs 16777216 -y D:\Media\tvrecordings\SageSlingBox1onlocalhost4510TVTuner-0.mpgbuf 2>NUL
Perhaps something is keeping it from being killed? I forgot to mention that my OS is Win 7 64 bit.