I'm trying to write a Python server that streams one requested mp3 file from start to end. (No live streaming)
I'd like to have the functionality to play that stream with any media player (like VLC) and be able to change playback position.
I've heard a lot about HTTP Streaming, but after reading a few wikipedia articles it seems to me that 'HTTP Streaming' is just an umbrella term for different streaming protocols such as RTSP/RTCP/RTP.
Then I came across SHOUTcast which is a proprietary software (server!) for streaming media using its own protocol. Another existing server program which seems to offer similiar functionality is Icecast.
I'm not really sure on the relationship between SHOUTcast and Icecast, but there seems to be one.
I figured streaming one specific media file couldn't be that different from streaming a continuous stream like a web-radio so I googled the first webradio and downloaded a .pls or .m3u file.
Both basically were textfiles containing a url. So i started wireshark and pointed VLC to that url.
What I saw was essentially HTTP Traffic:
VLC:
GET /schizoid HTTP/1.1
VLC:
Host: <ip>:8000
User-Agent: VLC/2.0.5 LibVLC/2.0.5
Range: bytes=0-
Connection: close
Icy-MetaData: 1
Server responded:
HTTP/1.0 200 OK
Content-Type: audio/mpeg
icy-br:128
ice-audio-info: bitrate=128
icy-br:128
icy-description:PsyTrance 24x7
icy-genre:psytrance
icy-name:Radio Schizoid
icy-pub:1
icy-url:http://schizoid.in:8000/schizoid
Server: Icecast 2.3.2
Cache-Control: no-cache
icy-metaint:16000
Then the server begins sending raw data, which seems to be the mp3 stream.
According to Wikipedia this is the SHOUTcast protocol.
(Im not sure wether this is the same protocol that Icecast uses)
But I figured a closed (not documented) protocol couldn't possibly be the standard for streaming media.
So my Question is what's the best (easiest and best supported) way to integrate streaming (specific mp3 files) into a python server ?
Do I have to manually implement the SHOUTcast protocol or is something like RTP the way to go?
(I don't mind using a third-party library)