hello,

I want to know how can i build an API for the video conference.

What will be the requirement for that?

can we use php for that?? if yes please guide to me to do this?

Dani AI

Generated

Brief, practical update to the thread: for an in-browser video chat today the correct starting point is WebRTC — browsers can capture camera/mic and stream peer-to-peer without plugins (Flash/RTMP is now legacy). WebRTC provides getUserMedia, RTCPeerConnection and RTCDataChannel; it does not mandate how peers find each other, so you still need a signaling channel. See the MDN WebRTC overview for the API basics. (developer.mozilla.org)

Server-side roles and what you actually need: 1) a signaling endpoint (any language — PHP is fine for REST or WebSocket signaling), 2) STUN/TURN servers for NAT traversal (TURN will relay media when direct P2P fails), and 3) an optional media node for multiparty scaling (an SFU/MCU). PHP can handle authentication, user/session persistence and signaling (for example using Ratchet or plain HTTPS endpoints), but you should not try to relay raw audio/video with PHP — use a TURN server like coturn for relays. See the WebRTC backend guide and coturn/Ratchet projects. (web.dev)

Scaling and a minimal workflow: single call = two browsers + signaling + STUN; multiparty = add an SFU (examples: Janus, Jitsi Videobridge, mediasoup). Development path: implement a simple signaling prototype (WebSocket or POST of SDP) and get one-on-one calls working, then add TURN and an SFU if you need rooms. Quick troubleshooting checklist: test over different networks, check ICE candidate logs, verify getUserMedia permissions and secure origins (HTTPS or localhost), and confirm TURN works when peers are behind symmetric NAT. For references and server choices consult Janus, Jitsi and mediasoup docs. (janus.conf.meetecho.com)

Recommended next steps: follow the MDN signaling tutorial and a web.dev backend guide, build a tiny PHP signaling server (or use Node for examples), then add coturn plus an SFU only when you need multi-user rooms. (developer.mozilla.org)

Recommended Answers

All 7 Replies

If you want to use video conferencing then there is some software available but mostly not free. (example: http://www.videowhisper.com/?p=PHP+Video+Conference

If you want to build an API, then you need to have the skills and experience to do it. This isn't a job for a novice. It is doubtful that anyone here has the specific experience that you are looking for. Even less likely that if they do that they are going to try to 'guide" you through an advanced development project like this.

Actually I need to develope a video chat application, in which it needs to display window with video/audio of both the persons who communicating each other.

what will be the requirement to develope this? any training module or tutorial is there, please suggest?

PHP is a server side language. It does not have access to the client machine. If you wanted to do something like this, you would need some kind of client based code (flash or java probably) which could possibly use php to drive some of the underlying functionality, chat, logging, authentication etc.

To retrieve the video/audio stream from the browser you need a browser plugin that has access to the webcam. The most common way to do this right now is with Flash. (I'm guessing you want this to run in the browser).

You'll need to write some ActionScript to get the video and audio from the webcam and stream it to a server. Then the server needs to be able to send that video/audio stream to the receiver of the video.

For the actionscript portion there are many examples online, or you may be able to find some open source code that does it.

For the server side, you need a server for streaming RTMP protocol (see and ) such as Adobe Flash Streaming Server (http://www.adobe.com/products/flashmediastreaming/) which is proprietary or Red5 (written in Java) which is Open Source or other alternative.

You can write a RTMP server in PHP, but it would be re-inventing something in a language not meant for the task. RTMP streaming requires good IO, Memory utilization and networking which PHP is not meant for.

You may also want to look into XMPP, which is an Open Source Instant Messaging Protocol. There are also many existing examples and open source code around XMPP, even video and audio streaming such as with the OpenFire Server and RedFire Server.

Note that RedFire is the OpenFire XMPP server using Red5 to stream the video and audio wrapped in RTMP. It includes the whole sources for java based server and flash client.

Thank you for your detailed reply. Now I want to know more about XMPP.

Can I implement this OpenFire Server with Apache, Mysql, and PHP?

Is there any tutorial for this? I am a beginner in developing field .So please guide me.

commented: as +0

Thank you for your detailed reply. Now I want to know more about XMPP.

Can I implement this OpenFire Server with Apache, Mysql, and PHP?

Is there any tutorial for this? I am a beginner in developing field .So please guide me.

Best resource would be xmpp.org. The best way to look into XMPP is to setup your own server, such as an OpenFire server.

Then install one of the existing open source XMPP clients (IM client supporting XMPP) on your desktop.

Then you can view the traffic sent between the XMPP client and server using a tool such as Wireshark (formerly Ethereal).

You can test the XMPP protocol from the command line also. Look up the XMPP specification for the commands to send.

Here is an example of sending XMPP to google talk. http://www.adarshr.com/papers/xmpp

Can I implement this OpenFire Server with Apache, Mysql, and PHP?

Is there any tutorial for this? I am a beginner in developing field .So please guide me.

OpenFire server primarily sends XML over TCP conforming to the XMPP specification or other media such as video and audio streams under specifications such as RTMP.
Apache is a webserver and primarily sends HTML over HTTP conforming to the HTML specifications.
So the two are separate and for different purposes. There are specifications such as BOSH which allows XMPP over HTTP, but I'm not sure if Apache is the best tool.

In other words, OpenFire runs by itseslf, it does not need Apache or MySQL or PHP. You can however integrate them for your needs, such as have Openfire write messages to MySQL, or talk to Apache and PHP.

I would not be able to show you through this forum how to do all this, neither can anyone else. You'll have to start researching XMPP, TCP, XML, OpenFire etc. over the web and asking specific questions in your progress.

Also get some books on these topics:

XMPP
TCP
ActionScript
RTMP

Inline Code Example Here``Inline Code Example Here
Inline Code Example Here``Inline Code Example Here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.