News for hackers. Stuff that matters.
Re:Echo/printf to write images in 5 LoC with zero libraries ... by tleb_ on Thursday November 05, 2020 @07:33AM (#24997671)
You could just output raw frames into a file and read it using ffplay or vlc. The easiest pixel format is probably RGB 24 bits.

    ffplay -f rawvideo -pixel_format rgb24 -video_size 42x42 -framerate 42 foo.raw
    vlc --demux rawvideo --rawvid-fps 42 --rawvid-width 42 --rawvid-height 42 --rawvid-chroma=RV24 --rawvid-aspect-ratio 1:1 foo.raw
I experienced noticeable latency using ffplay so not great for real-time (multiple 100ms, upping the framerate to something like 100-200 reduces the latency but it's stupid). I have much better latency sending the frame data to a browser using websockets and displaying it in a canvas...

Sources: https://ffmpeg.org/ffmpeg-formats.html#rawvideo https://forum.videolan.org/viewtopic.php?f=13&t=57938&p=1936... https://wiki.videolan.org/Chroma/

There are no comments on this comment yet.