Sending webRTC video stream to server with django channels

后端 未结 2 667
广开言路
广开言路 2021-02-02 04:28

I am trying to create a face detection web application written in django. The app works this way.

  1. The user navigates to the url
  2. The camera starts on the c
相关标签:
2条回答
  • 2021-02-02 04:57

    I don't think this is a good approach for streaming a video via server. Why even you want to send video frames to server when webrtc directly offers p2p connection.All you need a socket library to manage the user and connect them.You can pass random generated roo_id to django channel for creating rooms.I will suggest you if you are good at nodejs go for socket.io library as very less resources and documentation available on django channel with webrtc.

    0 讨论(0)
  • 2021-02-02 05:14

    yes, you can send video from javascript to python on your server, however, You can not use Ajax or web socket to send frames.

    This is how you can do it.

    1. Create WebRTC session at client-end using javascript
    2. Run webrtc at your server-end using native code.
    3. Now create p2p session between client and server by exchanging SDPs. Note that you will need video capture device at server end else there won't be video session. If not, you can use fake video capturer at server end.
    4. You can then interface your python code with webrtc instance running on your server.

    Let me know if you need more help.

    0 讨论(0)
提交回复
热议问题