Sending webRTC video stream to server with django channels

后端 未结 2 672
广开言路
广开言路 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 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.

提交回复
热议问题