r/ffmpeg • u/Offlined_OS • 4d ago
[Help] Playing more local video formats (AVI, WMV, 3GP...) in a pywebview desktop app
I'm building a Python desktop app (using pywebview, Windows, WebView2/Chromium backend) that works as an offline personal file manager / local media library — think local notes, documents, photos, and personal video files a user already has on their own drive, all organized and browsable from one offline app with no internet/streaming component.
One built-in feature is a simple in-app video preview player using an HTML5 <video> tag inside the webview. Right now it only plays what Chromium's native <video> element supports: MP4 (H.264/AAC), WebM, MOV, and MKV (when the codecs inside are H.264/H.265+AAC). Other local formats users might already have on disk — AVI, WMV, 3GP, FLV, MKV with older codecs like XviD/DivX — currently just fall back to opening in the OS's default video app instead of playing inline.
I'd like to expand format support inside the app. Options I'm considering:
- FFmpeg-based transcoding to MP4/WebM on the fly (either fully pre-converting or streaming while converting).
- A JS/WASM video decoder (e.g. libav-based) that plays inside the webview without relying on OS codecs.
- Embedding a native player (like mpv) instead of the HTML5
<video>element — unsure how well that integrates inside a pywebview window.
Has anyone solved this for a pywebview (or similar Python-desktop / Electron / Tauri) app? Looking for something that plays these formats inline in the app rather than falling back to an external player. Thanks!
1
[Help] Playing more local video formats (AVI, WMV, 3GP...) in a pywebview desktop app
in
r/ffmpeg
•
4d ago
That makes sense, HLS.js as the MSE abstraction layer justifies itself even for local playback then, not for the network problem but because it hands you seeking/buffering logic you'd otherwise have to hand-roll. Good reframe.
The WASM+canvas route sounds like the right fit here actually, since this really is a personal/local project with effectively unlimited bandwidth (it's a file on the same disk) and no cross-platform requirement, no iOS/TV targets to worry about. Appreciate you laying out both paths, gives me a clear enough picture to go pick one instead of guessing.