> **Design proposal / duplicate** — this document duplicates content from
> `roku-channel-proposal.md`. See `project.md` for current implementation status.

# Church Roku Channel Proposal

## 24/7 Scheduled Christian Programming Platform

---


# Project Goals

## Ministry Goals

The Roku channel will allow the church to:

* provide **continuous biblical teaching**
* reach audiences **beyond Sunday services**
* make sermons available **worldwide on smart TVs**
* archive and reuse past sermon content

This significantly expands the church’s digital outreach.

---

# Channel Concept

The channel will function similarly to a **traditional television station**.

Instead of live broadcasting, the system plays **pre-recorded videos according to a defined schedule**.

Example viewing experience:

```
Open Roku Channel
       ↓
Press Watch Live
       ↓
Channel starts playing immediately
```

Viewers join the stream at whatever program is currently scheduled.

---

# Scheduling Model

To simplify operations, the channel will use a **4-hour package scheduling model**.

Each day is divided into **six 4-hour blocks**.

| Block   | Time               |
| ------- | ------------------ |
| Block 1 | 12:00 AM – 4:00 AM |
| Block 2 | 4:00 AM – 8:00 AM  |
| Block 3 | 8:00 AM – 12:00 PM |
| Block 4 | 12:00 PM – 4:00 PM |
| Block 5 | 4:00 PM – 8:00 PM  |
| Block 6 | 8:00 PM – 12:00 AM |

Each block plays a **content package**.

---

# Content Packages

A **package** is a predefined group of videos prepared in advance.

Packages can be reused across multiple time blocks and across multiple days.

Example package types:

| Package Name       | Content                       |
| ------------------ | ----------------------------- |
| PKG-MORNING        | devotional + worship + sermon |
| PKG-TEACHING       | Bible study series            |
| PKG-EVENING        | sermon + worship              |
| PKG-SUNDAY-CURRENT | current Sunday service        |
| PKG-SUNDAY-LAST    | previous Sunday replay        |

Example package structure:

```json
{
  "packageId": "PKG-MORNING",
  "durationHours": 4,
  "items": [
    { "videoId": "devotional-01" },
    { "videoId": "worship-03" },
    { "videoId": "sermon-2026-02-22" },
    { "videoId": "teaching-14" }
  ]
}
```

---

# Sunday Scheduling

Sunday programming will prioritize the most recent sermon.

Logic:

```
If current Sunday package exists
    use current Sunday content
Else
    replay last Sunday package
```

This ensures Sunday content is always available.

---

# System Architecture

The system is composed of several components:

1. Video ingest
2. Encoding
3. Storage
4. Scheduling
5. Streaming delivery
6. Roku playback

---

# Architecture Overview

```
Church Video Sources
(MP4 uploads / archive / YouTube-owned videos)
              │
              ▼
       Azure Blob Storage
           /source
              │
              ▼
        Encoding Worker
            (FFmpeg)
              │
              ▼
        Azure Blob Storage
             /hls
              │
              ▼
        Package Manager
              │
              ▼
        Schedule Manager
              │
              ▼
   Channel Playlist Generator
        channel.m3u8
              │
              ▼
        Azure Front Door
              │
              ▼
          Roku Channel
              │
              ▼
            Viewer
```

---

# Content Ingest

Video content may come from several sources.

### Upload

New sermon recordings uploaded manually.

```
Upload → /source/sermon-2026-03-01.mp4
```

### Archive

Existing church video library.

### YouTube

Church-owned videos may be downloaded from **YouTube Studio** and added to the system.

---

# Encoding Workflow

Videos are encoded **once** into streaming format.

Original:

```
sermon.mp4
```

Encoded output:

```
/hls/sermon-001/
    master.m3u8
    1080p/index.m3u8
    1080p/seg0001.ts
    720p/index.m3u8
    720p/seg0001.ts
    480p/index.m3u8
```

This process is performed using **FFmpeg**.

Example encoding command:

```bash
ffmpeg -i sermon.mp4 \
-hls_time 6 \
-hls_playlist_type vod \
-hls_segment_filename "seg%03d.ts" \
index.m3u8
```

---

# Streaming Format

The system uses **HLS (HTTP Live Streaming)**.

Roku supports both **HLS and DASH**, but HLS is the simplest and most compatible format.

Video segments are typically **4–6 seconds long**.

Example playlist:

```
#EXTM3U
#EXT-X-TARGETDURATION:6

#EXTINF:6,
segment001.ts
```

---

# Channel Playlist

The public playback URL remains constant:

```
https://media.yourchurch.org/hls/channel.m3u8
```

The playlist content is generated dynamically based on the schedule.

The Roku player repeatedly reloads the playlist to receive new segments.

---

# Storage Layout

Example storage structure:

```
/storage

/source
  sermon001.mp4
  sermon002.mp4

/hls
  /sermon001
    master.m3u8
    seg0001.ts
  /sermon002
    master.m3u8

/channel
  channel.m3u8

/images
  sermon001.jpg
```

---

# Azure Hosting Architecture

The system uses Azure cloud infrastructure.

Components:

### Azure Blob Storage

Stores:

* original videos
* HLS segments
* playlists
* thumbnails

### Encoding Worker

Runs FFmpeg jobs.

Possible implementations:

* Azure Container Apps
* Azure VM
* background worker service

### Azure Front Door

Provides:

* global CDN
* HTTPS
* performance optimization

---

# Viewer Workflow

```
Viewer opens Roku channel
        │
        ▼
Roku requests channel.m3u8
        │
        ▼
Playlist generator determines current block
        │
        ▼
Playlist references correct package segments
        │
        ▼
Roku downloads segments and plays video
```

---

# Bandwidth Usage

Average stream bitrate:

```
3 Mbps
```

Data per viewer per hour:

```
≈ 1.35 GB
```

Assuming **20 hours viewing per month**:

```
≈ 27 GB per viewer
```

---

# Estimated Monthly Cost

| Viewers | Data   | Cost |
| ------- | ------ | ---- |
| 2       | 54 GB  | ~$4  |
| 10      | 270 GB | ~$22 |
| 20      | 540 GB | ~$43 |

Additional infrastructure:

| Component | Cost     |
| --------- | -------- |
| Storage   | ~$20     |
| Bandwidth | $4 – $43 |

Estimated total:

```
$25 – $65 per month
```

---

# Benefits for the Church

### Expanded Reach

The channel allows the church to reach viewers who:

* watch television instead of websites
* cannot attend services physically
* live in other countries

---

### Continuous Ministry

The channel provides:

* 24-hour Christian teaching
* sermon replays
* devotional programming

---

### Content Reuse

Existing sermons become a permanent library.

No additional production cost required.

---

### Low Cost

Compared with traditional broadcasting:

| Platform        | Cost       |
| --------------- | ---------- |
| Traditional TV  | $10,000+   |
| OTT Platforms   | $500–$2000 |
| Proposed system | $25–$65    |

---

# Implementation Timeline

| Phase                    | Duration |
| ------------------------ | -------- |
| Infrastructure setup     | 2 days   |
| Encoding pipeline        | 3 days   |
| Package builder          | 2 days   |
| Scheduler                | 2 days   |
| Roku channel integration | 3 days   |
| Testing                  | 3 days   |

Estimated total:

```
2–3 weeks
```

---

# Future Expansion

The system can easily support:

* live Sunday streaming
* multiple Roku channels
* multilingual programming
* additional platforms (Apple TV, Fire TV)

