Yep, it seems to have built up a fair bit of traction, mostly thanks to the Reddit crowd. There’s an API of sorts too. If Discourse did its automatic grab-the-file-and-self-host-it I suppose this might work in the short term.
I really think this kind of workaround ought to be open source though. A lot of articles I’ve read describe Gfy as a new format, which is very misleading. There’s only one way to make a “Gfy”, and that’s through Gfycat.com. Gfy is a service.
Some communities would benefit from such functionality.
Especially ones with download remote images to local setting enabled , but faster page loads alone is a good reason to think about it.
Quick hack would be to just use gfycat.com API.
It downloads&converts remote image (if not already present) and returns JSON with video details. At this point you replace .gif with video in post (see section “How can I embed these or link to them?”)
Custom plugin which bakes .webm into posts via background job would be of course more elegant.
If we plan to self-host .webm it would be just an extension to already existing download remote images to local feature. We would have an additional setting replace .gifs with optimized .webm versions (we could add another setting: convert only .gifs bigger than…).
Such native functionality requires ffmpeg as a dependency and comes with additional security risks.
It does not sound like a good default for Discourse: maybe it is possible to create it as a plugin?
The cornerstone of Project GIFV is a platform-wide upgrade to automatically convert uploaded GIF files on the fly into the MP4 video format. […]
The .GIFV Extension: With all these improvements, Imgur will now denote converted MP4s with a “.gifv” extension. The intention is to signal to users throughout the Internet that these links will feature a GIF experience that incorporates all the current and future enhancements made through Project GIFV. Imgur plans to submit an accompanying specification to relevant standards organizations before the end of the year.
Discourse already has onebox for MP4 files.
So the only missing piece is some kind of a sidekick job that does the conversion and slight modification to the onebox to loop by default (if mp4 was created from gif).
That sounds like something that could easily be done using the onebox, adding a white list either in the image or video engine. I am happy to build that, if such a PR is wanted (could also be behind a configuration setting, if needed).
One thing to consider is how Slack deals with this:
http://img0.joyreactor.cc/pics/post/%D0%B3%D0%B8%D1%84%D0%BA%D0%B8-superjail-%D0%BC%D1%83%D0%BB%D1%8C%D1%82%D1%81%D0%B5%D1%80%D0%B8%D0%B0%D0%BB-%D0%A1%D0%B2%D0%BE%D1%8F-%D0%B0%D1%82%D0%BC%D0%BE%D1%81%D1%84%D0%B5%D1%80%D0%B0-1886210.gif (Not automatically expanded because 30MB is too large. You can expand it anyway or open it in a new window. You can also change your preferences to allow images of any file size to auto expand.)
But neither of these make clear if the solution was implemented.
The reason I ask is that, unless I am mistaken, lightboxing does not appear compatible for gifs. By this I mean, I cannot click a gif and go fullscreen. When the gif contains detailed text, the user cannot zoom in without opening the image in another tab.
However, if the gif converts to an mp4 when uploaded, then we benefit from the fullscreen functionality of the existing video player, as well as the time bar – massive benefits when you are watching a short tutorial clip!
Is this conversion possibility already avaiable? I searched also “gif” in the settings and found
When comparing different documentation styles - all text, only video, text + gifs, the text + gifs option was vastly superior. Consequently, we plan on using gifs to demonstrate things in tutorial posts. However, if we can’t go fullscreen, or lightbox the gif, then written text can often be hard to see
And as you see when you hover over, you only get the option to pause
But what we really need is to be able to make the gif full size. The work around is to right click and open in new tab, which is fine for our more expert users, but the other 90% can’t be expected to adapt to that. So either we need a way to have uploaded gifs use lightboxing so they go full size when clicked, or simply converted to mp4s so Discourse provides fullscreen functionality.
Hmmm I’d submit something more official if I knew ruby, but sadly Python and C are my main languages.
I’ll probably write a python script that runs periodically, identifies new posts, identifies gifs in new posts, put them in a conversions folder, and then update the post with the path to the new webm file.
I found the configuration below to work well for the conversion. This script will convert every gif file in the ConvertToWebm folder into a webm, whilst retaining the original gif. For our use-case the loss is acceptable(small text still readable), and file size reduces by even 20x in some cases