Quellcode durchsuchen

机场推流服务

develop
chenyukun vor 1 Jahr
Ursprung
Commit
8d7cf644b5
68 geänderte Dateien mit 47 neuen und 25 gelöschten Zeilen
  1. BIN
      bean/__pycache__/Feedback.cpython-38.pyc
  2. BIN
      bean/__pycache__/File.cpython-38.pyc
  3. BIN
      bean/__pycache__/Result.cpython-38.pyc
  4. BIN
      bean/__pycache__/__init__.cpython-38.pyc
  5. BIN
      common/__pycache__/Constant.cpython-38.pyc
  6. BIN
      common/__pycache__/__init__.cpython-38.pyc
  7. BIN
      concurrency/__pycache__/__init__.cpython-38.pyc
  8. +16
    -8
      concurrency/http/HttpUploadFileProcess.py
  9. BIN
      concurrency/http/__pycache__/HttpFeedbackThread.cpython-38.pyc
  10. BIN
      concurrency/http/__pycache__/HttpServiceImpl.cpython-38.pyc
  11. BIN
      concurrency/http/__pycache__/HttpUploadFileProcess.cpython-38.pyc
  12. BIN
      concurrency/http/__pycache__/__init__.cpython-38.pyc
  13. +16
    -8
      concurrency/mqtt/MqttUploadFileProcess.py
  14. BIN
      concurrency/mqtt/__pycache__/MqttFeedbackThread.cpython-38.pyc
  15. BIN
      concurrency/mqtt/__pycache__/MqttUploadFileProcess.cpython-38.pyc
  16. BIN
      concurrency/mqtt/__pycache__/__init__.cpython-38.pyc
  17. +7
    -5
      config/mqtt.yml
  18. BIN
      enums/__pycache__/ExceptionEnum.cpython-38.pyc
  19. BIN
      enums/__pycache__/HttpExceptionEnum.cpython-38.pyc
  20. BIN
      enums/__pycache__/StatusEnum.cpython-38.pyc
  21. BIN
      enums/__pycache__/__init__.cpython-38.pyc
  22. BIN
      exception/__pycache__/CustomerException.cpython-38.pyc
  23. BIN
      exception/__pycache__/__init__.cpython-38.pyc
  24. BIN
      osssdk/__pycache__/__init__.cpython-38.pyc
  25. BIN
      osssdk/__pycache__/api.cpython-38.pyc
  26. BIN
      osssdk/__pycache__/auth.cpython-38.pyc
  27. BIN
      osssdk/__pycache__/compat.cpython-38.pyc
  28. BIN
      osssdk/__pycache__/crc64_combine.cpython-38.pyc
  29. BIN
      osssdk/__pycache__/credentials.cpython-38.pyc
  30. BIN
      osssdk/__pycache__/crypto.cpython-38.pyc
  31. BIN
      osssdk/__pycache__/crypto_bucket.cpython-38.pyc
  32. BIN
      osssdk/__pycache__/defaults.cpython-38.pyc
  33. BIN
      osssdk/__pycache__/exceptions.cpython-38.pyc
  34. BIN
      osssdk/__pycache__/headers.cpython-38.pyc
  35. BIN
      osssdk/__pycache__/http.cpython-38.pyc
  36. BIN
      osssdk/__pycache__/iterators.cpython-38.pyc
  37. BIN
      osssdk/__pycache__/models.cpython-38.pyc
  38. BIN
      osssdk/__pycache__/resumable.cpython-38.pyc
  39. BIN
      osssdk/__pycache__/select_params.cpython-38.pyc
  40. BIN
      osssdk/__pycache__/select_response.cpython-38.pyc
  41. BIN
      osssdk/__pycache__/task_queue.cpython-38.pyc
  42. BIN
      osssdk/__pycache__/utils.cpython-38.pyc
  43. BIN
      osssdk/__pycache__/xml_utils.cpython-38.pyc
  44. BIN
      router/__pycache__/__init__.cpython-38.pyc
  45. BIN
      router/__pycache__/easy_rtmp_router.cpython-38.pyc
  46. BIN
      router/__pycache__/media_file_router.cpython-38.pyc
  47. +1
    -0
      router/easy_rtmp_router.py
  48. +2
    -0
      service/MqttDisService.py
  49. BIN
      service/__pycache__/HttpDisService.cpython-38.pyc
  50. BIN
      service/__pycache__/MqttDisService.cpython-38.pyc
  51. BIN
      service/__pycache__/__init__.cpython-38.pyc
  52. +5
    -4
      util/MqttUtil.py
  53. BIN
      util/__pycache__/AliyunUtil.cpython-38.pyc
  54. BIN
      util/__pycache__/FileUtil.cpython-38.pyc
  55. BIN
      util/__pycache__/ImageUtil.cpython-38.pyc
  56. BIN
      util/__pycache__/LogUtils.cpython-38.pyc
  57. BIN
      util/__pycache__/MqttUtil.cpython-38.pyc
  58. BIN
      util/__pycache__/QueUtil.cpython-38.pyc
  59. BIN
      util/__pycache__/RWUtils.cpython-38.pyc
  60. BIN
      util/__pycache__/RequestUtil.cpython-38.pyc
  61. BIN
      util/__pycache__/ThreadUtil.cpython-38.pyc
  62. BIN
      util/__pycache__/TimeUtils.cpython-38.pyc
  63. BIN
      util/__pycache__/VideoUtil.cpython-38.pyc
  64. BIN
      util/__pycache__/__init__.cpython-38.pyc
  65. BIN
      vodsdk/__pycache__/AliyunVodUploader.cpython-38.pyc
  66. BIN
      vodsdk/__pycache__/AliyunVodUtils.cpython-38.pyc
  67. BIN
      vodsdk/__pycache__/UploadVideoRequest.cpython-38.pyc
  68. BIN
      vodsdk/__pycache__/__init__.cpython-38.pyc

BIN
bean/__pycache__/Feedback.cpython-38.pyc Datei anzeigen


BIN
bean/__pycache__/File.cpython-38.pyc Datei anzeigen


BIN
bean/__pycache__/Result.cpython-38.pyc Datei anzeigen


BIN
bean/__pycache__/__init__.cpython-38.pyc Datei anzeigen


BIN
common/__pycache__/Constant.cpython-38.pyc Datei anzeigen


BIN
common/__pycache__/__init__.cpython-38.pyc Datei anzeigen


BIN
concurrency/__pycache__/__init__.cpython-38.pyc Datei anzeigen


+ 16
- 8
concurrency/http/HttpUploadFileProcess.py Datei anzeigen

@@ -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
concurrency/http/__pycache__/HttpFeedbackThread.cpython-38.pyc Datei anzeigen


BIN
concurrency/http/__pycache__/HttpServiceImpl.cpython-38.pyc Datei anzeigen


BIN
concurrency/http/__pycache__/HttpUploadFileProcess.cpython-38.pyc Datei anzeigen


BIN
concurrency/http/__pycache__/__init__.cpython-38.pyc Datei anzeigen


+ 16
- 8
concurrency/mqtt/MqttUploadFileProcess.py Datei anzeigen

@@ -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
concurrency/mqtt/__pycache__/MqttFeedbackThread.cpython-38.pyc Datei anzeigen


BIN
concurrency/mqtt/__pycache__/MqttUploadFileProcess.cpython-38.pyc Datei anzeigen


BIN
concurrency/mqtt/__pycache__/__init__.cpython-38.pyc Datei anzeigen


+ 7
- 5
config/mqtt.yml Datei anzeigen

@@ -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
enums/__pycache__/ExceptionEnum.cpython-38.pyc Datei anzeigen


BIN
enums/__pycache__/HttpExceptionEnum.cpython-38.pyc Datei anzeigen


BIN
enums/__pycache__/StatusEnum.cpython-38.pyc Datei anzeigen


BIN
enums/__pycache__/__init__.cpython-38.pyc Datei anzeigen


BIN
exception/__pycache__/CustomerException.cpython-38.pyc Datei anzeigen


BIN
exception/__pycache__/__init__.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/__init__.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/api.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/auth.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/compat.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/crc64_combine.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/credentials.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/crypto.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/crypto_bucket.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/defaults.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/exceptions.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/headers.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/http.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/iterators.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/models.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/resumable.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/select_params.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/select_response.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/task_queue.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/utils.cpython-38.pyc Datei anzeigen


BIN
osssdk/__pycache__/xml_utils.cpython-38.pyc Datei anzeigen


BIN
router/__pycache__/__init__.cpython-38.pyc Datei anzeigen


BIN
router/__pycache__/easy_rtmp_router.cpython-38.pyc Datei anzeigen


BIN
router/__pycache__/media_file_router.cpython-38.pyc Datei anzeigen


+ 1
- 0
router/easy_rtmp_router.py Datei anzeigen

@@ -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 Datei anzeigen

@@ -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
service/__pycache__/HttpDisService.cpython-38.pyc Datei anzeigen


BIN
service/__pycache__/MqttDisService.cpython-38.pyc Datei anzeigen


BIN
service/__pycache__/__init__.cpython-38.pyc Datei anzeigen


+ 5
- 4
util/MqttUtil.py Datei anzeigen

@@ -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
util/__pycache__/AliyunUtil.cpython-38.pyc Datei anzeigen


BIN
util/__pycache__/FileUtil.cpython-38.pyc Datei anzeigen


BIN
util/__pycache__/ImageUtil.cpython-38.pyc Datei anzeigen


BIN
util/__pycache__/LogUtils.cpython-38.pyc Datei anzeigen


BIN
util/__pycache__/MqttUtil.cpython-38.pyc Datei anzeigen


BIN
util/__pycache__/QueUtil.cpython-38.pyc Datei anzeigen


BIN
util/__pycache__/RWUtils.cpython-38.pyc Datei anzeigen


BIN
util/__pycache__/RequestUtil.cpython-38.pyc Datei anzeigen


BIN
util/__pycache__/ThreadUtil.cpython-38.pyc Datei anzeigen


BIN
util/__pycache__/TimeUtils.cpython-38.pyc Datei anzeigen


BIN
util/__pycache__/VideoUtil.cpython-38.pyc Datei anzeigen


BIN
util/__pycache__/__init__.cpython-38.pyc Datei anzeigen


BIN
vodsdk/__pycache__/AliyunVodUploader.cpython-38.pyc Datei anzeigen


BIN
vodsdk/__pycache__/AliyunVodUtils.cpython-38.pyc Datei anzeigen


BIN
vodsdk/__pycache__/UploadVideoRequest.cpython-38.pyc Datei anzeigen


BIN
vodsdk/__pycache__/__init__.cpython-38.pyc Datei anzeigen


Laden…
Abbrechen
Speichern