MIT License

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

深度解析 OwnTV 开源项目

项目背景与痛点

在当前的流媒体市场上,用户对于视频内容的需求日益增长,因此,一个强大、可定制化的流媒体解决方案变得至关重要。OwnTV 项目提供了一种自托管的解决方案,使用户能够灵活地配置自己的流媒体服务,并满足多样化的业务需求。

这一点非常关键,特别是对于需要高度定制化服务的企业和开发者而言。传统流媒体服务平台的功能通常相对固定,难以满足特定业务场景下的复杂需求。OwnTV 的出现便填补了这一空白,为有特定需求的用户提供了一种更为灵活的方案。

核心技术揭秘

技术栈与架构设计

OwnTV 项目采用了现代化的技术栈,注重模块化设计和微服务架构,这使其在功能扩展性和维护性方面具有明显优势。针对该项目的技术架构进行深入分析,可以更好地理解其背后的实现机制。

数据流图
graph TD A[用户请求] --> B{"参数校验"} B -->|"通过"| C[路由处理] C --> D[服务调用] D -->|"成功"| E[响应处理] D -->|"失败"| F[错误处理] B -->|"失败"| F[错误处理] F --> G[返回错误] E --> H[返回结果]
关键技术组件
  1. 前端界面:使用现代框架(如 React 或 Vue)构建,提供丰富的交互体验。
  2. 后端服务:采用微服务架构,各模块间通过 RESTful API 或 gRPC 进行通信。
  3. 数据库:支持多种数据库方案,确保数据存储的灵活性和可靠性。
  4. 流媒体处理:利用 ffmpeg 等工具对流媒体数据进行编码和解码,提供流畅的播放体验。

通过上述技术栈的设计,在保证项目灵活性的同时,也保持了较好的性能和易用性。

功能亮点与差异

相比于其他流媒体服务,OwnTV 的最大亮点在于其高度的自定义能力。用户可以通过配置文件和插件机制来定制不同的功能模块,如推流服务、播放器样式等。此外,项目还提供了完整的 REST API 接口,方便开发者快速集成到业务系统中。

在流媒体领域内,OwnTV 通过强大的自定义配置能力和统一的 API 接口,将自己置于领先地位,为用户提供了更为便捷和灵活的解决方案。

应用场景与落地建议

在生产环境部署 OwnTV 时,首先需要注意的是基础设施的可用性和稳定性。考虑到流媒体服务对于带宽和硬件性能要求较高,确保服务器资源充足且网络传输顺畅是至关重要的。此外,还需关注安全性,确保数据传输的加密和用户隐私的保护。

尽管 OwnTV 项目所具有的灵活性和扩展性使其成为很多场景下的理想选择,它也非常适合中小企业及个人开发者构建自托管的流媒体服务,特别适用于需要高灵活度和可定制性的业务场景。

综合评价

优点

  • 高度定制:支持灵活的配置和插件机制,能覆盖各类业务需求。
  • 技术栈现代:综合利用了微服务和现代前端开发技术,具备良好的扩展性和维护性。
  • 丰富的 API 接口:满足不同开发者集成需求,提高开发效率。

缺点

  • 复杂度较高:对于不熟悉微服务架构的开发者来说,可能需要更多时间来理解和配置整个项目。
  • 性能瓶颈:相比于专用的流媒体解决方案,在高并发场景下可能会遇到性能瓶颈,需要额外的优化和调优工作。

总体而言,OwnTV 项目是一个非常有潜力的开源项目,它在灵活性和可定制性方面表现出色,虽然它在性能调优和操作复杂度上具有一定的挑战,但在满足特定业务需求的前提下,仍不失为一个好的选择。

简要分析

热度分
382
价值分
122
活跃状态
活跃
暂无主题

语言占比

JavaScript
Kotlin
Python
Shell

Release

README

OwnTV

Your own IPTV player for Android TV
Fast · modern · remote-first — bring your own M3U, Xtream or Stalker (MAC) sources

Platform Kotlin Compose for TV Player License Built with the help of AI Translation status

Android CI


OwnTV is a native Android TV IPTV player, built with Kotlin and Jetpack Compose for TV. It runs two playback engines — libmpv (FFmpeg) for the widest compatibility, ExoPlayer (Media3) for near-instant Live TV — and it is a player only: you bring your own Xtream login, M3U playlist (URL or a local file) or Stalker/Ministra portal.

⚠️ OwnTV ships no channels, playlists, subscriptions or streams. You are responsible for the sources you add.

Open source, GPLv3, original code, built with the help of AI. Android TV only — leanback launcher, D-pad first.

📖 New here? User Guide →

Every feature, where to find it, and the remote shortcuts — on one page.


💬 Community

Questions, ideas, bug reports — join the OwnTV Telegram group:

👉 t.me/owntvplayer

Scan to join the OwnTV Telegram group


✨ Features

🎬 Playback

  • Two engines — mpv for compatibility, ExoPlayer for instant Live TV, with automatic fallback and a per-channel override
  • 4K HDR direct rendering, optional auto frame-rate matching, surround sound with a stereo safety net, 150% volume boost
  • Subtitles — text, image and closed captions, plus OpenSubtitles search and local files
  • Resume, next-episode auto-play, mini-player/PiP, picture-in-picture when you press Home, audio-only mode, live stream-info overlay
  • Media-session transport keys and proper audio focus — it behaves like a TV app
  • An error log you can export for any stream that misbehaves

🧭 Browse

  • Home with Continue Watching and Now Trending (TMDB rankings matched to what your provider can actually play)
  • Live TV · Movies · Series · Downloads · Guide, with per-profile row order, Favorites, History and search (voice search where the TV has a speech recogniser)
  • Multiple playlists at once, with provider labels everywhere they could be confused
  • Rename, hide, reorder and combine categories; bulk rename rules
  • TMDB posters, plots, cast and trailers in 40 languages — scales to ~50k channels / ~168k movies
  • Two layouts for Movies & Series — the classic three panels, or Cinematic: the focused title’s artwork full-bleed behind the whole screen, with its details and cast above a wide poster grid
  • Adjustable panel widths per section, including hiding the preview pane entirely

📥 Sources & EPG

  • Xtream, M3U and Stalker/Ministra — add any of them from your phone over Wi-Fi (QR + PIN)
  • TV Guide (XMLTV) with a live Now marker, multiple guide sources and automatic channel matching
  • Catch-up TV up to 7 days, live rewind, and Go back to… even for channels with no guide
  • Guide time offset, per-source guide logos, per-channel EPG fixes
  • Protected (DRM) channels — Widevine and ClearKey, read from the playlist, nothing to configure
  • Custom DNS (Google, Cloudflare, Quad9, DoH or your own)

⏺️ Recording & Multiview

  • Record live TV from the guide, the channel list or while watching — including every showing of a programme
  • Multiview — up to four channels at once, with one carrying the sound
  • OwnTV measures how many streams your provider allows and warns before it refuses one

👥 Profiles & Downloads

  • Multiple profiles with their own favourites, history and resume points, PIN locks and a Kids mode; lock single categories behind a PIN, and optionally Settings too
  • Per-profile startup: Home, last channel, the last channel in the TV Guide or Live TV, Favorites, or one chosen channel
  • Offline movies and episodes with pause, resume, retry and a storage bar

🎨 Look & robustness

  • Your own accent colour and focus highlight, frosted Glass with adjustable opacity, and a Stage, Picture or Plain background
  • Dark and Light themes (or follow the TV) across the whole app, the player included
  • Font sizing for the interface and for popups, independently
  • Remote Shortcuts — map spare colour, number, channel and media keys to 26 actions; Player buttons choose what OK and a held OK do in the player, swap channel up/down, and turn number keys off
  • Menu labels — the section names beside the menu icons: off, when focused, or always
  • 26 interface languages, RTL-aware, chosen before anything else on a fresh install
  • Backup & Restore to a single .own file, optionally encrypted, locally or over Wi-Fi
  • Set up from another device — a new box copies everything from the OwnTV device you already have over your own Wi-Fi, offered on the first setup screen rather than buried in the menus
  • In-app updates; memory-safe lists, auto-reconnect and offline detection throughout

📸 Screenshots

Home screen
Home — Continue Watching
Live TV with preview
Live TV — preview playing
TV Guide
TV Guide (EPG)
Settings
Settings

More in extras/screenshots/.


🧱 Tech stack

Area Choice
Language Kotlin 2.4.20 (no kotlin-android plugin)
Build AGP 9.4.0 / Gradle 9.8.2, KSP2 2.3.11, JDK 25
UI Jetpack Compose for TV (androidx.tv:tv-material 1.1.0), Compose BOM 2026.08.00
Media libmpv (FFmpeg) · ExoPlayer/Media3 1.11.1
Database Room 2.8.5 + Paging 3.5.1 + FTS4
DI · Network · Images Koin 4.2.2 · OkHttp 5 · Coil 3.6.0

minSdk 26, targetSdk 36, compileSdk 37, applicationId tv.own.owntv.

Build note: there is no kotlin-android plugin. AGP 9 ships its own Kotlin, but the Compose compiler plugin pulls the Kotlin Gradle plugin up to the kotlin version in gradle/libs.versions.toml — that is what compiles the app, so keep the Compose compiler plugin on exactly that version. KSP versions independently and does not have to match it.

⚙️ How it works

  • Parsing & sync — M3U is line-streamed and Xtream JSON is read with JsonReader, so a huge provider payload is never fully buffered. Refresh is chunked, cancellable and reports progress.
  • Storage — a 27-entity Room schema with FTS4 search; Paging 3 with a bounded size keeps memory flat across 50k-item lists.
  • EPG — XMLTV is stream-parsed (gzip-aware) into a rolling window and pruned.
  • Player — two engines behind one PlaybackEngine interface, with a four-rung fallback ladder. Live promotes the running preview straight to full screen with no reload.
  • DI — Koin modules.

Project layout

This repository is the Android TV app. Everything underneath it — database, sync, parsers, EPG, backup, settings storage, the playback engines and every translated string — is a separate core library, shared with the OwnTV Mobile app for phones and tablets.

OwnTV/  (this repo)
tv.own.owntv/
├── player/      the TV player HUD, surfaces and mini-player
├── ui/          theme + reusable components
├── features/    setup, shell, live, movies, series, search, downloads, epg, profiles, settings
└── di/          Koin modules

OwnTV_Core/  (separate repo, published as tv.own.owntv:core / :player-core)
├── core/        database, network, parsers, Stalker, repository, sync, strings
└── player-core/ libmpv + ExoPlayer engines, fallback ladder, watchdogs, diagnostics

OwnTV_Mobile/  (separate repo, the phone and tablet app on the same core)

Related repositories

  • 📱 OwnTV Mobile — the phone and tablet app, built on the same core.
  • 🧩 OwnTV Core — the shared engine both apps run on.

📚 Docs (extras/)

📥 Installing (Fire TV / Android TV)

Grab the signed APK from the latest release. This link always points at the newest build:

https://github.com/ahXN00/OwnTV/releases/latest/download/OwnTV.apk
  • Fire TV — install Downloader (by AFTVnews), then enter code 4308278. Enable Apps from Unknown Sources if prompted.
  • Android TV / Google TV — Downloader is on Google Play too, so the same code works. Or sideload with Send files to TV, a USB drive, or adb install OwnTV.apk.

Install only from this repository’s Releases. Each release ships two APKs: OwnTV.apk (arm — every real TV box, and what the Downloader code fetches) and OwnTV-x86_64-vX.X.X.apk (emulators and rare Intel boxes).

🛠️ Building & running

Only if you want to build from source — otherwise just install the APK.

Half the app lives in the separate OwnTV_Core repository; Gradle downloads it from OwnTV’s public Maven repository by itself — no account or token needed.

  1. Get the code — git clone https://github.com/ahXN00/OwnTV.git (or download the ZIP).
  2. Open it in Android Studio and let Gradle sync.
  3. Pick the build variant — standard for real devices and arm emulators, x86_64 for x86_64 emulators. This matters: the native player only loads on a matching ABI.
  4. Run ▶. Minimum Android 8.0 / API 26.

Command line: ./gradlew assembleDebug (gradlew.bat on Windows). The APK lands in app/build/outputs/apk/.

Tested on a real TCL Google TV and the Android Studio emulator (Android TV and Google TV images).

🤝 Contributing

Contributions, bug reports and ideas are welcome — open an issue or a pull request. Please keep the project’s player-only, bring-your-own-source positioning and match the existing code style.

Help translate OwnTV

If your language is already available, contribute interface translations across OwnTV’s six Android resource components on Hosted Weblate. If it is not listed, open a language request ticket first. A maintainer will review the request, register the locale, and prepare its base translation files on Hosted Weblate. Once the language appears on Hosted Weblate, you can start translating it there. The strings themselves live in OwnTV’s core library repository, together with the language contributor guide covering identifiers, validation, and promotion policy.

🙏 Credits

Weblate

OwnTV speaks 26 languages because people translate it on Weblate, which hosts the project free of charge for libre software. Thank you to Weblate and to every translator who has given the app their language.

TMDB

Movie & series metadata and trailers are provided by TMDB. This product uses the TMDB API but is not endorsed or certified by TMDB.

OpenSubtitles

Subtitle search & download is powered by OpenSubtitles.com. This product uses the OpenSubtitles API but is not endorsed or certified by OpenSubtitles. You sign in with your own OpenSubtitles account and are subject to their terms and download quotas.

🎨 Brand

The lowercase owntv wordmark was designed for OwnTV by @m3th0d93 in issue #227.

▶️ Playback engines

  • mpv (via libmpv, built on FFmpeg) — the default engine, for the widest IPTV/codec, audio and HDR support.
  • Media3 / ExoPlayer — the fast-start engine for Live TV preview and HLS.

Which of the two starts a stream is yours to set, separately for Live TV and for Movies & Series (Settings → Player): either order, or one engine only with the automatic handover turned off.

🧩 Built with

Jetpack Compose for TV · Room · Koin · OkHttp · Coil · ZXing — and the wider Kotlin / AndroidX open-source ecosystem. Thank you to all their maintainers. See each project for its own license.

OwnTV is a media player only. It ships with no channels, playlists, subscriptions, or content, and does not endorse or facilitate access to unauthorized streams. Users are solely responsible for the sources they add and for complying with the laws and rights that apply to them.

📄 License

Released under the GNU General Public License v3.0 (GPLv3) — see LICENSE.

In short: you’re free to use, study, modify, and redistribute OwnTV, including commercially — but any redistributed version (including forks and commercial products built on it) must also be licensed under GPLv3 and its source made available.


OwnTV is an open-source, player-only project, built with the help of AI.

评论

暂无评论