visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: PHP :: RTSP (RTP)


By: progGoon U.S.A.  Date: 04/03/2003 00:00:00  English  Points: 300 Status: Answered
Quality : Excellent
<A HREF="http://dmoz.org/Computers/Internet/Protocols/RTSP/">http://dmoz.org/Computers/Internet/Protocols/RTSP/</a>

Want to implement a very basic RTP stream in PHP:

The RTP information for the stream:

* The codec specifies G.711 mu-Law.
* The packet size specifies 20 ms.

Basically, i would have a wav or au file in the above codec, i want to make php send this info as an rtp stream to a specific IP (which is set to recieve) on port 20002

I'm thinking something like:

header("Content-type: audio/mp3\n");
header("Content-Disposition: attachment; filename=".$file."\n");
header("Content-length: ".filesize($filename)."\n");
$fp = fopen($filename, 'rb');
while(!feof($fp)) {
print fread($fp, 4096); }
fclose($fp);

Where audio/mp3 would be replaced with something more appropriate and i would call the script like rtsp://domain/test.php.

I have no idea where to start or if RTSP even accepts headers, or how to make php broadcast on port 20002.

Any reasonable insight would be rewarded.

By: VGR Date: 05/03/2003 07:42:00 English  Type : Answer
to send data on port 20002, it's easy : fsockopen()
the correct MIME-Type has indeed to be specified
The rest should work.
You can also turn magic_quoting off while reading the binary raw data : set_magic_quotes_runtime(0);

I would also suggets reading all the raw data, not as a text file with buffer of length 4096, but in a big block of data with file()
Then send it via fopen(specificIP:20002), fput or fputs, fclose()
By: progGoon Date: 10/03/2003 06:48:00 English  Type : Comment
This is much harder than i had orriginally anticipated. The answer was a good starting point, but does not help me make my own PHP RTSP "server"

For followups, anyone know of a PHP RSTP (RTP) server solution? All i can find are C and Java ones.

Do register to be able to answer

EContact
browser fav
page generated in 332.974910 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page