-
-
Save notnola/c92554e3c97e49c429d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def createStream(self, playpath): #todo - Rework this Funtions | |
d = "cam/" + self.room + "/" | |
if not os.path.exists(d): | |
os.makedirs(d) | |
pass | |
try: | |
self.output_file = open(d + playpath + ".flv", 'wb') | |
except: | |
print("Cannot open output file.\n Please check the output_file_path\n. Aborting.") | |
self.connection.set_option(key="live", value='True') | |
librtmp_binding.RTMP_SendCreateStream(self.connection.rtmp) | |
self.connection.set_option(key="playpath", value="7687") | |
#self.connection.call1("play", u"" + "7687", transaction_id=0) | |
self.stream = self.connection.create_stream() | |
while True: | |
result = self.stream.read(1024) | |
self.output_file.write(result) | |
if result == 0: | |
break | |
self.output_file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment