Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[feature] Add Stream API for capturing video frames from WebRTC MediaStreamTrack

オープン
#670 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
dart, flutter

調査の方向性

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:
  1. Provides frames as a Stream at the native frame rate
  2. Integrates directly with the native WebRTC frame callback system
  3. 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

  1. Current Timer-based approach with captureFrame()
  2. Custom native implementation per platform
  3. 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:

  1. 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;
  }
  1. The proposed Stream API could be integrated with the existing RemoteRehabilitationRoomState class, replacing the current Timer implementation:
Stream<VideoFrame> getVideoFrameStream() async {
// Implementation using native frame callbacks
}
  1. 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

livekit/client-sdk-flutter のほかの issue

livekit/client-sdk-flutter の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。