chibisafe / chibisafe

Blazing fast file vault written in TypeScript! 🚀
https://chibisafe.app
MIT License
1.77k stars 268 forks source link

[Enhancement] Convert GIF videos to MP4 to save space #127

Closed KorewaKiyo closed 5 years ago

KorewaKiyo commented 6 years ago

GIF is an obviously space inefficient format, so maybe lolisafe should convert to mp4 before saving? It can be done with ffmpeg before writing to file, this could add overhead and slow the service down slightly for larger files though.

giantcow commented 6 years ago

Generally if I'm uploading a GIF I'm wanting it to stay as a gif :thinking:

Pitu commented 6 years ago

Expanding a bit more on the topic, doing something like imgur should be possible. It wouldn't save space since lolisafe would be serving both files in .gif and .mp4 format, but it would save bandwidth if we do something like imgur where the video has autoplay, hidden controls and such. Not sure if it's worth the hassle tbh, but I'm open to discuss suggestions about it in here.

KorewaKiyo commented 6 years ago

I'm 90% sure Imgur doesn't serve gif anymore, it's all mp4 but can be served with the gif extension

Shumatsu commented 6 years ago

Question is, should lolisafe be a file hosting service or image hosting service? Converting gif files to mp4 to conserve bandwidth is certainly more of image hosting solution.

giantcow commented 6 years ago

@Kosemii https://i.imgur.com/OJTwZuc.gif https://i.imgur.com/OJTwZuc.mp4

Both of them are their own formats. I'm pretty sure when you upload any format, it will automatically create the static content.

At least that makes sense im my head because if you create the static content during the upload, then you don't have to worry about the overhead of converting the image into each format every time a user requests said format.

giantcow commented 6 years ago

It might be an idea where we do create mp4 versions of GIFS for display, but whenever there's a hard link to the static file we give you the .gif. This could help speed up loading times for Album pages.

https://shape.att.com/blog/animated-gifs-vs-video-files

Pitu commented 6 years ago

@Shumatsu I don't see a problem in optimizing specific file formats if there's room to do so.

KorewaKiyo commented 6 years ago

I'm still curious as to what you use .gif for that .mp4 can't achieve?

giantcow commented 6 years ago

@Kosemii I can copy paste a GIF and have it automatically loop indefinitely whenever it's rendered 99% of the time, where as a mp4 depends on if the player supports it.

Pitu commented 6 years ago

I have an album where I save my Discord profile pictures in GIF format. Having them converted to mp4 without the possibility of linking the .gif file would be a problem. I'm fine with serving both though.

KorewaKiyo commented 6 years ago

Serving both seems to be the best solution, I agree. Maybe have an option in the config for api returning gif/mp4 by default?

giantcow commented 6 years ago

I feel like that should be left up to the user's preference.

KorewaKiyo commented 6 years ago

Ah, true. Maybe set it in the upload JSON?

giantcow commented 6 years ago

This is way more in Kana's field but maybe something along the lines of adding a header; because I don't believe you send and json-data in the POST, but you will get JSON back as a response.

jithatsonei commented 6 years ago

you dont fuck w users files. period. if they upload in that format then they should get that format back. if youre that triggered about it then you can blacklist gifs and have your users find another clone

KorewaKiyo commented 6 years ago

chill man jeez

On Mon, 17 Sep 2018, 03:57 alucard0134, notifications@github.com wrote:

you dont fuck w users files. period. if they upload in that format then they should get that format back. if youre that triggered about it then you can blacklist gifs and have your users find another clone

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/WeebDev/lolisafe/issues/127#issuecomment-421880733, or mute the thread https://github.com/notifications/unsubscribe-auth/AV3mhJpd0uQdFc8S3DbVa4p4W6nnaFKrks5ubw-FgaJpZM4UYKZi .

lyricalpaws commented 6 years ago

you dont fuck w users files. period. if they upload in that format then they should get that format back. if youre that triggered about it then you can blacklist gifs and have your users find another clone

lmao, is it a webmaster's fault for wanting to be able to store more files on their server?

Pitu commented 5 years ago

At least for the time being this is not gonna be a thing. With the new codebase it's gonna be super easy to implement middleware if someone wants to make a plugin for it, but as it stands this won't be shipped with lolisafe directly.