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

Ah that's a cool idea to use GIF for it. Seems like the video player is the trick in terms of consumer-side then, making me wonder if it's wise to expect any support for this idea whatsoever. Maybe if somebody creates a nice WASM player with support someday.

It's really too bad this wasn't handled long ago, with some web-safe video emphasis to go along with all the web-safe imagery. Lossless/indexed or lossy, your choice...




You can use ffmpeg losslessly on the decode side as well, but the only interfaces I could find to write to are v4l2 and fbdev, neither of which seem to work properly under X11. (The obvious candidate, x11grab, a: reads, not writes b: the entire screen, not a specific window.) So you'd need something else to pipe the raw video to (ffmpeg can dump the audio into alsa).

You could also not decode it, and just demux the video and pipe that. Depending on how it reads/decodes files, a image viewer that displays GIFs might update in close to real time as it reads from a pipe that ffmpeg is demuxing into, and might not leak memory by keeping the overwritten frames around in case the GIF loops, but those both seem unlikely.

(As the saying goes: if it only works the way the manufacturer intended, it's defective.)


Addendum: I remembered that ffplay existed. Annoyingly, it still doesn't properly handle ffmpeg-generated .gif.mkv files by default, but you can do:

  $ ffplay -codec:v gif -i A.gif.mkv
to force correct video codec.

Also, it seems this is not a problem with the video players, but rather that ffmpeg's matroska muxer writes a incorrect video codec id of V_QUICKTIME. It works correctly with mov/.gif.mov (and possibly other container formats), and should work with mkv if you can patch in a correct codec id.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: