chanjunkai 5 년 전
부모
커밋
4de9a495d7
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      controller/index.py

+ 4 - 1
controller/index.py

@@ -254,7 +254,8 @@ class oa2RtspStartView(TemplateView):
                 'audioCodecs': ['G711'],
                 'protocols': ['RTSP'],
                 'authorizationTypes': ['NONE'],
-                'uri': rtsp_uri
+                'uri': rtsp_uri,
+                'msg':send_flag
             }
             # if send_flag:
             #     redisObj.set_data(key=key, val=str(res_json), expire=15)
@@ -269,8 +270,10 @@ class oa2RtspStartView(TemplateView):
             back = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).\
                 communicate(timeout=10)
         except Exception as e:
+            return repr(e)
             return False
         else:
+            return back[0].decode()
             print("back0----", back[0].decode())  # 注意需要进行解码操作,默认输出的是字节
             print("back1----", back[1].decode())  # back是一个元祖,可以通过元祖取值的方式获取结果
             return True