Python Forum
ffplay missing for srtreaming over gopro sessione
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ffplay missing for srtreaming over gopro sessione
#1
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)
Reply
#2
(Aug-14-2017, 02:18 PM)mainieri13 Wrote: when used on android it returns error

What's the error?

Just from looking at the code, there should be a ton of undefined variables (you immediately check VERBOSE, but never actually set it, for example).  You also check sys.version_info, without importing sys, same with never importing subprocess or socket.  Not to mention that it'd obviously fail if ffplay isn't installed on the machine.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020