Introduction

Introduction to ew-npvr

Overview

The service ew-npvr is a Network Personal Video Recorder (NPVR) solution that enables the management of recorded content. It provides a complete system for handling personal video recordings with reduced storage usage by reusing duplicated segments.

ew-npvr is designed to integrate with AgileTV Origin’s live ingest channels and provides capabilities for recording and storing content. The repackager reads the recorded content directly from the NPVR storage location.

Key Features

  • Content Management: RESTful API for managing NPVR recordings with CRUD operations
  • Channel Integration: Integrates with live ingest channels (ESB3003) for recording management
  • Thumbnail Generation: Automatic thumbnail generation for recorded content using OpenCV
  • Flexible Storage: Configurable storage locations with support for copy or hard-link behavior
  • Metadata Database: PostgreSQL- or MySQL-backed metadata storage (a database address is required for the service to start)
  • Cursor-based Pagination: Efficient pagination for listing large numbers of recordings
  • Swagger Documentation: Interactive API documentation available at /swagger/
  • Rate Limiting: Configurable write rate limiting for file copy operations
  • Graceful Degradation: If a configured database is unreachable at startup, the service keeps running (the management API is simply not started); a missing database address, however, stops the service from starting

Architecture

ew-npvr consists of several key components:

  1. Management API: RESTful administrative interface for managing recordings (default port: 8099)
    • CRUD operations for NPVR entries
    • Health check endpoint
    • Swagger UI for API documentation
  2. Job Controller: Manages recording jobs and channel synchronization
  3. Database Layer: PostgreSQL or MySQL storage for recording metadata and state (a database address must be configured; the scheme selects the driver)
  4. Channel Manager: Handles communication with live ingest channels via Unix socket

Recording States

NPVR entries progress through various states:

  • pending: Recording request created, waiting to start
  • ongoing: Recording is actively in progress
  • done: Recording completed successfully
  • error: Recording encountered an error
  • deleting: Entry is being deleted
  • updating: Entry metadata is being updated
  • update-ongoing: Update is in progress

Use Cases

  • Recording live channels for time-shifted viewing
  • Personal video library management
  • Catch-up TV services
  • Content archival and replay
  • Cloud DVR services