HUB
Sign inSign up

lanedfritz/iptv-player

By lanedfritz

•Updated 2 days ago

A simple containerized IPTV Player with native xtream support

Image
Content management system
1

5.2K

lanedfritz/iptv-player repository overview

⁠FrequentSee TV - Advanced .NET IPTV Solution

A feature-rich, containerized IPTV player built with ASP.NET Core 10.0 (Blazor Server). Handles live streams that traditional media servers struggle with, while providing DVR functionality, EPG integration, and multi-user support.

⚠️ This version requires compose changes if you're upgrading from the older lanedfritz/iptv-player image — it needs a new required setting and a one-time data migration step. New install or already on this version? You can ignore this and just follow Quick Start⁠ below. Upgrading? Read Upgrading from the Legacy Image⁠ before you deploy.

⁠🎯 Key Features

⁠📺 Streaming & Playback
  • Reliable MPEG-TS playback - Uses video.js with HLS transcoding for browser compatibility
  • Unified streaming architecture - Single FFmpeg process serves unlimited viewers + recording
  • Instant replay buffer - Click "Record" to capture from when you started watching
  • Multi-viewer support - Multiple users can watch same channel without extra provider connections
  • Active viewer tracking - See who's watching what in real-time
⁠📹 DVR & Recording
  • Schedule recordings - Record from TV Guide or manually schedule by date/time
  • Record while watching - Click record mid-stream without interruption
  • Background MP4 conversion - Automatic conversion from HLS to MP4 after recording
  • TMDb poster integration - Automatic artwork for TV shows and movies
  • Storage management - View disk usage, recording count, and active recordings
  • Thumbnails & metadata - Auto-generated thumbnails, duration, file size tracking
⁠📅 TV Guide
  • 24-hour EPG grid - Full day view with auto-scroll at :00 and :30
  • Channel search - Real-time filtering by name, program, or description
  • Group filtering - Organize by channel groups
  • Performance optimized - Handles 12,000+ channels with 100-channel limit + search
  • Recording indicators - Visual feedback for scheduled/active recordings
⁠👥 Multi-User & Authentication
  • Role-based access - Admin, Manager, Viewer roles
  • User management - Create/edit/delete users with granular permissions
  • Provider management - Users can have their own M3U/Xtream providers
  • Session tracking - Monitor active users and their viewing activity
⁠🎨 Modern UI
  • Responsive design - Works on desktop, tablet, mobile
  • Collapsible sidebar - Hamburger menu with pin functionality
  • Global modal player - Consistent player across all pages
  • Dark theme - Easy on the eyes with blue accent colors
  • Real-time updates - Dashboard with system metrics, logs streaming
⁠🔧 Developer Features
  • Scalar API documentation - Interactive API explorer at /scalar/v1
  • Real-time logs - Live log streaming with filtering and search
  • System monitoring - CPU, memory, disk, network stats
  • Database logging - Persistent logs in PostgreSQL

⁠📋 Prerequisites

  • Docker and Docker Compose
  • IPTV provider with M3U playlist and/or Xtream Codes credentials
  • (Optional) XMLTV EPG URL for program guide

⁠🚀 Quick Start

New install, or already on this version? Follow New Install below — the "Upgrading" section after it doesn't apply to you. Running the older lanedfritz/iptv-player image? Skip ahead to Upgrading from the Legacy Image⁠.

⁠New Install

Pull the image from Docker Hub⁠ — this repo doesn't ship a compose file for you, so create one yourself, e.g. docker-compose.yml:

services:
  iptv-player:
    image: lanedfritz/iptv-player:latest
    container_name: iptv-player
    # Uncomment if you have NVIDIA Container Toolkit installed on the host
    # AND want GPU-accelerated transcoding. Also enable "Use GPU" in app Settings.
    # runtime: nvidia

    ports:
      - "8000:5100"
    volumes:
      # App data (Data Protection keys, etc.) — persisted across updates
      - /your/data/path:/app/data
      # Recordings storage
      - /your/recordings:/data/recordings
      # HLS stream buffer (live TV)
      - /your/streams:/data/streams
      # Docker socket — required for container restart from the UI
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - ConnectionStrings__DefaultConnection=Host=postgres;Database=frequentsee;Username=frequentsee;Password=CHANGE_ME
      - JwtSettings__SecretKey=some-random-string-at-least-32-bytes-long

      - StreamSettings__StreamsDirectory=/data/streams
      - DVRSettings__RecordingsDirectory=/data/recordings

      - TZ=America/Chicago
      - ASPNETCORE_ENVIRONMENT=Production

    depends_on:
      postgres:
        condition: service_healthy

    restart: unless-stopped
    networks:
      - iptv-network

  postgres:
    image: postgres:16-alpine
    container_name: iptv-postgres
    volumes:
      - /your/postgres/data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=frequentsee
      - POSTGRES_USER=frequentsee
      - POSTGRES_PASSWORD=CHANGE_ME          # must match ConnectionStrings__DefaultConnection above
    restart: unless-stopped
    networks:
      - iptv-network
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U frequentsee -d frequentsee"]
      interval: 10s
      timeout: 5s
      retries: 5

networks:
  iptv-network:
    driver: bridge
docker-compose up -d

Access at: http://your-server-ip:8000⁠

⁠⬆️ Upgrading from the Legacy Image

If you're running the older lanedfritz/iptv-player image, a few things changed that the legacy app never needed:

  1. Keep your existing volume mounts as-is. Don't change or remove your current /app/data or /data/recordings mounts — the new image uses the same paths, so your existing recordings keep working with no changes needed.
  2. Add JwtSettings__SecretKey (new, required) — the app won't start without it:
    - JwtSettings__SecretKey=some-random-string-at-least-32-bytes-long
    
  3. Point ConnectionStrings__DefaultConnection at a new, separate database (not your existing one) — e.g. change the Database= name to frequentsee. This database doesn't need to exist beforehand; it's created automatically on first startup.
  4. Keep (or add) PostgresConnection pointing at your old database, in the same format the legacy app used:
    - PostgresConnection=Host=postgres;Database=iptv;Username=iptv;Password=...
    
    This is only used to detect and read your old data — leave the old database running and don't modify it.
  5. Start the container. On first load you'll be redirected to /Migration, which shows a preflight summary (row counts, warnings) of what it found in the old database. Review it, then run the migration. Your old database is never modified — it's only ever read, so it stays available as a rollback.

⁠📖 Usage Guide

⁠First Time Setup
  1. Complete the setup wizard on first run - create the admin account, add a provider, optional TMDb API key
  2. Add IPTV Provider:
    • Go to Providers page
    • Click "Add Provider"
    • Choose type: M3U or Xtream Codes
    • Enter your provider details
    • Click Save
⁠Adding M3U Provider
Name: My IPTV Service
Type: M3U
M3U URL: http://your-provider.com/playlist.m3u
XMLTV URL: http://your-provider.com/epg.xml (optional)
⁠Adding Xtream Codes Provider
Name: My Xtream Service
Type: Xtream Codes
Server: http://your-provider.com:port
Username: your_username
Password: your_password
⁠Recording a Program

From TV Guide:

  1. Navigate to Guide page
  2. Click on a program in the EPG grid
  3. Click "Record" button in program details modal
  4. Choose start time and duration (pre-filled for EPG programs)

While Watching:

  1. Play any channel
  2. Click "Record" button in player
  3. Recording captures from when you started watching (instant replay!)
  4. Click "Stop Recording" when done

Scheduled Recording:

  1. Go to Recordings page
  2. Click "Schedule Recording"
  3. Select channel, date, time, and duration
⁠Managing Users (Admin Only)
  1. Go to Users page
  2. Create users with different roles:
    • Admin: Full access to everything
    • Manager: Manage providers, view users
    • Viewer: Watch channels and record
⁠Monitoring System
  • Dashboard: System stats, active viewers, recent recordings
  • Logs: Real-time log streaming with filtering
  • Recordings: Storage usage, recording library

⁠🔧 Configuration

⁠Volume Mounts Explained
PathPurposeCan Use tmpfs?
PostgreSQL data volumeDatabase, must persist❌ No
/data/recordingsFinal MP4 recordings, must persist❌ No
/data/streamsHLS buffers (temporary)✅ Yes
/data/transcodesFFmpeg working files (temporary)✅ Yes

tmpfs for performance (optional):

volumes:
  - ./data:/app/data
  - ./recordings:/data/recordings
tmpfs:
  - /data/streams:size=2G
  - /data/transcodes:size=1G
⁠Environment Variables

Database:

- ConnectionStrings__DefaultConnection=Host=postgres;Database=frequentsee;Username=frequentsee;Password=...

Authentication (required):

- JwtSettings__SecretKey=some-random-string-at-least-32-bytes-long

Upgrading from the legacy image (optional):

# Points at your old database so the app can detect it and offer to migrate.
# Only needed during the upgrade — see "Upgrading from the Legacy Image" above.
- PostgresConnection=Host=postgres;Database=iptv;Username=iptv;Password=...

Streaming:

- StreamSettings__StreamsDirectory=/data/streams
- StreamSettings__TranscodeDirectory=/data/transcodes
- StreamSettings__StreamInactivityTimeoutMinutes=30
- StreamSettings__MaxConcurrentSessions=10

DVR:

- DVRSettings__RecordingsDirectory=/data/recordings
- DVRSettings__MaxConcurrentRecordings=4
- DVRSettings__PrePaddingSeconds=60
- DVRSettings__PostPaddingSeconds=120

TMDb (for posters):

- TMDbSettings__ApiKey=your-tmdb-api-key
- TMDbSettings__EnablePosterLookup=true

Get a free TMDb API key at: https://www.themoviedb.org/settings/api⁠

⁠Channel Updates

Channels auto-refresh based on provider settings. Manual refresh:

  • Click "Refresh Channels" button in sidebar
  • Or call API: POST /api/providers/{id}/refresh

⁠📡 API Documentation

Interactive API documentation available at:

⁠Key Endpoints

Authentication:

  • POST /api/auth/login - Login with username/password
  • POST /api/auth/logout - Logout current session

Channels:

  • GET /api/channels - List channels (supports search, group filter)
  • GET /api/channels/{id} - Get channel details with current EPG

Recordings:

  • GET /api/recordings - List recordings
  • POST /api/recordings - Schedule recording
  • GET /api/recordings/{id}/thumbnail - Get recording thumbnail
  • POST /api/recordings/{id}/cancel - Cancel/stop recording

Providers:

  • GET /api/providers - List providers
  • POST /api/providers - Add provider
  • PUT /api/providers/{id} - Update provider
  • DELETE /api/providers/{id} - Remove provider

System:

  • GET /api/systemstatus - Real-time system metrics
  • GET /api/logs - Query logs

⁠🏗️ Architecture

⁠Unified Streaming/Recording
  • StreamSession - Database-tracked sessions per channel
  • Viewer counting - Reference counting for concurrent viewers
  • Single FFmpeg process - Serves all viewers + recording simultaneously
  • Background conversion - Queue-based HLS → MP4 conversion after recording
  • Automatic cleanup - Orphaned sessions detected on startup
⁠Services (src/Frequentsee.Application/Services/)
  • M3UService / M3UProviderService - Parses M3U playlists, Xtream + M3U provider ingestion
  • ProviderFailover/ - Multi-server-URL failover per provider
  • FFmpegStreamService - HLS transcoding with session management
  • RecordingService - DVR scheduling and management
  • ConversionService - Background MP4 conversion queue
  • MediaLibraryService - VOD media library scanning and metadata matching
  • DiskInfoService - Shared disk space calculation (handles Docker mounts)
  • AnalyticsService - Active viewer tracking, viewing analytics
⁠Database

PostgreSQL (pgvector/pgvector:pg16) via Entity Framework Core. Key tables:

  • Users, Roles, UserRoles
  • Providers, ProviderServerUrls
  • Recordings, StreamSessions, Downloads
  • MediaLibraryItems
  • Logs

⁠🐛 Troubleshooting

⁠Channels not loading
  1. Check provider status: Providers page → Status column
  2. View logs: Logs page → Filter by "Error" level
  3. Verify provider credentials
  4. Test M3U URL accessibility: curl -I "your-m3u-url"
⁠Streams not playing
  1. Open browser console (F12) for errors
  2. Check FFmpeg is installed: docker exec iptv-player which ffmpeg
  3. Verify firewall allows your configured port
  4. Try different browser (Chrome/Edge recommended)
⁠Recordings fail to convert
  1. Check logs for FFmpeg errors
  2. Verify /data/recordings has write permissions
  3. Check disk space: Dashboard → Storage section
  4. Ensure FFmpeg is working: docker exec iptv-player ffmpeg -version
⁠Database connection errors
  1. Check the Postgres container is healthy: docker ps / docker logs iptv-postgres
  2. Verify ConnectionStrings__DefaultConnection matches the Postgres container name/credentials
  3. Restart: docker-compose up -d --build
⁠High memory usage

For 10,000+ channels, increase memory limit:

deploy:
  resources:
    limits:
      memory: 1G

⁠🔐 Security Notes

  • Change default admin password immediately
  • Use strong passwords for all users
  • Keep TMDb API key private
  • Use HTTPS in production (reverse proxy recommended)
  • Database contains hashed passwords (bcrypt)
  • Session tokens expire after inactivity

⁠📊 Performance Tips

  1. Use tmpfs for temporary files - Significantly improves I/O performance
  2. Limit channel count - TV Guide limits to 100 visible, use search for more
  3. Enable TMDb caching - Reduces API calls for poster lookup
  4. Adjust cleanup intervals - Balance between cleanup frequency and performance
  5. Monitor disk space - Automatic cleanup helps but monitor recordings directory

⁠🛠️ Development

⁠Running Locally
# Install .NET 10.0 SDK
dotnet restore
dotnet run --project src/Frequentsee.Web/Frequentsee.Web.csproj

# Access at http://localhost:5100
⁠Building from Source
git clone https://github.com/yourusername/iptv-player.git
cd iptv-player
docker build -f src/Frequentsee.Web/Dockerfile -t frequentsee:latest .
⁠Database Migrations
# Add migration
dotnet ef migrations add MigrationName

# Apply migrations
dotnet ef database update

⁠📝 License

Free to use and modify for personal use.

⁠🙏 Credits

  • ASP.NET Core 10.0 (Blazor Server) - Backend framework
  • video.js (VHS/HLS) - Media playback
  • FFmpeg - Stream transcoding
  • TMDb - Movie/TV show metadata
  • MudBlazor - UI components
  • PostgreSQL (pgvector) - Database
  • Scalar - API documentation

⁠🤝 Contributing

This is a personal project, but feedback and suggestions are welcome!

⁠📞 Support

For issues and questions:

  • Check the Troubleshooting section above
  • Review logs in the Logs page
  • Check API documentation at /scalar/v1

Built with ❤️ for handling problematic IPTV streams

Tag summary
Recent tags
Content type
Image
Digest
sha256:9b0d109b4…
Size
335 MB
Last updated
2 days ago
docker pull lanedfritz/iptv-player:latest