0x09 / resdet

Detect source resolution of upscaled images
GNU Lesser General Public License v2.1
234 stars 10 forks source link

Make an online version #16

Open qgustavor opened 1 year ago

qgustavor commented 1 year ago

I think this library can be compiled to WASM using Emscripten like how I took svg2ass, compiled it to WASM and created a GUI for it.

It's useful since a lot of people don't like having to building software. There is already an open issue on providing static binaries, but I think a WASM version would be better as it would work in any browser that supports WASM (which are most browsers nowadays except for those that disable it to reduce security risks). A GUI would be pretty much required (as using a terminal in a webpage is not ideal), which have the added bonus of making it usable on mobile devices.

Well, I guess I can include the ffmpeg.js build I use in MKV Extract to extract frames in case some user inputs a video. ffprobe can be used to get a list of keyframes, then it would choose a few of the most highly detailed keyframes based on their size, and return resdet results for each one. Although, since this build does not include any decoder, it would have to rely on browser's native decoding (take input video, remux into a MP4 file with a single frame, pass to a <video>, save the rendered frame to a <canvas>, encode to PNG, pass the result to resdet), which is not ideal.

At the moment I don't have a lot of time to work on this, but I'm posting it here in case someone wants to try those ideas, otherwise I will try it eventually.