Timeshift & Archive
Guide for IPTV/OTT providers on how to implement archived programming (timeshift) support in their playlists.
What is Timeshift
Timeshift(also known as "archive" or "catch-up TV") is a feature that allows users to watch programming that has already been broadcast. Instead of being limited to live content, users can go back in time and play past programs.
This functionality depends on the streaming server: the IPTV provider must store channel recordings for a specified period (generally between 1 and 15 days). OTT Player handles building the correct URLs to access archived content based on the EPG guide data.
Step 1: Timeshift Attribute in the M3U Playlist
To enable timeshift on a channel, add the timeshift="N"attribute to the channel's #EXTINF directive, where N is the number of days of archived programming available (maximum 15).
Example: timeshift="7" indicates that 7 days of archive are available for that channel.
#EXTM3U #EXTINF:-1 tvg-id="channel1.us" tvg-name="Channel 1 HD" group-title="Sports" timeshift="7",Channel 1 HD http://server.example.com:8080/live/user/key/channel1.ts #EXTINF:-1 tvg-id="channel2.us" tvg-name="Channel 2" group-title="Movies" timeshift="3",Channel 2 http://server.example.com:8080/live/user/key/channel2.ts #EXTINF:-1 tvg-id="channel3.us" tvg-name="Channel 3 FHD" group-title="News" timeshift="15",Channel 3 FHD http://server.example.com:8080/live/user/key/channel3.ts
Step 2: URL Format with Unix Time
When a user selects a past program from the EPG guide, OTT Player builds the playback URL by appending time parameters in Unix Time format (seconds since January 1, 1970 UTC).
The streaming server must accept these parameters to serve the corresponding archived content.
URL Example:
http://our.stream.url:8080/some_stream_info/?utc=1425988050&lutc=1425988225
URL Breakdown:
http://our.stream.url:8080/some_stream_info/
Base stream URL, same as the live channel URL.
?utc=1425988050
Required parameter. Date and time of the selected program via the EPG guide, in Unix Time format (seconds since January 1, 1970).
&lutc=1425988225
Optional parameter. Current system time in Unix Time format. Some servers require this to calculate the playback window.
Time Parameters
utcRequiredDate and time of the selected program via the EPG guide, in Unix Time format. This value corresponds to the start of the program the user wants to watch.
Example: 1425988050 = March 10, 2015, 13:27:30 UTC
lutcOptionalCurrent system time in Unix Time format. Some streaming servers use this to calculate the playback window and verify that the requested content is within the available archive period.
Example: 1425988225 = March 10, 2015, 13:30:25 UTC
How to Verify Timeshift
To verify that your server supports timeshift correctly, follow these steps:
- 1Take the base URL of a channel that has timeshift enabled.
- 2Append the parameters
?utc=TIMESTAMPwith a Unix timestamp from a few hours ago. - 3Open the full URL in VLC Media Player (Media > Open Network Stream).
- 4If the archived content plays correctly in VLC, timeshift is working.
Test URL example:
http://your.server.com:8080/live/user/key/channel1.ts?utc=1709600400
You can get the current Unix Time with: date +%s (Linux/Mac) or at sites like epochconverter.com
Custom URL Configuration
Some streaming servers use different URL formats for timeshift. In those cases, you can set up scripts on your server to transform the URLs as needed.
Examples of alternative formats that some servers accept:
# Format with 'start' parameter instead of 'utc': http://server.com:8080/stream/channel1?start=1425988050 # Format with human-readable date in the path: http://server.com:8080/archive/channel1/2025-03-05/14-30-00 # Format with duration: http://server.com:8080/timeshift/channel1?utc=1425988050&duration=3600
OTT Player uses the format with utc and lutc parameters by default. If your server requires a different format, you will need to set up a translation layer on your server that accepts these parameters and converts them to the format your streaming backend requires.