|
2012-02-24
, 12:40
|
Posts: 1,225 |
Thanked: 1,905 times |
Joined on Feb 2011
@ Quezon City, Philippines
|
#2
|
can someone give me a hint to convert a N900
"cat /dev/fb0 > screenshot.fb" to a screenshot.bmp? or png?
rewrite works: cat screenshot.fb > /dev/fb0
BUT:
ffmpeg does not work:
ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb565 -s 800x480 -i fb-n900.raw -f image2 -vcodec png screenshot.png
fb2png does work on gta2 openmoko, but bot for n900...
I guess the problem is the 32 bit color?
thanks for help
schasch
|
2012-02-24
, 12:49
|
Posts: 68 |
Thanked: 4 times |
Joined on Feb 2010
@ Germany
|
#3
|
|
2012-02-24
, 12:56
|
Posts: 68 |
Thanked: 4 times |
Joined on Feb 2010
@ Germany
|
#4
|
|
2012-02-29
, 05:12
|
Posts: 68 |
Thanked: 4 times |
Joined on Feb 2010
@ Germany
|
#5
|
|
2012-03-20
, 19:30
|
Posts: 1 |
Thanked: 2 times |
Joined on Mar 2012
|
#6
|
The Following 2 Users Say Thank You to jlancaster For This Useful Post: | ||
|
2016-09-27
, 21:56
|
Posts: 88 |
Thanked: 411 times |
Joined on Mar 2010
@ southern Italy
|
#7
|
#!/usr/bin/env ruby def rgb565 r, g, b r >>= 3 # shift to skip unused bits g >>= 2 b >>= 3 [ (r<<6) | g | (b<<11) ].pack('n') # build & pack to 16 bits end samples = [ rgb565(255,0,0), rgb565(0,255,0), rgb565(0,0,255), rgb565(50,0,0), rgb565(0,50,0), rgb565(0,0,50), rgb565(0,255,255), rgb565(255,255,0) ] File.open("/dev/fb0", "w") do |fp| # open framebuffer for write 480.times do |sl| # for every scanline: fp.seek sl*4096 # update framebuffer pointer samples.each do |color| # eight color samples: 100.times { fp.write color } # 100 pixels wide column end end end
The Following 3 Users Say Thank You to alfmar For This Useful Post: | ||
"cat /dev/fb0 > screenshot.fb" to a screenshot.bmp? or png?
rewrite works: cat screenshot.fb > /dev/fb0
BUT:
ffmpeg does not work:
ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb565 -s 800x480 -i fb-n900.raw -f image2 -vcodec png screenshot.png
fb2png does work on gta2 openmoko, but bot for n900...
I guess the problem is the 32 bit color?
thanks for help
schasch