A FAST API SINGALLING SERVER WITH AIORTC WEB STREAMER
- For signalling server install the
signalling_server_req.txt
using pip
pip3 install -r signalling_server_req.txt
- For camera_streamer install the
camera_stream_req.txt
using pip
pip3 install -r signalling_server_req.txt
-
Change the server address for webcam_streamer.py
a. Change the code - Hard code the address in the py file as server_url b. create .env file in the
camera_code
directory
HOST=xxx.xxx.xxx.xxx
PORT=xxxx
SERVER_URL=http://${HOST}:${PORT}/
- run router.py from signalling_server folder
python3 signalling_server/router.py
- in another system from where you want to stream video output run the camera_code
python3 camera_code/webcam_streamer.py
-
FAST API will work as a signalling server.
-
Currently it will follow only request response model but in later time websocket or socket io will be implemented.
-
There will be two user call and answer.
a. Call will create username/room
b. answer will check all the username/room list and select one and will try to connect to that.
- Added support python aiortc.
- video quality needed to be fixed on aiortc side.
Index | Work | Under Planning | Under Progress | Testing | Completeds | Comments |
---|---|---|---|---|---|---|
1 | Create a simple page with two redirects call and answer | ✅ | ✅ | ✅ | ✅ | |
2 | In the call page create a SDP (Session description) and send it to the fast api | ✅ | ✅ | ✅ | ✅ | Sending to localhost:8080/offer_data as post request |
3 | Add Java script to get the answer response from another points | ✅ | ✅ | ✅ | ✅ | Added java script which request from localhost:8080/get_answer/<username> if anyone answers from answer page then it will take it and connect with the client |
4 | create answer page where the offers will be shown and user can select those | ✅ | ✅ | ✅ | ✅ | took the keys from the offers directionay and passed it to jinja compiler |
5 | Get the offer from the selected user and create answer SDP and pass it to the answer_data |
✅ | ✅ | ✅ | ✅ | Done |
6 | Check the whole flow and test if it working | ✅ | ✅ | ✅ | ✅ | text is being transmitted and ICE candidate is working 😊 |
7 | Create a simple HTML page and transmit video using WEB RTC | ✅ | ✅ | ✅ | ✅ | Created using miniwebrtc github and working |
8 | Test the video transmission in LAN | ✅ | ✅ | ✅ | ✅ | LAN CONNECTION WORKING WITH VIDEO TRANSMISSION |
9 | Test the video in NAT transmission | ✅ | ✅ | ✅ | ✅ | Done |
10 | Python AIORTC code to stream video from camera | ✅ | ✅ | ✅ | ✅ | Done |
10 | Python AIORTC code to Get video stream from another source | ✅ | ✅ | ✅ | ✅ | you can add other sources of the video also like video or a camera which is currently in your resident and streaming RTSP stream |
-
only
Text mode is working in LAN and WAN
where the ice candiadates are getting success but invideo mode only LAN
ice candidate is working.Issue resolved by adding turn ✅
-
Added turn server but still its not working properly.
Needed more testing to confirm the issue. ✅
https://github.com/xem/miniWebRTC https://github.com/aiortc/aiortc/tree/main/examples
👆 Check the aiortc example folder for more ways of implementation of webrtc in python