|
| PicoStreamer internalsThe trip of stream from the encoder to a listenerIn this article we follow an mp3 stream packet from the encoder to a listener, showing in a simple manner how Picostreamer works. Starting from the encoder...A shoutcast encoder convert the audio signal (from a music file or live mic) to mp3 data, sending it in real time to a shoutcast server. For PicoStreamer system there are no shoutcast servers. The encoder connect to PicoIcy, thinking that PicoIcy is a shoutcast server. Usually this connection (encoder->PicoIcy) is estabilshed via localhost (127.0.0.1) interface: this means that no port must be opened in adsl routers or other firewalls. ...travelling into PicoIcy...At this point PicoIcy make a POST http connection to the picosource.cgi script. This is a normal http POST method, like a classic form submit. This is an example: 01 POST http://free.picostreamer.org/cgi-bin/picosource.cgi?act=source&agent=PI%2fNG061219 HTTP/1.0 02 Host: free.picostreamer.org 03 User-Agent: PicoIcy/NG 04 Connection: close 05 Pico-Streamer-Id: test:password 06 Pico-Streamer-Info: PicoStreamer Powered Radio 07 Pico-Streamer-Source: PicoIcy 08 Pico-Streamer-Source-Ver: 2/NG 09 Pico-Streamer-Bits: 128 10 Pico-Streamer-CType: audio/mpeg 11 Content-Type: application/octet-stream 12 Content-Length: 2147483647 13 14 [mp3 data]Line 01 is the POST connection that uses HTTP 1.0 protocol. On line 05 there are user:password auth info. On line 12 there is an huge Content-Lenght that is mandatory for http protocol (live streaming has not content length but the http header must be here). Starting from line 14 there is the real data stream. ...inside picosource.cgi...At this point picosource.cgi read from STDIN the data as soon as they are available. At given interval, picosource.cgi check if a listener is connected. If a listener is waiting for data, picosource send data using UDP packets over localhost interface to the port of the registered listener. ...to picoreader.cgiWhen a client connect to PicoStreamer, make a simple GET http connection to the script picoreader.cgi. This script setup and UDP socket and write the port of this socket to a file in the "port" user dir. Then, wait for packets sent from picosource.cgi and redirects data to the STDOUT to apache that send data to the listener. From a media player and apache, the picoreader.cgi it's a normal mp3 file download, so there are no particular needs to listen the stream. Questions? Use the forum | PS Statistics
Site Statistics
Latest Posts
web radioin PicoStreamer Powered Stations online no deposit casino bonus in PicoStreamer Powered Stations Deckard and Alima in PicoStreamer Powered Stations Silas and Chenor in PicoStreamer Powered Stations Support PicoStreamer Total Donations: 0 Eur 85 Usd | |||||||||||||||||||||||||||||||||||||
| 99% imageless - ©Vinz486 | |||||||||||||||||||||||||||||||||||||||