Hacker News new | ask | show | jobs
Show HN: Create high resolution GIFs from YouTube (gifrun.com)
86 points by builderone 2230 days ago
9 comments

It takes an optimized video file from YouTube and bloats it into a GIF that is 20 times larger.

Why not just mute the video, trim it, and reduce its resolution? GIF needs to die.

GIFs should not be compared to videos, for one GIF is 30 year old technology with obvious limitations, however, there is still demand due to its portability. It also creates better effect if its very short clip, which most GIFs are. I appreciate you checking it out.
What platform doesn't have the ability to play an mp4 file? GNU Icecat on a FSF approved distro maybe, but beyond that? The portability advantage of gifs are greatly overstated.

The way I see it, gifs are strictly obsolete. They're big, load slow, and have limited color support (what's the point of a high-resolution gif if you're going to trash all the color data anyway?)

You made all the right points about GIF, it is an outdated technology for sure, but nothing has truly replaced it yet, there is apng as well as other technologies, but that's not universally supported as GIFs are.
In what sense are video files not portable? Any web browser can play them without issues.
I still haven’t figured out the magic codec I can plug into ffmpeg so the self hosted videos on my Wordpress work on all web browsers (i thought h264 would do it but mobile still doesn’t like it) gifs are designed to be portable and work every time
I always forget about yuv420p, I'll try it thanks!
In contrast, if your gif is over 1MB, my mobile browser will not display it. This is done to prevent excess data use. (It's a uBo ruleset) I'm unsure what browsers will still not support h264 however. Most commonly you'd find webmasters using both webm and mp4s in their video sources to allow the benefits of the webm filesize, and the mp4 to support ios devices
Giphy is worth an estimated 300 million, gifs are extremely popular on mobile and discussion boards, your comment is not relevant to the actual marketplace.
When a popular website says it’s serving you a GIF, it’s actually serving you a video file. ;-)
They serve video files with .gif as absolute fallback.
I agree with you on a technical level, but the fact is the UX for sharing gifs is still superior to video. The ability to copy/paste them, and the fact they appear inline and autoplay in contexts like text messages are killer features. Users simply don't care how big the file is or really even how grainy it is, as long as it works.
Also to add to your point, file storage is becoming ambiguous with cloud option and also very cheap and abundant on most devices these days, internet speed is fast enough that large file size is not that big of an issue, so the benefits outweigh its limitations. GIFs are still best way to quickly share something that is expressive and purely visual. There are other technologies to support looping visual, but nothing that has been universally supported as GIF has. I'll be happy to offer other formats once they become available in the future.
Could you give an example of a scenario where a GIF is more supported than a video?

Also, don’t forget that GIFs require much more processing power. A couple of large GIFs can bring a low-end smartphone to a crawl.

Wow that was incredibly easy to use (I made this as a test: https://i.imgur.com/7qAVhzn.gif)

1 feature request if possible, can you add another scrubber to the video so that I can set a beginning and end region and be able to preview my loop before creating the gif? Not sure how much of your gif making is done on the front or back-end but if it's back-end it would save you some bandwidth and CPU.

this is really good! awesome work

I'm adding features all the time, I'm thinking of providing a quick preview as well. I appreciate you checking it out and glad you like it!
That does not look like a high res gif
It looks like the tool creates 8 bit .gif files rather than h264 encoded webm videos. Is there any demand for actual .gif files these days?
Some still love real GIFs! My preferred use is cinemagraphs. See the images in this link:

https://blog.flixel.com/what-is-a-cinemagraph-how-do-they-wo...

True, ‘kids these days’ are oblivious that most GIF hosts don’t host GIFs.

H264 (H.264/AVC/MPEG-4 Part 10) is a video compression encoding often paired with AAC audio, often e-delivered inside an .mp4 or .mv4 file container.

Imgur’s GIFV file popularized on reddit is a renamed .mp4:

https://www.filedesc.com/en/file/gifv

Note WebM is an MKV-like container for VP8 video encoding w/ Vorbis audio. You would have to convert (transcode) the video and audio to go between MPEG-4 and WebM.

https://www.webmproject.org/docs/container/

Just for fun, GIFs can contain more than 256 colors:

https://en.wikipedia.org/wiki/GIF#/media/File:SmallFullColou...

GIFs are still in demand despite its limitations.
Many hosters limit the length of the video (whereas for gifs they limit the file size) so for certain videos it might make sense to use gifs instead.
What part of this project led you to believe it would produce "h264 encoded webm videos"?
Probably the part where it's 2020, not 1995.
This is a GIF maker, so it creates GIFs from videos and nothing more. Due to the fact that GIFs are over 30 years old, it should not be compared to today's technology, specially video encoding which is very different from a soundless looping image. Having said that, I'm all for something new that will replace a GIF with more modern approach and millions of colors.
> it should not be compared to today's technology, specially video encoding which is very different from a soundless looping image

Considering most sites that let users upload gifs convert them into looping soundless videos, I'd say they're "very different" insofar as they're very inferior.

For a quick share on GitHub fir example.
I would highly suggest to add some simple backend validation! Without even opening Postman, you can just edit the HTML and request an 8K gif! That's for sure quite expensive in terms of bandwidth and CPU!
You can do this with youtube-dl and FFmpeg.

If you create high-resolution GIFs, you will end with huge files, that's surprising. This is because the compression, after reduction to a 256 color table, is lossless.

Offhand do you recall the one-liner for that?

I remember seeing it a couple years back.

I often refer to this article, it does a good job of building a one-liner up from scratch: https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/
I do use both YouTube-DL and FFMPEG, and producing high-res GIF is actually very easy. It took me two weeks (part time) to launch the first raw version that worked well on my machine :) but took over a year to be able to scale it so everyone else can use it as well.
url=http://www.youtube.com/watch?v=V5bYDhZBFLA; youtube-dl -b $url; mplayer $(ls ${url##=}| tail -n1) -ss 00:57 -endpos 10 -vo gif89a:fps=5:output=output.gif -vf scale=400:300 -nosound

https://www.commandlinefu.com/commands/view/6110/create-an-a...

Not going to lie, this is pretty neat. Before I commit to bookmarking this, are you going to keep it free? And what exactly are your plans?
The plan is to keep it free supported by ads.
Thanks!
This is awesome. Any way you can make an API out of this?
This is not a replacement for someone else conveniently creating an API for you but if you're interested in running your own version of this you can probably recreate this with a combination of youtube-dl[1] (Python) and ffmpeg[2] and build an API around that. Youtube-dl handles A LOT more sites than just Youtube[3]

1. http://ytdl-org.github.io/youtube-dl/download.html

2. https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/

3. http://ytdl-org.github.io/youtube-dl/supportedsites.html

I wouldn't be surprised if this site was doing exactly this.

Yes unfortunately creating a prototype is one thing but maintenance, monitoring and long term commitment is another.

Thanks a lot though. youtube-dl and ffmpeg are very handy tools.

I use both YouTube-DL and FFMPEG to accomplish this task. I will say this, creating high quality GIF is by far the easiest part of the whole thing. Bypassing too many request as well as throttling which youtube is very good at was the trickiest part and still is. Making something work for a single user is one thing, scaling so everyone else can use it is a whole different beast. The name of the game is proxy and everything revolves around that.
Thank you, there is no plan at the moment to create an api, but maybe in the future.
Exactly what I needed, thanks!
Glad you like it!
I hate to be that guy but is this allowed by YouTube's ToS?
GIFs ate fair use, it’s not a copyright issues, also not using YouTube api.
> GIFs [are] fair use

Are they, though? Fair use only covers use for the purpose of criticism and parody (as in, making fun of the original work, not just making up your own lyrics to a popular tune).

> not using YouTube api

Even if you're not using their API, it still counts as a ToS violation. But since downloading YouTube videos is the main feature of your tool, there's not much you can do about it.

There are number of things that court would consider if its fair use, GIFs generally fall into that category, there haven't been a case brought to courts yet, but doesn't mean there won't be.
> not using YouTube api

Which means, like youtube-dl, it will break every week or two

They do sometimes break it. I've had to on occasion pass other header options along with it to look more like a generic web browser.
I wouldn't be surprised if it used youtube-dl under the hood.
More like every three weeks, but who's counting :)
Also I like to add, I've build number of applications using an API only to regret the time I spent on it later. When you rely on external API, its really not your product and you don't own it, API owns you and every move you make. Instead, I would rather rely on a strong community for support such as YouTube-DL, even though there are issues and its not perfect, still much better than API route, just my two cents.