This is a very simplistic example of how to setup a recording of a live stream that is then saved as HLS for playback and rewind. The aim is that you could use this for rough cut editing of clips off a live stream.
What you will need:
- Server or desktop with latest build of ffmpeg
- HTTP server
- Decent computer and basic HTML skills
1. Record a live stream as HLS
ffmpeg -i http://www.nasa.gov/multimedia/nasatv/NTV-Public-IPS.m3u8 -c copy -f segment -segment_list index.m3u8 -segment_time 10 -segment_format mpeg_ts -segment_list_type m3u8 segment%05d.ts
This sample uses the NASA live stream (no guarantee that will be there) but you should be able to take in just about any live stream. Note that I am just copying the codec out here, if you want to transcode look at some of my other HLS posts.
This also assumes that you are running the command so that it writes directly into a directory on your webserver e.g. in my setup I could access the playlist at:
2. Play the stream back with DVR functions
The best player I found for this was here: http://osmfhls.kutu.ru/
For testing you should just be able to take the stream above and paste it into the test URL, making sure you click on the DVR function first.