rsource-open-source / rsource-records

📊 The rsource Discord bot. An advanced interface for viewing community times.
https://rsource.community/records
Academic Free License v3.0
2 stars 0 forks source link

*.video* -> *.mp4 #31

Open insyri opened 3 years ago

insyri commented 3 years ago

changes x video format files to mp4 so it can be previewable in discord, this would either use ffmpeg, ffmpeg js, or an api.

make inline reply, file upload, and file link as args.

insyri commented 3 years ago

We'll create three branches using ffmpeg.wasm, ffmpeg using exec(), and cloudconvert api and see which performs faster or better using performance.now().

dowoge commented 2 years ago

id assume ffmpeg will always be faster since you wont need to upload -> download -> upload or maybe i am thinking of it wrong

insyri commented 2 years ago

ffmpeg is the tool that would be used to transform the video format from any video format (excluding mp4) to mp4.

The comparison states to use 1 of three methods, local computation, raw local computation, and an external API. The difference between raw and non-raw is the way of connection, one method uses a prebuilt library to interact with ffmpeg -which would be not raw, and the other being to interact with ffmpeg directly through the CLI.

The fallback of the API is that it might be rate-limiting either the hosting-providers internet bandwidth or the API usage rate (like how many times you can use it in x time). The advantage of using the API would confirm an approximate constant speed of delivery since the API uses more optimized or faster computer hardware, where as the hosting provider's hardware won't be as optimized or as fast. Upload size would also be similarly consistent since Discord provides a smaller upload size of 8 Mb for default users (this is an advantage because there are more non-nitro users than nitro users).

dowoge commented 2 years ago

bro wrote a whole essay dawg i know what ffmpeg is im just saying that in terms of steps to do what u wanna do using ffmpeg directly would be faster but maybe using their API would be more consistent and "known" outcome yep Gg

insyri commented 2 years ago

gg

insyri commented 2 years ago

WTF!!1

jaydns commented 2 years ago

RIP.

jaydns commented 2 years ago

imo id remove ffmpeg with exec from consideration cause people may find sussy exploits with exec

insyri commented 2 years ago

I mean maybe, all it does is download the file and put it through ffmpeg, the exec part would just be the downloaded file name and again we can just rename or sanitize it. Looking at the library it doesn't look like dogshit and it doesn't use exec since its wasm, so this makes sense.

trueharuu commented 2 years ago

dont download untrusted files idiot

insyri commented 2 years ago

could containerize the process

jaydns commented 2 years ago

wasm is also sandboxed so if you use ffmpeg wasm you'd also probably be fine

insyri commented 2 years ago

O_O