I am trying to make a little script in python to stream from a gopro to PC
from selenium import webdriver
from subprocess import call
import subprocess, sys
import time
import urllib
import urllib2
pid = subprocess.Popen([sys.executable, "Sel.py"])
call(["ffplay", "-fflags", "nobuffer", "udp://:8554"])
driver = webdriver.Firefox(executable_path='/usr/bin/geckodriver')
while True:
time.sleep(10)
driver.get("http://10.5.5.9/gp/gpControl/execute?p1=gpStream&a1=proto_v2&c1=restart")
I am not really familiar with python and my objective is to open ffplay with those options and then execute the remaining part of the program (reloading a page every 10 seconds). Now when i run the script it continuously make that system call. Is there a way to detach the execution of ffplay from the execution of the python code?
Don't repeatedly call the stream http command, use a keep alive magic command instead: http://github.com/konradit/goprostream