Using VideoDecoder for security camera app leads to codec reclaimation
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
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- audio-video-rtc, web-dev
Hướng nghiên cứu
Bắt đầu với phần thu hồi tài nguyên của WebCodecs và ví dụ samples/video-decode-display, sau đó so sánh hành vi được báo cáo trong các tab chạy nền với các yêu cầu của VideoDecoder. Để được xem là hoàn tất, cần có một giải pháp được thống nhất ở cấp đặc tả nhằm duy trì khả năng sử dụng các bộ giải mã trong nền mà không cần mã hóa âm thanh hoặc video, thay vì một thay đổi mã có phạm vi hẹp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
As suggested in #121, I'm opening a new issue to discuss my use case.
I have just started using WebCodecs for a security camera application, and my VideoDecoders are getting reclaimed due to inactivity if the tab stays in the background for too long.
Use Case
The app is fairly simple, I spawn a single Worker which makes a WebSocket connection to the server. The server makes an RTSP connection to each of the configured cameras and then sends frames to the client through the WebSocket. The worker then uses VideoDecoders to draw the frames on canvases (essentially following this sample). It works really well until the I put the tab in the background. After a short while I get QuotaExceeded errors due to the "inactive" codecs being reclaimed.
I understand from these docs that the only way to keep an active VideoDecoder in the background from being reclaimed is to have an active VideoEncoder or an active AudioEncoder on the same global object. The problem for my use case is that these are security camera feeds that don't have audio (even if they did, I would only be decoding it).
You might ask what's the point of having a security camera app in a background tab? That's a good question. In common usage, you would expect to keep the app active all the time to view the video feeds. That said, in testing I have found that I often need to switch to another browser tab, and I imagine that will be the case at least some of the time in production.
Workarounds
Of course, there are a few workarounds I can implement. The simplest thing will be to watch for these errors and then attempt to restart the video streams when I run into them. The next idea is to run a dummy AudioEncoder of some kind in the Worker just to keep the VideoDecoders alive. But, it would be nice if there was a less hacky solution.
Solutions
I'm not sure what the best solution would be here. Maybe we can ask for user permission to run background video like we do for wake locks, location, etc.?
Also, it was suggested that I file a bug with Chromium since that's where I'm seeing this behavior. I'm happy to do that, but since the issue seems to be with the spec itself, I thought it would make sense to discuss it here first.
- Ngôn ngữ chính
- HTML
- Star
- 1.3k
- Fork
- 192
- Merge trung bình
- 14 giờ 40 phút
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 w3c/webcodecs
-
privacy-needs-resolution
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
editorial
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
TPAC2026
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
Maintainer thường phản hồi trong vòng 1 ngày
-
VideoFrame.copyTo is manipulating JS objects in a background queueCó thể đã có người làm @Djuffin đã nhận 5 ngày trước. Đang mởCR Blocking PR exists
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
w3c/webcodecs#955 · 8 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ColorSpace override is not well definedCó thể đã có người làm @dalecurtis đã nhận 38 ngày trước. Đang mởagenda CR Blocking PR exists
w3c/webcodecs#940 · 25 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của w3c/webcodecs
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
wilbowes/EchoMuse#869 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
area: editor bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Sendspin/sendspin-python-cli#291 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
fix(audio): deduplicate getSourceTrackIdFromPath and fix companion track misclassificationCó thể đã có người làm @SomSamantray đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
webadderallorg/Recordly#1124 ·
Maintainer thường phản hồi trong vòng 1 ngày