Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3,093 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KanTV

KanTV ("Kan", meaning "watch" in English and "看" in Chinese), an open source project focusing on studying and practicing on-device AI technology in real scenarios (such as performing online-TV playback, realtime transcription, and online-TV recording at the same time) on Android phones:

  • Watch online TV and local media using a customized FFmpeg 6.1. This project is derived from the original ijkplayer (that project has stopped maintenance since 2021), with many enhancements and new features. Source code of the customized FFmpeg 6.1 can be found in external/ffmpeg according to FFmpeg's license. Source code of all FFmpeg 6.1's dependent libraries can be found in external/ffmpeg-deps .

  • Watch online TV using a customized Google ExoPlayer 2.15.1. Source code of the customized ExoPlayer 2.15.1 can be found in android/kantvplayer-exo2 .

  • Record online TV to a local file on the phone.

  • 2D graphic performance benchmark.

  • AI subtitle (real-time English subtitle for English online-TV (aka OTT TV) via the great & excellent & amazing whisper.cpp ).

  • Well-maintained turn-key / self-contained workbench for AI experts/researchers who focus on high-value on-device AI R&D activities on Android. Some on-device AI R&D activities (AI algorithm validation, AI model validation, and performance benchmark with ASR/LLM/MTMD (multimodal) on Android) can be done via this project easily.

  • Well-maintained turn-key / self-contained workbench for AI beginners to learn on-device AI technology on Android.

  • Built-in AI models are supported and run entirely offline (no Internet required). These supported AI models can be downloaded in the Android APK directly without manual preparation. APK users can compare the real experience of these AI models on the Android phone. Developers can add other AI models manually in the source code KANTVAIModelMgr.java.

    Model Type Capability Source
    ggml-tiny.en-q8_0 ASR speech-to-text whisper.cpp
    Qwen1.5-1.8B LLM text-only Alibaba
    Qwen2.5-3B LLM text-only Alibaba
    Gemma3-4B LLM text + image (MTMD) Google
    Gemma-4-E2B LLM text-only (default) Google
    SmolVLM2-256M LLM text + image (realtime-video-recognition) Huggingface
    Qwen2.5-Omni-3B LLM text + audio (MTMD) Alibaba
  • The JZ's ggml-hexagon used in this project is probably the first open-source reference implementation of a specific llama.cpp backend for Qualcomm Hexagon NPU on Android phones. The backend type (Hexagon cDSP vs. generic ggml) is decided at build time, and the DSP-side thread count is automatically clamped based on the target SoC (e.g., 6 threads on Snapdragon 8Elite, 4 threads on Snapdragon 8Gen3). Its PP (prompt processing) and TG (token generation) performance comprehensively surpasses Qualcomm's official implementation on Snapdragon 8Elite (aka 8Gen4); benchmark comparisons can be found here.

Software architecture of KanTV Android

kantv-arch

Building the project

Run Android APK on Android phone

  • Android 8.0 (2017.08) --- Android 15 (2024.10) and higher versions with ANY mainstream arm64 mobile SoC.
  • An Android smartphone equipped with ANY mainstream high-end mobile SoC is highly recommended for the realtime AI-subtitle feature, otherwise unexpected behavior may occur.
  • An Android smartphone equipped with one of the below Qualcomm mobile SoCs is required for verifying/running the ggml-hexagon backend on Android phones:
    Snapdragon 8 Gen 2
    Snapdragon 8 Gen 3
    Snapdragon 8 Elite (aka 8 Gen 4)
    Snapdragon 8 Elite Gen 5 (aka 8 Gen 5)

Screenshots

Here is a short video to demonstrate realtime AI subtitle by running the great & excellent & amazing whisper.cpp on an Android phone equipped with Qualcomm Snapdragon 8Gen3 mobile SoC - fully offline, on-device.

realtime-subtitle-by-whispercpp-demo-on-xiaomi14-finetune-20240324.mp4

A screenshot to demonstrate realtime-video-recognition via MTMD from llama.cpp + a lightweight multimodal model SmolVLM2-256M from Huggingface on an Android phone equipped with Qualcomm Snapdragon 8Elite mobile SoC - fully offline, on-device.

Image


Screenshot_2026-07-27-20-43-06-88_d67cb27b45d33330ede3b063fe7603d2 Screenshot_2026-07-27-20-53-28-91

Docs

Contribution

Reporting issues on Android phones equipped with mainstream mobile SoCs or submitting PRs to this project is greatly appreciated.

I use GitHub issues for tracking feature requests and issue reports, please see how to submit an issue in this project.

Special Acknowledgement

About

workbench for learning and practicing on-device AI technologies under real-world scenarios on Android smartphones with online TV. powered by llama.cpp + whisper.cpp + FFmpeg + opencv-mobile

Topics

Resources

Stars

196 stars

Watchers

6 watching

Forks

Releases

Used by

Contributors

Languages