Commit b4f6ad84 authored by liyuanhong's avatar liyuanhong

优化了拉流的方式

parent b82c5516
......@@ -69,6 +69,9 @@ class FlvPressureTest():
return
self.threadInfo["threadObj"].pop(threadName)
'''
# 使用openvc去拉流
def testServicePull(self, mobile,threadName):
pullUrl = self.getPlayUrl(mobile,self.channel)
# pullUrl = self.replaceHost(pullUrl, "video-test.vandyo.com:")
......@@ -90,6 +93,19 @@ class FlvPressureTest():
self.threadInfoPull["threadObj"].pop(threadName)
return
self.threadInfoPull["threadObj"].pop(threadName)
'''
# 使用requests去拉流
def testServicePull(self,mobile,threadName):
pullUrl = self.getPlayUrl(mobile, self.channel)
# pullUrl = self.replaceHost(pullUrl, "video-test.vandyo.com:")
try:
requests.get(pullUrl)
except:
traceback.print_exc()
self.threadInfoPull["threadObj"].pop(threadName)
return
self.threadInfoPull["threadObj"].pop(threadName)
################################################
# 启动推流线程
......@@ -162,7 +178,7 @@ if __name__ == "__main__":
test.setPort(1078)
test.setMobileStart(10000000000)
test.setChannel(1)
test.setTerNum(1)
test.setTerNum(10)
test.setIsOpenPullStream(1) # 设置是否开启拉流
test.setIsShowFrame(0) # 拉流是否显示预览画面
test.setSendDur(0.007)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment