3 ms·
> a video format that can do dithering and indexed colors without jpeg/mpeg-style blurry/blocky compression. GIF actually does this, and you can convince ffmpe
by a1369209993 4y ago
> a video format that can do dithering and indexed colors without jpeg/mpeg-style blurry/blocky compression.
GIF actually does this, and you can convince ffmpeg to mux it into a generic container like matroska, although most video players won't decode it:
ffmpeg4 -i A.mp4 -f matroska -vcodec gif -acodec mp3 A.gif.mkv
> The playback of [A.gif.mkv] requires a video/x-unknown decoder plugin which is not installed.
- themodelplumber 4y agoAh 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...
- a1369209993 4y agoYou 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.)
- a1369209993 4y agoAddendum: 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.