Aug-14-2017, 02:18 PM
Launching a script which get directly streaming the gopro on Pc when used on android it returns error (Qpython platform) when arrives to the ffplay command which should open the streaming...
Why? are there libraries/PIP to install?
## Opens the stream over udp in ffplay. This is a known working configuration by Reddit user:
##
loglevel_verbose=""
if VERBOSE==False:
loglevel_verbose = "-loglevel panic"
if SAVE == False:
subprocess.Popen("ffplay " + loglevel_verbose + " -fflags nobuffer -f:v mpegts -probesize 8192 udp://10.5.5.9:8554", shell=True)
else:
if SAVE_FORMAT=="ts":
TS_PARAMS = " -acodec copy -vcodec copy "
else:
TS_PARAMS = ""
SAVELOCATION = SAVE_LOCATION + SAVE_FILENAME + "." + SAVE_FORMAT
print("Recording locally: " + str(SAVE))
print("Recording stored in: " + SAVELOCATION)
print("Note: Preview is not available when saving the stream.")
subprocess.Popen("ffmpeg -i 'udp://:8554' -fflags nobuffer -f:v mpegts -probesize 8192 " + TS_PARAMS + SAVELOCATION, shell=True)
if sys.version_info.major >= 3:
MESSAGE = bytes(MESSAGE, "utf-8")
print("Press ctrl+C to quit this application.\n")
while True:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))
sleep(KEEP_ALIVE_PERIOD/1000)
Why? are there libraries/PIP to install?
## Opens the stream over udp in ffplay. This is a known working configuration by Reddit user:
##
loglevel_verbose=""
if VERBOSE==False:
loglevel_verbose = "-loglevel panic"
if SAVE == False:
subprocess.Popen("ffplay " + loglevel_verbose + " -fflags nobuffer -f:v mpegts -probesize 8192 udp://10.5.5.9:8554", shell=True)
else:
if SAVE_FORMAT=="ts":
TS_PARAMS = " -acodec copy -vcodec copy "
else:
TS_PARAMS = ""
SAVELOCATION = SAVE_LOCATION + SAVE_FILENAME + "." + SAVE_FORMAT
print("Recording locally: " + str(SAVE))
print("Recording stored in: " + SAVELOCATION)
print("Note: Preview is not available when saving the stream.")
subprocess.Popen("ffmpeg -i 'udp://:8554' -fflags nobuffer -f:v mpegts -probesize 8192 " + TS_PARAMS + SAVELOCATION, shell=True)
if sys.version_info.major >= 3:
MESSAGE = bytes(MESSAGE, "utf-8")
print("Press ctrl+C to quit this application.\n")
while True:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))
sleep(KEEP_ALIVE_PERIOD/1000)