I'm trying to start and stop an ffmpeg pipeline in my Python script. I can get it to start the pipeline on command, using a subprocess, but it ties up the script, so that it no longer receives commands. What do I need to change to keep this from happening?
I'm using:
pipeline= "ffmpeg -f video4linux2 -video_size 640x480 -framerate 15 -input_format yuyv422 -i /dev/video7 -f alsa -i hw:0,0 -map 0:0 -map 1:0 -b:v 120k -bufsize 120k -vcodec libx264 -preset ultrafast -acodec aac -strict -2 -f flv -metadata streamName=myStream tcp://192.168.1.20:6666 "
p = subprocess.Popen(pipeline, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = p.communicate()[0]