Procházet zdrojové kódy

机场推流服务

develop
chenyukun před 1 rokem
rodič
revize
8d7cf644b5
68 změnil soubory, kde provedl 47 přidání a 25 odebrání
  1. binární
      bean/__pycache__/Feedback.cpython-38.pyc
  2. binární
      bean/__pycache__/File.cpython-38.pyc
  3. binární
      bean/__pycache__/Result.cpython-38.pyc
  4. binární
      bean/__pycache__/__init__.cpython-38.pyc
  5. binární
      common/__pycache__/Constant.cpython-38.pyc
  6. binární
      common/__pycache__/__init__.cpython-38.pyc
  7. binární
      concurrency/__pycache__/__init__.cpython-38.pyc
  8. +16
    -8
      concurrency/http/HttpUploadFileProcess.py
  9. binární
      concurrency/http/__pycache__/HttpFeedbackThread.cpython-38.pyc
  10. binární
      concurrency/http/__pycache__/HttpServiceImpl.cpython-38.pyc
  11. binární
      concurrency/http/__pycache__/HttpUploadFileProcess.cpython-38.pyc
  12. binární
      concurrency/http/__pycache__/__init__.cpython-38.pyc
  13. +16
    -8
      concurrency/mqtt/MqttUploadFileProcess.py
  14. binární
      concurrency/mqtt/__pycache__/MqttFeedbackThread.cpython-38.pyc
  15. binární
      concurrency/mqtt/__pycache__/MqttUploadFileProcess.cpython-38.pyc
  16. binární
      concurrency/mqtt/__pycache__/__init__.cpython-38.pyc
  17. +7
    -5
      config/mqtt.yml
  18. binární
      enums/__pycache__/ExceptionEnum.cpython-38.pyc
  19. binární
      enums/__pycache__/HttpExceptionEnum.cpython-38.pyc
  20. binární
      enums/__pycache__/StatusEnum.cpython-38.pyc
  21. binární
      enums/__pycache__/__init__.cpython-38.pyc
  22. binární
      exception/__pycache__/CustomerException.cpython-38.pyc
  23. binární
      exception/__pycache__/__init__.cpython-38.pyc
  24. binární
      osssdk/__pycache__/__init__.cpython-38.pyc
  25. binární
      osssdk/__pycache__/api.cpython-38.pyc
  26. binární
      osssdk/__pycache__/auth.cpython-38.pyc
  27. binární
      osssdk/__pycache__/compat.cpython-38.pyc
  28. binární
      osssdk/__pycache__/crc64_combine.cpython-38.pyc
  29. binární
      osssdk/__pycache__/credentials.cpython-38.pyc
  30. binární
      osssdk/__pycache__/crypto.cpython-38.pyc
  31. binární
      osssdk/__pycache__/crypto_bucket.cpython-38.pyc
  32. binární
      osssdk/__pycache__/defaults.cpython-38.pyc
  33. binární
      osssdk/__pycache__/exceptions.cpython-38.pyc
  34. binární
      osssdk/__pycache__/headers.cpython-38.pyc
  35. binární
      osssdk/__pycache__/http.cpython-38.pyc
  36. binární
      osssdk/__pycache__/iterators.cpython-38.pyc
  37. binární
      osssdk/__pycache__/models.cpython-38.pyc
  38. binární
      osssdk/__pycache__/resumable.cpython-38.pyc
  39. binární
      osssdk/__pycache__/select_params.cpython-38.pyc
  40. binární
      osssdk/__pycache__/select_response.cpython-38.pyc
  41. binární
      osssdk/__pycache__/task_queue.cpython-38.pyc
  42. binární
      osssdk/__pycache__/utils.cpython-38.pyc
  43. binární
      osssdk/__pycache__/xml_utils.cpython-38.pyc
  44. binární
      router/__pycache__/__init__.cpython-38.pyc
  45. binární
      router/__pycache__/easy_rtmp_router.cpython-38.pyc
  46. binární
      router/__pycache__/media_file_router.cpython-38.pyc
  47. +1
    -0
      router/easy_rtmp_router.py
  48. +2
    -0
      service/MqttDisService.py
  49. binární
      service/__pycache__/HttpDisService.cpython-38.pyc
  50. binární
      service/__pycache__/MqttDisService.cpython-38.pyc
  51. binární
      service/__pycache__/__init__.cpython-38.pyc
  52. +5
    -4
      util/MqttUtil.py
  53. binární
      util/__pycache__/AliyunUtil.cpython-38.pyc
  54. binární
      util/__pycache__/FileUtil.cpython-38.pyc
  55. binární
      util/__pycache__/ImageUtil.cpython-38.pyc
  56. binární
      util/__pycache__/LogUtils.cpython-38.pyc
  57. binární
      util/__pycache__/MqttUtil.cpython-38.pyc
  58. binární
      util/__pycache__/QueUtil.cpython-38.pyc
  59. binární
      util/__pycache__/RWUtils.cpython-38.pyc
  60. binární
      util/__pycache__/RequestUtil.cpython-38.pyc
  61. binární
      util/__pycache__/ThreadUtil.cpython-38.pyc
  62. binární
      util/__pycache__/TimeUtils.cpython-38.pyc
  63. binární
      util/__pycache__/VideoUtil.cpython-38.pyc
  64. binární
      util/__pycache__/__init__.cpython-38.pyc
  65. binární
      vodsdk/__pycache__/AliyunVodUploader.cpython-38.pyc
  66. binární
      vodsdk/__pycache__/AliyunVodUtils.cpython-38.pyc
  67. binární
      vodsdk/__pycache__/UploadVideoRequest.cpython-38.pyc
  68. binární
      vodsdk/__pycache__/__init__.cpython-38.pyc

binární
bean/__pycache__/Feedback.cpython-38.pyc Zobrazit soubor


binární
bean/__pycache__/File.cpython-38.pyc Zobrazit soubor


binární
bean/__pycache__/Result.cpython-38.pyc Zobrazit soubor


binární
bean/__pycache__/__init__.cpython-38.pyc Zobrazit soubor


binární
common/__pycache__/Constant.cpython-38.pyc Zobrazit soubor


binární
common/__pycache__/__init__.cpython-38.pyc Zobrazit soubor


binární
concurrency/__pycache__/__init__.cpython-38.pyc Zobrazit soubor


+ 16
- 8
concurrency/http/HttpUploadFileProcess.py Zobrazit soubor

@@ -319,23 +319,31 @@ class HttpUploadFileProcess(Process):
sleep(1)
except ServiceException as s:
ex = s.code, s.msg
it.clear_work_queue()
vt.clear_work_queue()
if it:
it.clear_work_queue()
if vt:
vt.clear_work_queue()
# 停止所有任务
self.stop_all_task(imageList, imageTask, videoList, videoTask)
it.shutdown()
vt.shutdown()
if it:
it.shutdown()
if vt:
vt.shutdown()
self.stop_change_status(imageList, imageTask, videoList, videoTask, deleteImageList, deleteVideoList)
logger.error("上传文件任务异常失败: {}, requestId:{}", s.msg, requestId)
except Exception:
ex = UploadStrExceptionType.SERVICE_INNER_EXCEPTION.value[0], \
UploadStrExceptionType.SERVICE_INNER_EXCEPTION.value[1]
it.clear_work_queue()
vt.clear_work_queue()
if it:
it.clear_work_queue()
if vt:
vt.clear_work_queue()
# 停止所有任务
self.stop_all_task(imageList, imageTask, videoList, videoTask)
it.shutdown()
vt.shutdown()
if it:
it.shutdown()
if vt:
vt.shutdown()
self.stop_change_status(imageList, imageTask, videoList, videoTask, deleteImageList, deleteVideoList)
logger.error("上传文件任务异常失败: {}, requestId:{}", format_exc(), requestId)
finally:

binární
concurrency/http/__pycache__/HttpFeedbackThread.cpython-38.pyc Zobrazit soubor


binární
concurrency/http/__pycache__/HttpServiceImpl.cpython-38.pyc Zobrazit soubor


binární
concurrency/http/__pycache__/HttpUploadFileProcess.cpython-38.pyc Zobrazit soubor


binární
concurrency/http/__pycache__/__init__.cpython-38.pyc Zobrazit soubor


+ 16
- 8
concurrency/mqtt/MqttUploadFileProcess.py Zobrazit soubor

@@ -322,23 +322,31 @@ class MqttUploadFileProcess(Process):
sleep(1)
except ServiceException as s:
ex = s.code, s.msg
it.clear_work_queue()
vt.clear_work_queue()
if it:
it.clear_work_queue()
if vt:
vt.clear_work_queue()
# 停止所有任务
self.stop_all_task(imageList, imageTask, videoList, videoTask)
it.shutdown()
vt.shutdown()
if it:
it.shutdown()
if vt:
vt.shutdown()
self.stop_change_status(imageList, imageTask, videoList, videoTask, deleteImageList, deleteVideoList)
logger.error("上传文件任务异常失败: {}, requestId:{}", s.msg, requestId)
except Exception:
ex = UploadStrExceptionType.SERVICE_INNER_EXCEPTION.value[0], \
UploadStrExceptionType.SERVICE_INNER_EXCEPTION.value[1]
it.clear_work_queue()
vt.clear_work_queue()
if it:
it.clear_work_queue()
if vt:
vt.clear_work_queue()
# 停止所有任务
self.stop_all_task(imageList, imageTask, videoList, videoTask)
it.shutdown()
vt.shutdown()
if it:
it.shutdown()
if vt:
vt.shutdown()
self.stop_change_status(imageList, imageTask, videoList, videoTask, deleteImageList, deleteVideoList)
logger.error("上传文件任务异常失败: {}, requestId:{}", format_exc(), requestId)
finally:

binární
concurrency/mqtt/__pycache__/MqttFeedbackThread.cpython-38.pyc Zobrazit soubor


binární
concurrency/mqtt/__pycache__/MqttUploadFileProcess.cpython-38.pyc Zobrazit soubor


binární
concurrency/mqtt/__pycache__/__init__.cpython-38.pyc Zobrazit soubor


+ 7
- 5
config/mqtt.yml Zobrazit soubor

@@ -1,6 +1,8 @@
mqtt:
# mqtt客户端id对应每个机场平台的编码
client_id: "THOBS@0000THJSQ232003"
client_id: "THOBS@0000THJSQ232004"
# 机场平台编号
airport_code: "0000THJSQ232004"
# mqtt用户(根据对接环境修改)
username: "admin"
# mqtt密码(根据对接环境修改)
@@ -13,13 +15,13 @@ mqtt:
keepalive: 60
topic:
upload:
# 文件上传订阅topic(不修改)
# 文件上传订阅topic(不修改) %s代码会自动替换为airport_code
sub_topic: "/v1/%s/media/upload"
# 文件上传响应topic(不修改)
# 文件上传响应topic(不修改)%s代码会自动替换为airport_code
res_topic: "/v1/%s/media/result"
easy_rtmp_live:
# EasyRtmpLive启动停止订阅topic(不修改)
# EasyRtmpLive启动停止订阅topic(不修改) %s代码会自动替换为airport_code
sub_topic: "/v1/%s/rtmp/live"
# EasyRtmpLive响应topic(不修改)
# EasyRtmpLive响应topic(不修改) %s代码会自动替换为airport_code
res_topic: "/v1/%s/rtmp/result"


binární
enums/__pycache__/ExceptionEnum.cpython-38.pyc Zobrazit soubor


binární
enums/__pycache__/HttpExceptionEnum.cpython-38.pyc Zobrazit soubor


binární
enums/__pycache__/StatusEnum.cpython-38.pyc Zobrazit soubor


binární
enums/__pycache__/__init__.cpython-38.pyc Zobrazit soubor


binární
exception/__pycache__/CustomerException.cpython-38.pyc Zobrazit soubor


binární
exception/__pycache__/__init__.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/__init__.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/api.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/auth.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/compat.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/crc64_combine.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/credentials.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/crypto.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/crypto_bucket.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/defaults.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/exceptions.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/headers.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/http.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/iterators.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/models.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/resumable.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/select_params.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/select_response.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/task_queue.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/utils.cpython-38.pyc Zobrazit soubor


binární
osssdk/__pycache__/xml_utils.cpython-38.pyc Zobrazit soubor


binární
router/__pycache__/__init__.cpython-38.pyc Zobrazit soubor


binární
router/__pycache__/easy_rtmp_router.cpython-38.pyc Zobrazit soubor


binární
router/__pycache__/media_file_router.cpython-38.pyc Zobrazit soubor


+ 1
- 0
router/easy_rtmp_router.py Zobrazit soubor

@@ -100,6 +100,7 @@ async def stopPushStream():
channel = channelList[0]
if channel["enable"] == "false":
logger.info("EasyRtmpLive任务已停止")
return JsonResult.success()
channel["enable"] = "false"
channel["srcURL"] = '"%s"' % channel["srcURL"]
req_param = 'indexCode=%s&name=%s&srcURL=%s&connectType=%s&timeout=5&mediaType=%s&dstURL=%s&dstFormat=%s&enable=%s' % \

+ 2
- 0
service/MqttDisService.py Zobrazit soubor

@@ -142,6 +142,8 @@ def handle_rtmp(msg, task, fb_queue, service_config):
if 'stop' == command:
if channel["enable"] == "false":
logger.info("EasyRtmpLive任务已停止!")
rtmp_result(fb_queue, 0, "操作成功!")
return
channel["enable"] = "false"
channel["srcURL"] = '"%s"' % channel["srcURL"]
req_param = 'indexCode=%s&name=%s&srcURL=%s&connectType=%s&timeout=5&mediaType=%s&dstURL=%s&dstFormat=%s&enable=%s' % \

binární
service/__pycache__/HttpDisService.cpython-38.pyc Zobrazit soubor


binární
service/__pycache__/MqttDisService.cpython-38.pyc Zobrazit soubor


binární
service/__pycache__/__init__.cpython-38.pyc Zobrazit soubor


+ 5
- 4
util/MqttUtil.py Zobrazit soubor

@@ -20,8 +20,8 @@ class MqttClient:
self.client = None
self.config = getConfigs(base_dir, "config/mqtt.yml")
self.res_topic = {
"upload": self.config["topic"]["upload"]["res_topic"] % self.config["mqtt"]["client_id"],
"rtmp": self.config["topic"]["easy_rtmp_live"]["res_topic"] % self.config["mqtt"]["client_id"]
"upload": self.config["topic"]["upload"]["res_topic"] % self.config["mqtt"]["airport_code"],
"rtmp": self.config["topic"]["easy_rtmp_live"]["res_topic"] % self.config["mqtt"]["airport_code"]
}
self.msg_queue = msg_queue
self.fb_queue = fb_queue
@@ -30,6 +30,7 @@ class MqttClient:
if self.client is None:
try:
client_id = self.config["mqtt"]["client_id"]
airport_code = self.config["mqtt"]["airport_code"]
self.client = mqtt.Client(client_id=client_id, clean_session=True)
# self.client.enable_logger(logger=logging)
self.client.disable_logger()
@@ -38,8 +39,8 @@ class MqttClient:
self.client.on_message = self.on_message
# self.client.on_disconnect = self.on_disconnect
# self.client.on_log = self.on_log
upload_topic = self.config["topic"]["upload"]["sub_topic"] % client_id
rtmp_topic = self.config["topic"]["easy_rtmp_live"]["sub_topic"] % client_id
upload_topic = self.config["topic"]["upload"]["sub_topic"] % airport_code
rtmp_topic = self.config["topic"]["easy_rtmp_live"]["sub_topic"] % airport_code
self.client.user_data_set({
"sub_upload_topic": upload_topic,
"sub_rtmp_topic": rtmp_topic,

binární
util/__pycache__/AliyunUtil.cpython-38.pyc Zobrazit soubor


binární
util/__pycache__/FileUtil.cpython-38.pyc Zobrazit soubor


binární
util/__pycache__/ImageUtil.cpython-38.pyc Zobrazit soubor


binární
util/__pycache__/LogUtils.cpython-38.pyc Zobrazit soubor


binární
util/__pycache__/MqttUtil.cpython-38.pyc Zobrazit soubor


binární
util/__pycache__/QueUtil.cpython-38.pyc Zobrazit soubor


binární
util/__pycache__/RWUtils.cpython-38.pyc Zobrazit soubor


binární
util/__pycache__/RequestUtil.cpython-38.pyc Zobrazit soubor


binární
util/__pycache__/ThreadUtil.cpython-38.pyc Zobrazit soubor


binární
util/__pycache__/TimeUtils.cpython-38.pyc Zobrazit soubor


binární
util/__pycache__/VideoUtil.cpython-38.pyc Zobrazit soubor


binární
util/__pycache__/__init__.cpython-38.pyc Zobrazit soubor


binární
vodsdk/__pycache__/AliyunVodUploader.cpython-38.pyc Zobrazit soubor


binární
vodsdk/__pycache__/AliyunVodUtils.cpython-38.pyc Zobrazit soubor


binární
vodsdk/__pycache__/UploadVideoRequest.cpython-38.pyc Zobrazit soubor


binární
vodsdk/__pycache__/__init__.cpython-38.pyc Zobrazit soubor


Načítá se…
Zrušit
Uložit