Hacker News new | past | comments | ask | show | jobs | submit login

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 https://en.wikipedia.org/wiki/Motion_JPEG



MJPEG is indeed much better for this. It uses less bandwidth (GIFs have no compression) and less browser memory (old frames can be discarded). When I was at globo.com, we developed this to serve animated thumbnails for live video streams: https://github.com/jbochi/live_thumb


GIF features lossless LZW compression.


The main advantage is that, because a video format rather than an image that can loop, the player can discard past frames. The GIF method is probably constantly leaking memory.


> The GIF method is probably constantly leaking memory.

If the browser only keeps compressed frames, 16 GB will last for more than a year.


GIFs can be non looping, but I'm not sure whether that flag is set at the beginning or end of the format.


yeah was wondering at what point chrome would give up, but the gif is only around 250kb per minute (0.004Mb/s)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: