charlesding2024
Joined 1 year ago
Joined 1 year ago
I previously shared my frame extraction tool (videotojpg.com) here about a month ago. The feedback was great, but it taught me that purely WASM-based solutions often hit a performance wall with larger files.
So for VideoCompressors.com, I wanted to see how close we could get to "native performance" in a browser.
The Architecture (Dual-Engine):
1.The "Fast Lane" (WebCodecs + GPU): The app first attempts to use the WebCodecs API to access your device's hardware encoder.
The Challenge: WebCodecs only outputs raw encoded chunks. The hardest part was implementing the client-side muxing (remuxing these chunks back into a valid MP4 container) without breaking synchronization.
The Result: When active, it's ~10x faster than WASM and keeps your laptop cool.
2.The "Safety Net" (FFmpeg WASM): Since WebCodecs support is still fragmented (looking at you, older Safari versions), I implemented a seamless fallback to FFmpeg (WASM). It detects if hardware encoding fails or if the format isn't supported, and switches engines automatically.
Privacy: Zero server uploads. I'm a strong believer that simple utilities shouldn't require cloud processing.
Request for Feedback: I'm currently tuning the bitrate control for the GPU engine. If you try it out, I'd love to hear if the quality-to-size ratio feels right compared to desktop tools like Handbrake!
I built Video to JPG because extracting the perfect frame from a video usually requires scrubbing through timelines manually, which is tedious.
This tool runs entirely in the browser. It uses a hybrid approach: prioritizing the native Canvas API for performance, and falling back to FFmpeg (WASM) for formats that browsers don't natively support (like AVI or MOV). It also includes a blur detection feature to automatically select the sharpest images.
Key features:
Smart Selection: Automatically detects and filters out blurry frames.
100% Private: All processing happens client-side; no video is uploaded.
Format Support: Handles MP4, MOV, AVI, and other common formats.
I'd love to hear your feedback on the detection accuracy!
A technical question on the v6 offline support (Phi-2): Does the CLI keep the model loaded in RAM in the background (daemon mode), or does it have to load the weights from disk every time an error occurs? I'm curious about the latency trade-off for that 'instant fix' feel.
Also, for the mobile app, definitely look into Direct Creator Uploads. You can generate a signed URL on your backend and let the phone upload straight to Cloudflare. It saves a ton of headache handling bandwidth on your own servers.
Merry Christmas!
For your use case (40s clips, 10-50K plays/day), Cloudflare Stream's per-minute pricing model could be significantly cheaper than GCP, especially as you scale. Their ABR quality is quite good for 1080p/720p - I haven't noticed quality issues in practice.
One consideration: Cloudflare Stream has a 30s minimum charge per video, so for 40s clips you're paying for 60s. This might eat into the cost savings vs GCP.
Backblaze B2 + Cloudflare has free egress which is huge, but make sure you're using the Bandwidth Alliance properly to avoid surprise charges.
Have you considered keeping source files in B2 and only using Cloudflare Stream for delivery? That hybrid approach might give you more flexibility.
Also, does the 2.1s generation time include queue wait, or is that pure inference time?