feat(browser): FFmpeg video API, subtitles, HLS variants, and PiP#26
feat(browser): FFmpeg video API, subtitles, HLS variants, and PiP#26
Conversation
Implement Phase 1 video from the roadmap using ffmpeg-next for demux/decode and libswscale to RGBA for the canvas. Host (oxide-browser): - Add VideoPlayer with incremental decode, seek, single send_eof at true EOF, post-packet drain, and decoder_eof_sent to avoid repeated EOF errors and choppy playback. - Register imports: video_load/detect_format/load_url, playback, seek, position, duration, video_render, volume/loop, PiP, subtitle_load_srt/vtt/clear, HLS variant count/url/open_variant, last URL content type. - Extend HostState with video, video_pip_frame, video_pip_serial; wire video_render_at for canvas + optional caption text + PiP texture refresh. - Add video_format (sniff + Accept), subtitle (SRT/WebVTT), and egui floating PiP window. - Dependencies: ffmpeg-next, tempfile, url. SDK: - Expose VideoFormat and full video/subtitle wrappers for guests. Example: - examples/video-player: sample Big Buck Bunny MP4, loop, PiP, pause/resume. Tooling: - CI and release workflows: pkg-config and libav dev packages on Ubuntu. - CONTRIBUTING: FFmpeg library prerequisites. - ROADMAP: mark video subsection complete (embedded audio mixing noted as follow-up). Made-with: Cursor
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 13 minutes and 35 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdded FFmpeg-backed video playback, HLS variant support, subtitle (SRT/VTT) parsing, picture-in-picture rendering, example video-player crate, workspace/dependency updates, SDK host APIs for video control/rendering, and CI/docs prerequisite additions for FFmpeg tooling. Changes
Sequence Diagram(s)sequenceDiagram
participant Guest as Guest App (video-player)
participant SDK as oxide-sdk
participant Host as oxide-browser (capabilities)
participant State as VideoPlaybackState
participant FFmpeg as FFmpeg Backend (video.rs)
participant Canvas as Canvas State
Guest->>SDK: video_load_url(url)
SDK->>Host: api_video_load_url(url)
Host->>State: open_url(url)
State->>FFmpeg: VideoPlayer::open_url(url)
FFmpeg-->>State: VideoPlayer (duration, streams)
Guest->>SDK: video_play()
SDK->>Host: api_video_play()
Host->>State: play()
Guest->>SDK: video_render(x,y,w,h)
SDK->>Host: api_video_render(x,y,w,h)
Host->>State: current_position_ms()
Host->>FFmpeg: decode_frame_at(position_ms)
FFmpeg-->>Host: RGBA frame
Host->>Canvas: append DrawCommand::Image(frame)
note over Canvas: Frame available for egui draw
alt PiP enabled
Host->>Host: update video_pip_frame, increment video_pip_serial
Host->>UI: render_video_pip detects serial change
UI->>UI: convert RGBA -> egui ColorImage
UI->>UI: display floating window with texture
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Implement Phase 1 video from the roadmap using ffmpeg-next for demux/decode and libswscale to RGBA for the canvas.
Host (oxide-browser):
SDK:
Example:
Tooling:
Made-with: Cursor
Summary by CodeRabbit
New Features
Documentation