[feature] Add Stream API for capturing video frames from WebRTC MediaStreamTrack
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- audio-video-rtc, mobile
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Dart
- Star
- 421
- Fork
- 260
- Merge trung bình
- 3 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của livekit/client-sdk-flutter
-
`jwtPayload.roomConfiguration` returns null fields for tokens from LiveKit server SDKsCó thể đã có người làm @RaphaelFakhri đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
livekit/client-sdk-flutter#1243 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 57/100
livekit/client-sdk-flutter#1245 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
livekit/client-sdk-flutter#1227 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Inbound data packets never delivered while media flows normally (2.13.0, LiveKit Cloud 1.13.7)Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
livekit/client-sdk-flutter#1221 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
livekit/client-sdk-flutter#1219 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của livekit/client-sdk-flutter
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good-first-issue P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
flutter/dart-intellij-third-party#758 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: Incorrect location coordinates on logged Sound Meter dataCó thể đã có người làm @Jashan32 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/archive bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
DarkFlippers/qUnleashed#374 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:in-progress agent:ready feature P2 · 中 区域: 悬浮窗
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
ASDW51/DanmuFloat#178 ·
Maintainer thường phản hồi trong vòng 1 ngày