Languages :: PHP :: RTSP (RTP) |
|||
| By: progGoon |
Date: 04/03/2003 00:00:00 |
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 | 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 | 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 |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








