Open ghost opened 4 years ago
gopro 8 black stream or streamSettings funciton without effect。
def stream(self, addr, quality=""): """Starts a FFmpeg instance for streaming to an address addr: Address to stream to quality: high/medium/low """ self.livestream("start") if self.whichCam() == constants.Camera.Interface.GPControl: if "HERO4" in self.infoCamera("model_name"): if quality == "high": self.streamSettings("2400000", "6") elif quality == "medium": self.streamSettings("1000000", "4") elif quality == "low": self.streamSettings("250000", "0") else: if quality == "high": self.streamSettings("4000000", "7") elif quality == "medium": self.streamSettings("1000000", "4") elif quality == "low": self.streamSettings("250000", "0") subprocess.Popen("ffmpeg -f mpegts -i udp://" + ":8554 -b 800k -r 30 -f mpegts " + addr, shell=True) self.KeepAlive() elif self.whichCam() == constants.Camera.Interface.Auth: subprocess.Popen("ffmpeg -i http://" + "live/amba.m3u8 -f mpegts " + addr, shell=True)
def streamSettings(self, bitrate, resolution): """Sets stream settings""" self.gpControlSet("62", bitrate) self.gpControlSet("64", resolution)
gopro 8 black stream or streamSettings funciton without effect。
def stream(self, addr, quality=""): """Starts a FFmpeg instance for streaming to an address addr: Address to stream to quality: high/medium/low """ self.livestream("start") if self.whichCam() == constants.Camera.Interface.GPControl: if "HERO4" in self.infoCamera("model_name"): if quality == "high": self.streamSettings("2400000", "6") elif quality == "medium": self.streamSettings("1000000", "4") elif quality == "low": self.streamSettings("250000", "0") else: if quality == "high": self.streamSettings("4000000", "7") elif quality == "medium": self.streamSettings("1000000", "4") elif quality == "low": self.streamSettings("250000", "0") subprocess.Popen("ffmpeg -f mpegts -i udp://" + ":8554 -b 800k -r 30 -f mpegts " + addr, shell=True) self.KeepAlive() elif self.whichCam() == constants.Camera.Interface.Auth: subprocess.Popen("ffmpeg -i http://" + "live/amba.m3u8 -f mpegts " + addr, shell=True)
def streamSettings(self, bitrate, resolution): """Sets stream settings""" self.gpControlSet("62", bitrate) self.gpControlSet("64", resolution)