Stupid Programmer Tricks and Star Wars GIFs
rarlindseysmash.com
rarlindseysmash.com
gst-launch-1.0 rtspsrc location=rtsp://192.168.2.112:8080/stream.sdp ! rtph264depay ! h264parse ! omxh264dec ! autovideosink
Gstreamer is more than this, but it'is a neat example.The file size reduction was quite impressive for our use case (roughly 10x smaller.)
In the end we did decide that while putting 5 second video intros in emails is cool, a 200k image is still a bit much for mobile users.
You must have a very different experience of email than I do. That sounds absolutely terrible to me. Am I missing some reason that this would be useful, or is this just a case of wildly diverging preferences?
Our product (Interactly) is virtual video interactions, so our main value prop is being able to see real people respond.
In that context we figured it would be interesting to see if we could include a 5 second GIF intro right into the notification email; mostly out of curiosity just to see if it would technically be possible.
I was surprised to find out it was mostly feasible, but you're right that it doesn't make sense beyond the fact that it would be a cool gimmick.
I want more hackers to realize how insanely easy it is to programmatically generate video with ffmpeg. Just write a program that dumps raw RGB frames to stdout! You can turn that into any video format conceivable, including gif.
Here's a little demo I wrote. Generates a video of the Mandelbrot set coming into focus:
https://github.com/acg/generating-video-demo
Example gif:
ffmpeg -i frame%04d.png -vcodec mjpeg -sameq test.avi ffmpeg -i myvideo.mkv -vn -acodec ogg myvid_sans_video.ogg ffmpeg -i myvideo.mkv myaudio.mp3For example, here's a gif produced with just ffmpeg: http://i.imgur.com/DWc4OdD.gif
And here is the version produced by ImageMagick: http://i.imgur.com/OdojPSo.gif
While the one made using ImageMagick looks better, it's also less compressed and takes up more space. So it's a tradeoff between the two.
Duke Dumont - Need U @ 1:42
http://www.youtube.com/watch?feature=player_detailpage&v=FnJ...
Remember when you first discovered programming? When you did all those little projects that were, honestly, fairly useless, but brought you the spine-tingling sensation of having power over your domain?
Remember how when you started programming professionally, and you quit those projects? Why did that need to happen?
Bravo Lindsey, never stop making cool things.
(YMMV. I'm assuming of course that you learned programming as a hobby--if you learned by taking a college course then gasp you might have skipped the pointless-project phase entirely. I suggest you get on top of that.)
It didn't, I now get to spend 8+ hours a day working on things that matter, things that get me paid, thinks that make my customers (and their customers) happy, things that I see people use daily on their phone on my way to my next assignment.
Just because I work for a boss - and no, not some cool startup in the Valley - doesn't mean I don't do cool projects anymore.
(My pointless project phase was amongst others a scraper for InvisionFree forums, they would charge hundreds of dollars to get a copy of the database of a <50.000 post forum - and ours was over half a million posts big)
If anyone is thinking of doing something similar, or just wants to script some video in some way, I can highly recommend AviSynth. It fits into the extremely flexible DirectShow pipeline and has earned a permanent place in my video editing toolchain (I use it as the frameserver for encoding DVDs).
Here's an example script (if you have AviSynth installed and create a file with these contents named hello.avs, you can open it in any media player you choose to see the results):
BlankClip()
Subtitle("Hello, world!")It'll be a problem if you use the original star wars video in one way or another though. I think. Depends on whether it can be considered fair use or not.
https://gist.github.com/akx/7217852
(You could add a `-vf ass=my_subtitle_file.ass` to the ffmpeg command line burn subtitles into the gif.)
EDIT: Misread your question, but yeah, I think you can make -vf ass read the ASS file from the (MKV, I assume?) file itself.
But using python as my tool for answering my bosses questions with data, I really enjoy reading posts like these, giving me ideas to learn and try new things.
Thanks a lot for that!
Now I kinda want to try this.
I usually prefer writing scripts to do stuff but VirtualDub is one of the few tools I simply use because I enjoy the open source and hacker spirit behind it.
An interesting plugin I miss for VD is an color reduction algorithm which would help to create very small gifs.
On reddit and tumblr gifs are a growing trend and it might be worth to put some effort into gif creation.
(and there are a plethora of yt-to-gif sites, so clearly frame capture works)
I've had to stop reading github's blog since they started putting thousands of these abhorrences there and started making it looks like a Buzzfeed page.