SlideShare a Scribd company logo
1 of 20
Video Conference
Our goal is to make a Video Conference system in
our solution such that developers can communicate
with each other. Therefore, we first try the most
common solution which is using flash player at the
client side and streaming server at the server side.
OpenTok
One of the famous platforms that implement this
architecture is OpenTok which allows developers to
integrate live, face-to-face video directly into their
own website.
However, OpenTok is not free and very expensive
to use it inside a social network that may contain
thousands of users.
Streaming server vs peer to
peer
Therefore, we think about building our own system
but the problem was that streaming server is very
expensive too.
We try to found a peer-to-peer solution without a
streaming server so that each browser can send
and receive stream from other browser peer to
peer so we can save the cost of using expensive
streaming server.
WebRTC (Real Time
communication)
WebRTC has implemented three APIs
◦ 1. MediaStream API (getUserMedia)
◦ 2. RTCPeerConnection
◦ 3. RTCDataChanal
MediaStream API
(getUserMedia)
getUserMedia is available in Chrome, Opera and
Firefox Nightly/Aurora and can be used in Internet
Explorer using Chromo Frame plugin.
the getuserMedia API is responsible for access the
camera and microphone .presents synchronized
streams of media.
For example, a stream taken from camera and
microphone input has synchronized video and
audio tracks.
The getUserMedia() method takes three
parameters:
◦ 1. Constraints object.
◦ 2. A success callback which, if called, is passed a
LocalMediaStream.
◦ 3. A failure callback which, if called, is passed an
error object.
Here is some sample code
Signaling: Session Control, Network and
Media Information
WebRTC uses RTCPeerConnection to
communicate streaming data between browsers
(peers), but also needs a mechanism to coordinate
communication and to send control messages, a
process known as signaling.
1-First choice is to use XHR and the Channel API
as the signaling mechanism (google app engine)
and this is the easy way and most common used
but it is not free and you have to pay to use this
service.
2-Second choice is to implement signaling
mechanism on your server using websockets
WebSockets using node.js
Node.js is a platform built on Chrome's JavaScript
runtime for easily building fast, scalable network
applications. Node.js uses an event-driven, non-
blocking I/O model that makes it lightweight and
efficient, perfect for data-intensive real-time
applications that run across distributed devices.
Node.js is used to run JavaScript without a browser
so you can use it to create a server side application
and create WebSockets.
Implemetation of WebSockets
java Node.js
pro - A multi-threaded language.
- It is an old language, have
a good community and
there are many resources
on the internet. - It is a
strong typed language with
can save a lot of error and
java good IDEs.
- It is built completely on
asynchronous callback
architecture when it receive a
request it execute it in a callback
function asynchronous on
another thread so we create
thread only when we execute
callback function not for every
connection like java.
con It is a multithread language
and every connection to a
WebSocket will need a
thread this will need a high
performance server.
- Node.js use JavaScript which is
not strong typed language which
can cause a lot of errors. - Very
difficult to debug.
Our decision
We decided to use node.js platform because it is
very efficient and doesn’t need a high performance
server so we can save the costs.
Scenario
Step 1: Each user connect to a socket on the
server using socket.io API.
Step 2: We need to add some data in sockets at
the server side so we can identify who is
connected on the server, who is online, and busy.
Socket is JSON object we add the following data to
it
1-Socket.devos.username=null;
2-Socket.devos.reciever=null;
3-Socket.devos.status=0;
Step 3:
1. If we want to send a message to a user you have
to add some header data which are the sender
user_id and the receiver user_id so at the server
read the message and search to the reciever socket
by user_id and forward the message to the receiving
user.
2. assume that browser 1 is Alice and browser 2 is
Bob .Alice want to make a video call with Bob so she
first send a message that contain her user_id as a
sender and Bob user_id as a receiver and type of
the message is call_request.
3. Then Bob response with a message contain his
user_id as a sender and Alice user_id as a receiver
and message type call_response and action is
accept
Step 4:
After Alice receive Bob response
1. she create a peer connection and create and offer and send
it to Bob as session description which contain information
about the video format and other data.
2. Bob receive the session description offer and create a peer
connection and add the remote session description to the peer
connection and then create and answer as session description
and send it back to Alice.
3. Bob use the ice server framework, which used in webRTC
peer connection API to get the shortest path to Alice and send
here his IP and port number as message called candidate
message.
4. Alice receive the answer session description and add it as a
remote session on her peer connection.
5. Alice use the ice server framework which used in webRTC
peer connection API to get the shortest path to Bob and send
here his IP and port number as message called candidate
message.
6. Peer connection complete setup after both of them receive
the candidate message the a stream flow peer to peer
between them.
video conference (peer to peer)

More Related Content

What's hot

Socket programming in Java (PPTX)
Socket programming in Java (PPTX)Socket programming in Java (PPTX)
Socket programming in Java (PPTX)UC San Diego
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in JavaTushar B Kute
 
Networking Java Socket Programming
Networking Java Socket ProgrammingNetworking Java Socket Programming
Networking Java Socket ProgrammingMousmi Pawar
 
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...Jeremiah Grossman
 
Building Fast and Scalable Persistence Layers with Spring Data JPA
Building Fast and Scalable Persistence Layers with Spring Data JPABuilding Fast and Scalable Persistence Layers with Spring Data JPA
Building Fast and Scalable Persistence Layers with Spring Data JPAVMware Tanzu
 
WebRTC Introduction & Basics
WebRTC Introduction & BasicsWebRTC Introduction & Basics
WebRTC Introduction & BasicsMuhammad Ali
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingGera Paulos
 
Communication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & FutureCommunication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & FutureMuhammad Ali
 
Multiplayer Java Game
Multiplayer Java GameMultiplayer Java Game
Multiplayer Java Gamekarim baidar
 
Server side programming
Server side programming Server side programming
Server side programming javed ahmed
 
Server Side Programming
Server Side ProgrammingServer Side Programming
Server Side ProgrammingMilan Thapa
 
Java networking programs socket based
Java networking programs socket basedJava networking programs socket based
Java networking programs socket basedMukesh Tekwani
 
Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In JavaAnkur Agrawal
 

What's hot (20)

Socket programming in Java (PPTX)
Socket programming in Java (PPTX)Socket programming in Java (PPTX)
Socket programming in Java (PPTX)
 
Networking in Java
Networking in JavaNetworking in Java
Networking in Java
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in Java
 
Networking Java Socket Programming
Networking Java Socket ProgrammingNetworking Java Socket Programming
Networking Java Socket Programming
 
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
 
Building Fast and Scalable Persistence Layers with Spring Data JPA
Building Fast and Scalable Persistence Layers with Spring Data JPABuilding Fast and Scalable Persistence Layers with Spring Data JPA
Building Fast and Scalable Persistence Layers with Spring Data JPA
 
WebRTC Introduction & Basics
WebRTC Introduction & BasicsWebRTC Introduction & Basics
WebRTC Introduction & Basics
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programming
 
Communication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & FutureCommunication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & Future
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
Multiplayer Java Game
Multiplayer Java GameMultiplayer Java Game
Multiplayer Java Game
 
Day03 api
Day03   apiDay03   api
Day03 api
 
Java servlets
Java servletsJava servlets
Java servlets
 
java networking
 java networking java networking
java networking
 
Java socket programming
Java socket programmingJava socket programming
Java socket programming
 
Servlet
ServletServlet
Servlet
 
Server side programming
Server side programming Server side programming
Server side programming
 
Server Side Programming
Server Side ProgrammingServer Side Programming
Server Side Programming
 
Java networking programs socket based
Java networking programs socket basedJava networking programs socket based
Java networking programs socket based
 
Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In Java
 

Similar to video conference (peer to peer)

Web services Concepts
Web services ConceptsWeb services Concepts
Web services Conceptspasam suresh
 
Chat server nitish nagar
Chat server nitish nagarChat server nitish nagar
Chat server nitish nagarNitish Nagar
 
Web application development ( basics )
Web application development ( basics )Web application development ( basics )
Web application development ( basics )Chirag Nag
 
Spring Boot for WebRTC Signaling Servers: A Comprehensive Guide
Spring Boot for WebRTC Signaling Servers: A Comprehensive GuideSpring Boot for WebRTC Signaling Servers: A Comprehensive Guide
Spring Boot for WebRTC Signaling Servers: A Comprehensive GuideInexture Solutions
 
Client server chat application
Client server chat applicationClient server chat application
Client server chat applicationSamsil Arefin
 
Mail Server Project Report
Mail Server Project ReportMail Server Project Report
Mail Server Project ReportKavita Sharma
 
socket-programming.pptx
socket-programming.pptxsocket-programming.pptx
socket-programming.pptxRubenAssandja
 
Eyeball Messenger SDK WebRTC Developer Reference Guide
Eyeball Messenger SDK WebRTC Developer Reference GuideEyeball Messenger SDK WebRTC Developer Reference Guide
Eyeball Messenger SDK WebRTC Developer Reference GuideEyeball Networks
 
Java Networking
Java NetworkingJava Networking
Java NetworkingSunil OS
 
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use CasesAn In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use CasesTien Nguyen
 
Real time web_apps_pycon2012-v1
Real time web_apps_pycon2012-v1Real time web_apps_pycon2012-v1
Real time web_apps_pycon2012-v1Avinash Prasad
 
Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Deepak Gupta
 

Similar to video conference (peer to peer) (20)

Web services Concepts
Web services ConceptsWeb services Concepts
Web services Concepts
 
Chat server nitish nagar
Chat server nitish nagarChat server nitish nagar
Chat server nitish nagar
 
Chapter2 Application
Chapter2 ApplicationChapter2 Application
Chapter2 Application
 
Web application development ( basics )
Web application development ( basics )Web application development ( basics )
Web application development ( basics )
 
Chapter 6-Remoting
Chapter 6-RemotingChapter 6-Remoting
Chapter 6-Remoting
 
Spring Boot for WebRTC Signaling Servers: A Comprehensive Guide
Spring Boot for WebRTC Signaling Servers: A Comprehensive GuideSpring Boot for WebRTC Signaling Servers: A Comprehensive Guide
Spring Boot for WebRTC Signaling Servers: A Comprehensive Guide
 
ZN27112015
ZN27112015ZN27112015
ZN27112015
 
Client server chat application
Client server chat applicationClient server chat application
Client server chat application
 
Mail Server Project Report
Mail Server Project ReportMail Server Project Report
Mail Server Project Report
 
It and ej
It and ejIt and ej
It and ej
 
WebRTC Seminar Report
WebRTC  Seminar ReportWebRTC  Seminar Report
WebRTC Seminar Report
 
Webrtc in Real world
Webrtc in Real world Webrtc in Real world
Webrtc in Real world
 
socket-programming.pptx
socket-programming.pptxsocket-programming.pptx
socket-programming.pptx
 
Eyeball Messenger SDK WebRTC Developer Reference Guide
Eyeball Messenger SDK WebRTC Developer Reference GuideEyeball Messenger SDK WebRTC Developer Reference Guide
Eyeball Messenger SDK WebRTC Developer Reference Guide
 
SOA web services concepts
SOA web services conceptsSOA web services concepts
SOA web services concepts
 
Nodejsvs
NodejsvsNodejsvs
Nodejsvs
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use CasesAn In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
 
Real time web_apps_pycon2012-v1
Real time web_apps_pycon2012-v1Real time web_apps_pycon2012-v1
Real time web_apps_pycon2012-v1
 
Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Recently uploaded (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

video conference (peer to peer)

  • 1. Video Conference Our goal is to make a Video Conference system in our solution such that developers can communicate with each other. Therefore, we first try the most common solution which is using flash player at the client side and streaming server at the server side.
  • 2. OpenTok One of the famous platforms that implement this architecture is OpenTok which allows developers to integrate live, face-to-face video directly into their own website. However, OpenTok is not free and very expensive to use it inside a social network that may contain thousands of users.
  • 3. Streaming server vs peer to peer Therefore, we think about building our own system but the problem was that streaming server is very expensive too. We try to found a peer-to-peer solution without a streaming server so that each browser can send and receive stream from other browser peer to peer so we can save the cost of using expensive streaming server.
  • 4. WebRTC (Real Time communication) WebRTC has implemented three APIs ◦ 1. MediaStream API (getUserMedia) ◦ 2. RTCPeerConnection ◦ 3. RTCDataChanal
  • 5. MediaStream API (getUserMedia) getUserMedia is available in Chrome, Opera and Firefox Nightly/Aurora and can be used in Internet Explorer using Chromo Frame plugin. the getuserMedia API is responsible for access the camera and microphone .presents synchronized streams of media. For example, a stream taken from camera and microphone input has synchronized video and audio tracks.
  • 6. The getUserMedia() method takes three parameters: ◦ 1. Constraints object. ◦ 2. A success callback which, if called, is passed a LocalMediaStream. ◦ 3. A failure callback which, if called, is passed an error object.
  • 7. Here is some sample code
  • 8. Signaling: Session Control, Network and Media Information WebRTC uses RTCPeerConnection to communicate streaming data between browsers (peers), but also needs a mechanism to coordinate communication and to send control messages, a process known as signaling.
  • 9.
  • 10. 1-First choice is to use XHR and the Channel API as the signaling mechanism (google app engine) and this is the easy way and most common used but it is not free and you have to pay to use this service. 2-Second choice is to implement signaling mechanism on your server using websockets
  • 11. WebSockets using node.js Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non- blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. Node.js is used to run JavaScript without a browser so you can use it to create a server side application and create WebSockets.
  • 12. Implemetation of WebSockets java Node.js pro - A multi-threaded language. - It is an old language, have a good community and there are many resources on the internet. - It is a strong typed language with can save a lot of error and java good IDEs. - It is built completely on asynchronous callback architecture when it receive a request it execute it in a callback function asynchronous on another thread so we create thread only when we execute callback function not for every connection like java. con It is a multithread language and every connection to a WebSocket will need a thread this will need a high performance server. - Node.js use JavaScript which is not strong typed language which can cause a lot of errors. - Very difficult to debug.
  • 13. Our decision We decided to use node.js platform because it is very efficient and doesn’t need a high performance server so we can save the costs.
  • 14. Scenario Step 1: Each user connect to a socket on the server using socket.io API.
  • 15. Step 2: We need to add some data in sockets at the server side so we can identify who is connected on the server, who is online, and busy. Socket is JSON object we add the following data to it 1-Socket.devos.username=null; 2-Socket.devos.reciever=null; 3-Socket.devos.status=0;
  • 16.
  • 17. Step 3: 1. If we want to send a message to a user you have to add some header data which are the sender user_id and the receiver user_id so at the server read the message and search to the reciever socket by user_id and forward the message to the receiving user. 2. assume that browser 1 is Alice and browser 2 is Bob .Alice want to make a video call with Bob so she first send a message that contain her user_id as a sender and Bob user_id as a receiver and type of the message is call_request. 3. Then Bob response with a message contain his user_id as a sender and Alice user_id as a receiver and message type call_response and action is accept
  • 18.
  • 19. Step 4: After Alice receive Bob response 1. she create a peer connection and create and offer and send it to Bob as session description which contain information about the video format and other data. 2. Bob receive the session description offer and create a peer connection and add the remote session description to the peer connection and then create and answer as session description and send it back to Alice. 3. Bob use the ice server framework, which used in webRTC peer connection API to get the shortest path to Alice and send here his IP and port number as message called candidate message. 4. Alice receive the answer session description and add it as a remote session on her peer connection. 5. Alice use the ice server framework which used in webRTC peer connection API to get the shortest path to Bob and send here his IP and port number as message called candidate message. 6. Peer connection complete setup after both of them receive the candidate message the a stream flow peer to peer between them.