8 ms·
Show HN: Create high resolution GIFs from YouTube
- emilsedgh 6y agoThis is awesome. Any way you can make an API out of this?
- kristoph1 6y agoThank you, there is no plan at the moment to create an api, but maybe in the future.
- flanbiscuit 6y agoThis 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 http://ytdl-org.github.io/youtube-dl/download.html 2. https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/ https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/ 3. http://ytdl-org.github.io/youtube-dl/supportedsites.html http://ytdl-org.github.io/youtube-dl/supportedsites.html I wouldn't be surprised if this site was doing exactly this.
- emilsedgh 6y agoYes 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.
- builderone 6y agoI 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.
- spuz 6y agoIt 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?
- bootloop 6y agoMany 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.
- kristoph1 6y agoGIFs are still in demand despite its limitations.
- hartator 6y agoFor a quick share on GitHub fir example.
- Terretta 6y agoSome 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-work/ 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 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/ https://www.webmproject.org/docs/container/ Just for fun, GIFs can contain more than 256 colors: https://en.wikipedia.org/wiki/GIF#/media/File:SmallFullColourGIF.gif https://en.wikipedia.org/wiki/GIF#/media/File:SmallFullColou...
- pixelbath 6y agoWhat part of this project led you to believe it would produce "h264 encoded webm videos"?
- skilled 6y agoNot 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?
- JimWestergren 6y agoExactly what I needed, thanks!
- kristoph1 6y agoGlad you like it!
- amelius 6y agoI hate to be that guy but is this allowed by YouTube's ToS?
- kristoph1 6y agoGIFs ate fair use, it’s not a copyright issues, also not using YouTube api.
- jtvjan 6y ago> 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.
- builderone 6y agoThere 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.
- ReactiveJelly 6y ago> not using YouTube api Which means, like youtube-dl, it will break every week or two
- builderone 6y agoMore like every three weeks, but who's counting :)
- builderone 6y agoAlso 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.
- flanbiscuit 6y agoWow that was incredibly easy to use (I made this as a test: https://i.imgur.com/7qAVhzn.gif 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
- builderone 6y agoI'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!
- snug 6y agoThat does not look like a high res gif
- SimeVidas 6y agoIt 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.
- builderone 6y agoGIFs 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.
- SimeVidas 6y agoIn what sense are video files not portable? Any web browser can play them without issues.
- jazzyjackson 6y agoI 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
- tenryuu 6y agoIn 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
- XCSme 6y agoCheck this out: https://gist.github.com/ingramchen/e2af352bf8b40bb88890fba4f47eccd0 https://gist.github.com/ingramchen/e2af352bf8b40bb88890fba4f...
- FraKtus 6y agoYou 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.
- songshuu 6y agoOffhand do you recall the one-liner for that? I remember seeing it a couple years back.
- vuln 6y agourl=http://www.youtube.com/watch?v=V5bYDhZBFLA; 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-animated-gif-from-a-youtube-video https://www.commandlinefu.com/commands/view/6110/create-an-a...
- builderone 6y agoI 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.
- philsnow 6y agoI 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/ https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/
- stanford89 6y agoI 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!