[feature] Add Stream API for capturing video frames from WebRTC MediaStreamTrack
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
調査の方向性
Start by reading the existing Timer-based captureFrame() usage and the RemoteRehabilitationRoomState reference in the issue, then investigate how this SDK exposes native WebRTC frame callbacks on each platform. Define what the stream emits and how frames are managed across platforms; done means a stream delivers frames at the native rate without Timer polling. The issue names no test files.
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
Currently, when trying to analyze video frames from WebRTC MediaStreamTrack in real-time (e.g., for ML processing), we need to use Timer to periodically capture frames using captureFrame(). This approach has several issues:
- High CPU/Memory usage
- UI stuttering
- Potential frame drops
- Inconsistent frame rate
Describe the solution you'd like
Add a new Stream-based API to capture video frames from MediaStreamTrack that:
- Provides frames as a Stream at the native frame rate
- Integrates directly with the native WebRTC frame callback system
- Has an API similar to:
Stream<VideoFrame> getVideoFrameStream() async {
// Implementation that hooks into native frame callbacks
}
This would allow more efficient frame processing without Timer polling.
Describe alternatives you've considered
- Current Timer-based approach with
captureFrame() - Custom native implementation per platform
- Using platform channels with event streams
The Stream API would be the most elegant and performant solution.
Additional context
Looking at the current implementation in the codebase:
- The current implementation uses Timer-based approach:
captureImageTimer = Timer.periodic(
const Duration(milliseconds: 200),
() async {
if (!mounted) return;
await caputureImage(videoTrack);
},
);
Future<Image> captureImage({
required VideoTrack videoTrack,
}) async {
try {
final mediaStreamTrack = videoTrack.mediaStreamTrack;
final imageByteBuffer = await mediaStreamTrack.captureFrame();
final imageBytes = imageByteBuffer.asUint8List();
final image = await compute(
decodeImage,
imageBytes,
);
return image;
}
- The proposed Stream API could be integrated with the existing
RemoteRehabilitationRoomStateclass, replacing the current Timer implementation:
Stream<VideoFrame> getVideoFrameStream() async {
// Implementation using native frame callbacks
}
- Benefits of this approach:
- More efficient resource usage
- Better frame timing accuracy
- Native integration with WebRTC frame callbacks
- Reduced CPU/Memory overhead
- Smoother integration with ML processing pipeline
/cc @cloudwebrtc
- 主要言語
- Dart
- スター
- 421
- フォーク
- 260
- 平均マージ
- 3日 9時間
- マージ済み PR(30日)
- 11
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
livekit/client-sdk-flutter のほかの issue
-
`jwtPayload.roomConfiguration` returns null fields for tokens from LiveKit server SDKs対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
livekit/client-sdk-flutter#1243 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
livekit/client-sdk-flutter#1227 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
livekit/client-sdk-flutter#1221 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
livekit/client-sdk-flutter#1219 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
iOS: ADM unavailable when a second Flutter engine replaces flutter_webrtc's sharedSingleton対応中かも @hiroshihorie が 32 日前に担当しました。 オープン
livekit/client-sdk-flutter#1206 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
livekit/client-sdk-flutter の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
jhomlala/betterplayer#1609 ·
メンテナーはふだん 1 日以内に返信
-
[FR] 缓存键放置在外面オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bggRGjQaUbCoE/PiliPlus#3310 ·
メンテナーはふだん 1 日以内に返信
-
package:code_builder type-bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
type:feature
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
[material_ui] CalendarDatePicker day numbers are cut off with large text scale on narrow screensオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信