TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Time.gif

563 pointsby def-almost 8 years ago

29 comments

koliberalmost 8 years ago
In 1994 I was in high school, and there were no animated GIFs. One way you could make images move in the web browser was to use a mechanism similar to this.<p>I wrote a C program which would load 6 frames of a smiley face animation and would feed them sequentially, in an endless loop, to anyone who requested the image. Mosaic was happy to animate them.<p>I get called in to the web mistress&#x27;s office. The web server is down. We had a donated Silicon Graphics Origin server, if my memory serves me correctly. This was a beefy machine.<p>The cgi-bin C program would load 6 images, as fast as it possibly could, and dump them into a network socket. It would not throttle. It would not check if the client disconnected. It had one job. It did it efficiently, and ruthlessly.<p>Poor server.
评论 #14997516 未加载
评论 #14997170 未加载
评论 #14998089 未加载
评论 #14997710 未加载
评论 #14999373 未加载
评论 #14997435 未加载
jancialmost 8 years ago
I did something similar long time ago with multipart&#x2F;x-mixed-replace content type. <a href="http:&#x2F;&#x2F;zabasoft.xf.cz&#x2F;clock.gif" rel="nofollow">http:&#x2F;&#x2F;zabasoft.xf.cz&#x2F;clock.gif</a>
评论 #15000004 未加载
评论 #14997588 未加载
nkkollawalmost 8 years ago
This is absolutely awesome.<p>I wonder if this can be used to stream regular GIFs, so that you don&#x27;t have to wait for the whole thing to load before seeing the animation.<p>I&#x27;m currently working on a project focusing on GIFs (<a href="https:&#x2F;&#x2F;www.gifsonic.com" rel="nofollow">https:&#x2F;&#x2F;www.gifsonic.com</a>), I&#x27;ll definitely study this to see if it&#x27;s possible.
评论 #14997222 未加载
oxymoronalmost 8 years ago
I did the same thing about fifteen years ago by generating a mJPEG stream from a PHP-script. As far as I can remember, it seemed more reliable than using GIF. See <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Motion_JPEG" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Motion_JPEG</a>
评论 #14997728 未加载
评论 #14996957 未加载
have_faithalmost 8 years ago
This technique used to be used to embed &quot;videos&quot; into html emails years ago. Haven&#x27;t seen it used in a long time maybe email clients block the streaming behavior now (for good reason).
ungzdalmost 8 years ago
Tried to make it output with chunked-encoding:<p>- In Chrome it shows nothing (looks like it waits for end of stream)<p>- In Safari it shows only the first frame<p>- In Firefox it works (shows animated clock)<p>Branch with chunked encoding: <a href="https:&#x2F;&#x2F;github.com&#x2F;kolen&#x2F;time.gif&#x2F;tree&#x2F;chunked-encoding" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kolen&#x2F;time.gif&#x2F;tree&#x2F;chunked-encoding</a>
warentalmost 8 years ago
This is really cool! Completely suboptimal but fascinating none the less. Great project and idea :) would be interested in hearing some people&#x27;s ideas for real applications of this
评论 #14997103 未加载
评论 #14996958 未加载
mawekialmost 8 years ago
So this was done during a programming paradigms course at KIT? I&#x27;m teaching functional programming basics using Haskell at my university. At the end of the semester we aren&#x27;t quite that far. But I am far from sure whether this exercise, just looking at the given types, has didactic value and I wonder how much of the stuff the instructor has given and how much the students worked out themselves given the course materials.<p>I would be a bit hesitant (teaching-wise), to talk about any function of the type IO () -&gt; IO Char -&gt; (Frame -&gt; IO ()) -&gt; IO ()<p>Although, not to be a spoil sport, it seems like a fun thing to do over a long weekend.
评论 #14996932 未加载
garaetjjtealmost 8 years ago
see also raytracing clock on PNG: <a href="http:&#x2F;&#x2F;www.ioccc.org&#x2F;2013&#x2F;mills&#x2F;hint.html" rel="nofollow">http:&#x2F;&#x2F;www.ioccc.org&#x2F;2013&#x2F;mills&#x2F;hint.html</a>
评论 #14997474 未加载
miduilalmost 8 years ago
When you are running out of time, but still got a decent video player ready:<p><pre><code> $ mpv --cache=no https:&#x2F;&#x2F;hookrace.net&#x2F;time.gif</code></pre>
jbochialmost 8 years ago
This reminds me of a project I&#x27;ve created a few years ago that does live video streaming with endless GIFs: <a href="https:&#x2F;&#x2F;github.com&#x2F;jbochi&#x2F;gifstreaming" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jbochi&#x2F;gifstreaming</a>
Jonas_baalmost 8 years ago
Very interesting from a tech perspective, make sure you lazy load the gif if you plan on using it after window load event otherwise it&#x27;s never going to happen and you&#x27;ll just get the endless spinner :D
roycealmost 8 years ago
eBay sometimes sends out emails with auction countdowns in them that do something similar.<p>The first time that I saw an accurate countdown ticking away in an email, it surprised the heck out of me.
评论 #15000992 未加载
scrollawayalmost 8 years ago
Hey, cool, I wanted to do the exact same thing the other day but as a countdown clock. For those saying this has no practical use, a countdown definitely does :)
评论 #14997139 未加载
评论 #14997486 未加载
lewis12345almost 8 years ago
Pretty interesting! Increases in size by ~4KB every second though. Probably would take a toll on your browser if you left it open for a while. :)
评论 #14997363 未加载
评论 #14997468 未加载
superasnalmost 8 years ago
This is great. If I were to serve this over apache is there a limit on the connections? I&#x27;m asking because I&#x27;m assuming there is only a specific number of concurrent connections per child in apache(?).<p>So if gif 2 is embedded in 100 sites will it bring my server down since children are not closing connections?
评论 #14997374 未加载
LeoPantheraalmost 8 years ago
Doesn&#x27;t seem to work in iPhone safari. Displays the time you loaded the page but doesn&#x27;t update.
评论 #14996879 未加载
评论 #14996896 未加载
评论 #14998159 未加载
评论 #14996880 未加载
otterproalmost 8 years ago
Also check out <a href="https:&#x2F;&#x2F;github.com&#x2F;ErikvdVen&#x2F;php-gif" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ErikvdVen&#x2F;php-gif</a> It generates real-time GIF images with PHP, such as countdown, etc.
indescions_2017almost 8 years ago
Am still waiting for it to finish looping ;)<p>There&#x27;s probably a cheap optimization in there somewhere. Diffing frames on each tick, but for that size it probably doesn&#x27;t matter. Thanks for the link to GifStream!
homeroalmost 8 years ago
It&#x27;s slow by 4 seconds
评论 #14996787 未加载
yogthosalmost 8 years ago
[gifsockets](<a href="https:&#x2F;&#x2F;github.com&#x2F;videlalvaro&#x2F;gifsockets" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;videlalvaro&#x2F;gifsockets</a>) is another version of this
rad_gruchalskialmost 8 years ago
The code is constantly 1 second behind.
mrcactu5almost 8 years ago
&gt; It is written in Haskell and works by dynamically generating each frame of the GIF and slowly feeding them over the HTTP connection.<p>This seems rather difficult. These are dynamically generated. There are 24<i>60</i>60=86400 possible slides, but at download time, we have to find the correct starting point. Did I get that right?
评论 #14997773 未加载
评论 #14997790 未加载
petrikapualmost 8 years ago
finally useful haskell project
_71_almost 8 years ago
McAuliffe Counters Critics of Police Response to Charlottesville Violence <a href="http:&#x2F;&#x2F;www.scout.com&#x2F;Board&#x2F;102743&#x2F;Contents&#x2F;fRee-Colts-Vs-Lions-Li-ve-STream-2017-NFL-Game-TV-106089255" rel="nofollow">http:&#x2F;&#x2F;www.scout.com&#x2F;Board&#x2F;102743&#x2F;Contents&#x2F;fRee-Colts-Vs-Lio...</a>
lisperalmost 8 years ago
I don&#x27;t understand why this is getting so much attention. From the description:<p>&quot;[It] works by dynamically generating each frame of the GIF and slowly feeding them over the HTTP connection.&quot;<p>So there is nothing (AFAICT) new or interesting going on here. It&#x27;s just an animation generated by the server in real time that happens to be formatted as a gif. It&#x27;s no different from what many low-end web-enabled security cameras do.
评论 #14998020 未加载
Markoffalmost 8 years ago
interesting concept, but not very practical compared to www.time.is
charlex815almost 8 years ago
_Waits for the Node.js implementation_
archergodalmost 8 years ago
it is one of those thing you do because you can do that. If you try to open the GIF only it won&#x27;t work well and if you try to save it as image it won&#x27;t work.<p>for me it has no real application that I can think of, it consume lot of bandwidth and processing even for small size gif.<p>good knowledge for developer, I certainly cannot even think in that line. But no use of it in current form.