I can put data on the screen from buildroot linux by writing directly to the framebuffer, /dev/fb0. However the data there is in raw format. Here is how to dump from screen. Then convert, using ffmpeg, the raw data to a PNG and then back to raw data after editing:
- Get a screenshot of the framebuffer using
cat /dev/fb0 > screendump.bin
. - Convert to PNG using ffmpeg:
ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt monow -s 320x240 -i screendump.bin -f image2 -vcodec png screendump.png
This will read raw video from the screendump.bin, handle it as pixel monochrome data from a 320x240 screen and save as sreendump PNG file. - Next, open in Gimp or similar to edit. Save as PNG afterwards.
- Convert
to rawvideo binary again using ffmpeg:
ffmpeg -vcodec png -i savedimage.png -vcodec rawvideo -f rawvideo -pix_fmt monow savedimage.bin
- Put the data on the screen:
cat savedimage.bin > /dev/fb0
ffmpeg -pix_fmts
to see other raw video types to convert from/to.Sources: Check out these great sites for more:
http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs
http://forum.videohelp.com/threads/334333-Help-with-lossless-ffmpeg-command-%5Bvideo-png-back-to-video%5D
http://stackoverflow.com/questions/3781549/how-to-convert-16-bit-rgb-frame-buffer-to-a-viewable-format
https://community.freescale.com/docs/DOC-100347
No comments:
Post a Comment