Open insyri opened 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()
.
id assume ffmpeg will always be faster since you wont need to upload -> download -> upload
or maybe i am thinking of it wrong
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).
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
gg
WTF!!1
RIP.
imo id remove ffmpeg with exec from consideration cause people may find sussy exploits with exec
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.
dont download untrusted files idiot
could containerize the process
wasm is also sandboxed so if you use ffmpeg wasm you'd also probably be fine
O_O
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.