Skip to content

Instantly share code, notes, and snippets.

@tomtaylor
Created January 12, 2019 14:44
Show Gist options
  • Save tomtaylor/aaf8591afb64bb7fda2ccdcc6d3b6b64 to your computer and use it in GitHub Desktop.
Save tomtaylor/aaf8591afb64bb7fda2ccdcc6d3b6b64 to your computer and use it in GitHub Desktop.
Convert a video frame into a dithered bmp for display on an e-Paper screen
# Install ffmpeg, imagemagick
ffmpeg -ss 00:01:00.00 -i input.avi -frames 1 -vf "scale=640:384:force_original_aspect_ratio=decrease,pad=640:384:(ow-iw)/2:(oh-ih)/2" -vcodec png -f image2pipe pipe:1 | convert -colorspace Rec709Luma -dither FloydSteinberg -remap pattern:gray50 - bmp:- | cat > image.bmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment