I have a Ruby On Rails application running on Nginx which is serving out MP3s using JW player. I need to be able to set the start time and duration for playlist items. From what I can tell to do this I need be streaming the MP3 files. How can I setup Nginx to do this?
Nginx has built in support for streaming FLV files through the HttpFlvStreamModule. You nave to specify the module when you compile / recompile Nginx.
You can then configure your nginx.conf to stream FLV files like so:
Now how does this help anything since the original question was about streaming MP3 files? Well you can use FFMPEG to convert the MP3s to FLV files like this:
You can also achieve this with mp4 module
You don't have to convert to flv to play mp3
AFAIK, Nginx is an HTTP server. To stream audio, you will need the likes of Icecast: http://www.icecast.org/
The technical differences between streaming and downloading are mainly with the client and server. To the end user, streaming means that they probably will not be able to save media on their machine. Download and the end user may not be able to begin watching it right away. Though in practice, most data can be viewed as soon as the first bits arrive at the client.
That being said, are you sure you need a streaming server to use JWplayer? Can't you just point it to a URL and let JW fetch it? In this case, Nginx would serve the audio just fine.
In fact, I'm pretty sure I've done this before with Apache. The video started playing after a bit of buffering - like it does with Youtube.