搜索插件、代码仓与 APP 分类

插件详情v3.1.1

rtmp_broadcaster

Flutter 相机插件的扩展,可在 Android 和 iOS 设备上实现实时视频流传输(RTMP)。

AndroidiOS
近 30 天下载
497
喜欢数
40
Pub 分数
140

安装插件

flutter pub add rtmp_broadcaster

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

rtmp_broadcaster 包扩展了 Flutter 的相机插件,使 Android 和 iOS 设备能够通过 RTMP 实现实时视频流。它允许开发者直接从移动设备向 RTMP 服务器广播直播视频,非常适合用于现场活动、视频会议或社交媒体直播。该包与现有的相机功能无缝集成,并支持常见的 RTMP 配置。该包以性能和简单性为设计目标,提供了一个简洁的 API 来启动和停止流。

适合场景

  • 实时事件直播
  • 社交媒体直播
  • 远程视频会议
  • 物联网设备视频流
  • 实时监控

主要特点

  • RTMP 流媒体支持
  • Android 和 iOS 兼容性
  • 相机集成
  • 简单的启动/停止 API
  • 低延迟流媒体

适合对象

  • 开发实时视频应用的开发者
  • 需要RTMP输出的移动应用开发者
  • 实时通信平台
  • 使用移动流媒体的内容创作者

使用建议

  • 需要设置RTMP服务器
  • 网络稳定性影响流媒体质量
  • 仅限 Android 和 iOS
  • 可能需要额外权限
  • 依赖于底层相机插件

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Flutter RTMP broadcaster

codecov Dart CI Publish Stale

[!IMPORTANT] Development of version 3.0 is being restarted. Expect breaking changes to the API and Android/iOS build configuration while this work is in progress.

This plugin extends the Flutter camera plugin with RTMP streaming support for Android and iOS. Web is not supported.

It follows the same API structure as the camera plugin and adds a startStreaming(url) method to initiate real-time streaming to an RTMP endpoint.

Underlying implementation:

Features

  • Live camera preview embedded in a widget
  • Snapshot capture to file
  • Video recording
  • Direct access to image streams from Dart

Usage

The controller extends the camera plugin's API with the following methods:

Function Description
startVideoStreaming(String url, {int bitrate = 1200 * 1024, bool? androidUseOpenGL}) Starts streaming to an RTMP endpoint
startVideoRecordingAndStreaming(String filePath, String url, {int bitrate = 1200 * 1024, bool? androidUseOpenGL}) Starts streaming to an RTMP endpoint while simultaneously recording to a local file
pauseVideoStreaming() Pauses the active stream
resumeVideoStreaming() Resumes a paused stream
stopEverything() Stops any active streaming and recording

Getting started

iOS

Add the following keys to ios/Runner/Info.plist:

<key>NSCameraUsageDescription</key>
<string>App requires access to the camera for live streaming feature.</string>
<key>NSMicrophoneUsageDescription</key>
<string>App requires access to the microphone for live streaming feature.</string>
Android

Set minSdkVersion to 21 or higher in android/app/build.gradle.

Example

The example app demonstrates camera preview, snapshot capture, video recording, and RTMP streaming. Clone the repository and run the app on an Android or iOS device to try it.

A local RTMP test server is available under server/, set up via Docker Compose, for testing without a public endpoint.

Troubleshooting & issues

Report bugs or unexpected behavior via GitHub issues. Availability for support is limited; for prioritized or paid support, contact [info@emiliodallatorre.it](mailto:info@emiliodallatorre.it).

Contributing

  1. Fork the repository and create a branch for your change
  2. Make the change
  3. Ensure the code is formatted and tested
  4. Submit a pull request describing the change

Support development

If this plugin is useful to you, consider supporting its development via Buy Me a Coffee.

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目

暂无相关数据。