GNU General Public License v3.0

技术解读

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

FadCam 深度剖析:一台把“录制权”还给用户的 Android 多媒体工作站

项目背景与痛点

Android 上的录像这件事,长期处在一个尴尬的夹缝里。系统相机足够稳定,但能力被刻意收窄:不能后台录、不能息屏录、不能同时推流,更别提远程控制。第三方录像 App 则走向另一个极端——开屏广告、录制水印、导出限速,把“后台录像”“长时间录制”“4K”这类本该是基础能力的东西拆成付费点。用户真正想要的,其实只是一段干净、完整、不被打断的视频文件。

FadCam 的定位正是这个缺口:开源、零广告、零追踪、全功能不设墙。它的价值不在于“又一个录像 App”,而在于把 Android 平台本身被封印的媒体能力(Camera2、MediaProjection、MediaCodec、前台服务)重新组装成一个可用的产品形态。对开发者而言,它更像一份“如何在现代 Android 权限模型下把长时间录制跑通”的参考实现。

核心技术揭秘

理解 FadCam 的关键,是先理解 Android 的两道闸门:后台执行限制和后台传感器访问限制。Android 8.0 起后台服务被大幅收紧,Android 10 起后台进程无法访问摄像头与麦克风,Android 14 进一步要求前台服务显式声明 camera、microphone、mediaProjection 类型,并且必须在应用可见状态下启动。这意味着“后台录像”在技术上根本不是一个录制问题,而是一个进程存活 + 权限合规问题。

FadCam 的整体数据流大致如下:

graph TD A[用户界面层<br/>录像 / 录屏 / 直播入口] --> B[录制协调器] B --> C[前台服务与常驻通知] C --> D{"录制模式"} D -->|"摄像头录像"| E[Camera2 采集管线] D -->|"屏幕录制"| F[MediaProjection 捕获管线] E --> H[MediaCodec 硬件编码] F --> H H --> I[MediaMuxer 封装 MP4] I --> K[MediaStore / SAF 落盘] H --> N[推流队列] N --> J[RTMP 服务端] L[远程控制模块<br/>嵌入式 HTTP 服务] -->|"配置下发"| B B --> M[唤醒锁与电量策略]

几处值得细看的设计:

其一,Surface 直通,拒绝 CPU 搬运。 Camera2 与 MediaProjection 都能直接向 MediaCodec 的输入 Surface 投递帧,编码器在 GPU/DSP 侧完成 NV21→H.264 的转换,全程零拷贝。这是长时间录制不烫手、不掉帧的前提;如果用 ImageReader 取 YUV 再喂编码器,中端机上十几分钟就会热降频。

其二,编码器复用与输出分叉。 录屏和摄像头录制共用同一条编码输出,直播则在编码之后分叉出一条推流队列。这种“编码一次、消费多次”的管线设计,避免了同时录制+直播时跑两份编码器导致的算力翻倍。

其三,时长与同步的工程细节。 长时间录制真正的坑在 MediaMuxer:PTS 必须单调递增,音视频轨要交错写入,分辨率或方向切换时不能直接往同一个 muxer 里塞,得切段或重建。变速录制本质上是对 PTS 做时间轴缩放,而音轨必须同步拉伸,否则音画会持续漂移。

其四,把控制面做成 Web。 远程控制模块在设备内起一个轻量 HTTP/WebSocket 服务,同一局域网下的浏览器即可预览与操作,设备端只负责状态机。这比自建配对的 App 端省事得多,代价是必须处理鉴权(配对令牌)与前台服务常驻。

功能亮点与差异

  • 真正的后台/息屏录制:靠前台服务 + 唤醒锁硬扛,而不是靠“保持屏幕常亮”这种伪方案。
  • 录屏与摄像头录制同源:同一套编码管线支撑多种输入源,行为一致、文件格式统一。
  • 内置直播推流:不需要额外装推流器,录制与推流可并行。
  • 远程控制:手机架在远处,浏览器里调参数、看画面,这在小车记录、宠物监控、会议固定机位场景里非常实用。
  • 无广告、无遥测:所有数据留在本地,符合取证类场景对“链路可解释”的要求。

应用场景与落地建议

适合的场景很明确:旧手机改行车记录仪/监控机、会议与讲座录制、教学演示录屏、需要长时间连续取证或访谈记录。

生产使用前务必注意几点:一是电量与热管理,长时间硬件编码对散热是硬约束,建议限制分辨率与码率,并加入电池温度熔断;二是OEM 后台策略,国产 ROM 的省电策略会直接杀掉前台服务,必须引导用户加入白名单;三是存储策略,走 MediaStore 分区存储而非裸路径,并做分段写入以防录制中断导致文件损坏;四是合规,后台录制与远程预览在多数司法辖区涉及知情同意,产品化时应在 UI 上做显式提示。

综合评价

优点:架构思路清晰,把 Android 媒体栈的“正确用法”落到了实处;功能覆盖广而不散;开源带来的可审计性,是闭源录像 App 无法提供的信任基础。

缺点:依赖前台服务的常驻模型,在激进省电的 ROM 上天然脆弱;长时间录制的稳定性高度依赖设备散热与厂商编码器实现,跨机型一致性难以保证;远程控制模块把攻击面从“本地”扩展到“局域网”,鉴权与配对机制若有疏漏,风险不小。

一句话总结:FadCam 不是一个“更好用的录像 App”,而是一份把被平台和商业模型联手锁住的录制能力重新交还给用户的工程样本。想学 Android 媒体管线的人该读它,想长期用它的人该先摸清自己手机的脾气。

关于

GitHub 原始描述(英文)

Open-source, ad-free Android multimedia recorder with background video recording, screen recording, live streaming, and remote camera control

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
3395
价值分
1800
活跃状态
活跃

语言占比

CSS
HTML
Java
JavaScript
Python
Shell
TypeScript

README


Tip 提示

This project is part of the FadSec Lab suite.
Discover our focus on ad-free, privacy-first applications and stay updated on future releases!

Note 注意

Unlock FadCam Pro with lifetime access: Visit the Shop
FadCam for Desktop is planned!


>_ FadCam

Privacy-focused Android multimedia suite: background video recording, dashcam, screen recorder, live streaming & remote control - ad-free & open-source.

anonfaded%2FFadCam | Trendshift

GitHub all releases Downloads (F-Droid) SourceForge Downloads

badge

ko-fi badge Support me on Patreon


Scan to visit Patreon shop:
Scan to visit Patreon shop

Discord




Get it on IoD Download on the App Store Get it on F-Droid
⭐ New app from FadSec-Lab suite:🎉
Also, check out our new Windows app! Visit here: FadCrypt

Github Stats


Expand Table of Contents

>_ Purpose

FadCam is developed with the goal of providing a powerful, privacy-focused multimedia suite for Android devices. This comprehensive app includes dashcam functionality, screen recording with annotations, live streaming over local networks, and remote camera control — all designed for ethical use only.

Ethical Use Cases Include:

  • Personal Security: Use as a dashcam while driving, CCTV at home with remote monitoring, or recording proof in situations where needed for yourself
  • Content Creation: Screen recording with professional annotation tools
  • Remote Monitoring: Live streaming and remote control for security purposes
  • Research and Documentation: Multi-purpose recording tools for various needs

[!Caution] Misuse Disclaimer:
The developers of FadCam do not condone or support any unethical or illegal use of this software. Misuse, such as unauthorized surveillance or invasion of privacy, is strictly against our guidelines. The authors are not responsible for any misuse of the application.

>_ 📱 Screenshots




Expand Featured Content

>_ Articles and Listings

>_ ⬇️ Download

Download the latest apk file directly from the releases page.

Get it on GitHub

Or:


Get it on F-Droid Get it on F-Droid Get it on Amazon appstore

>_ Features:

🎬 FadRec Screen Recorder
  • Full-featured screen recording with annotation tools (pen, eraser, text, shapes)
  • Multi-layer editing with version control and unlimited undo/redo
  • Automatic project saving with full recovery options
  • Sidebar overlay menu for quick-access recording controls
🏠 FadCam Remote
  • Live stream camera feed over local network with beautiful web interface
  • Remote control features: start/stop recording, adjust settings, toggle torch
  • Real-time monitoring: battery level, storage status, recording status
  • Perfect for security monitoring and remote access
📸 Dashcam & Background Recording
  • Background video recording with screen off capability
  • Custom hybrid MP4 output — FadCam’s recording engine is built on a custom-patched version of the Media3 library that streams recordings as a fragmented MP4 while recording (zero corruption risk, instant recovery), then finalizes them into a universally playable MP4 on stop. This hybrid format is specific to FadCam and not part of the stock Media3 library
  • Auto-repair of interrupted recordings — if the process is killed mid-recording (aggressive OEM background management, crashes, battery optimization), the file is automatically detected and repaired on the next app launch
  • Repair notifications — a banner in the Records tab tells you when an interrupted recording was successfully recovered
  • Auto-splitting large files with customizable size limits
  • Wide-angle camera detection and support
🎥 Video & Audio Controls
  • Multiple resolutions and 60/90fps support
  • Orientation control and quality options
  • Audio recording with customizable bitrate and sample rate
  • Custom watermark text overlays
  • Geotagging with location data embedding
🎨 User Interface & Experience
  • Clean Material Design with bottom sheet actions
  • 7+ app themes including AMOLED, Light, and System themes
  • 15+ customizable app icons
  • In-app “What’s New” page for feature discovery
  • Standalone beta installation without conflicts
📁 File Management & Playback
  • Enhanced thumbnails with index, duration, and file size
  • Sorting & filtering by date, size, and more
  • Trash bin with restore and auto-delete options
  • Inbuilt video player using ExoPlayer
  • Video info view with resolution, size, and duration details
  • Direct video renaming in-app
🔧 Advanced Features
  • Storage indicator with real-time space and estimated record time
  • Clock widget with customizable date/time and colors
  • Custom notification presets and descriptions
  • Audio input source selection (phone mic, wired/Bluetooth)
  • Dynamic watermarks with timestamp, logo, and GPS options
  • App Shortcuts: Three quick actions are available (Start Recording, Stop Recording, Toggle Torch). These shortcuts can be triggered without opening the app and can be mapped with key-mapping apps (e.g. MacroDroid) to hardware buttons (like volume buttons) for convenient control.
  • Quick Settings Tile: Adds a notification shade Quick Settings tile. Single-tap to start/stop recording, double-tap to switch between Front/Rear camera (even live during recording), with secure keyguard lockscreen authentication.
🌐 Localization & Privacy
  • Multiple language support (Italian, and more coming)
  • 100% ad-free and open-source
  • No data collection or tracking
  • Hide from recent apps for privacy
  • Ethical use guidelines and disclaimer

>_ Upcoming Features:

  • Scheduled Recording: Automatically start/stop recordings at set times.
  • In-App Video Editor: Quick trim/edit with Faditor Mini (coming soon).
  • Enhanced Remote Features: Additional remote control capabilities.
🛡️ How Recording Reliability Works

FadCam writes recordings in a hybrid MP4 format that balances crash safety with universal compatibility. This format is implemented through a custom patch of the Media3 library — the hybrid finalization and self-healing repair described below are FadCam-specific features, not part of the stock library:

  1. While recording, the file is streamed as a fragmented MP4 — data is appended in small fragments with the metadata kept at the front. If the app or process dies at any moment, nothing already written is ever lost or corrupted.
  2. On a clean stop, the file is finalized into a standard MP4 (a single moov metadata block + one mdat container) that plays everywhere — gallery, WhatsApp, Instagram, VLC, PC players.
  3. If the process is killed mid-recording (background kill by the OS, crash, battery optimization), the file is left as a valid fragmented MP4. On the next app launch, FadCam’s self-healing scan:
    • Detects the interrupted file automatically
    • Rebuilds the metadata directly from the file’s fragments
    • Converts it into a playable standard MP4 — often byte-identical to a clean stop
    • Shows a repair banner in the Records tab so you know the recording was recovered

The scan is database-driven and runs once per file — it only ever examines recordings that were never verified as finalized, so it adds no overhead to normal use. Files that cannot be recovered are left untouched and marked so they are never retried.

This means no more lost recordings from background kills — the worst case is a recovered file, not a corrupted one.

>_ Join Community

Join our Discord server to share ideas, seek help, or connect with other users. Your feedback and contributions are welcome!

Discord

>_ Support & Shop

Buy FadCam Pro (lifetime access) from my Patreon shop. Your purchases help fund development and maintenance.

Support me on Patreon


Scan to visit Patreon shop:
Scan to visit Patreon shop

>_ Contributions

We welcome any contributions to improve this project! Whether it’s bug fixes or new features, your help is appreciated.

>_ How to Contribute

  1. Open an Issue First: Before starting any work, please open an issue to discuss your proposed changes and get approval.
  2. Fork the Repo: Fork the repository to make your changes.
  3. Submit a PR: Create a pull request with a clear description of your changes.

We look forward to your contributions!

>_ 🙌 Contributions & Credits

Star History

Star History Chart

>_ License

GNU General Public License v3.0

评论

暂无评论