c - FFmpeg Libraries: How Do I Convert a Video to 4 Level Grayscale Video at 160x100 Pixels and as Raw Data -
this seems odd question, going start beginning:
i calculator programmer, ti-89 programmer, , i'm trying make video player it. have code calculator side done already, need able convert video specific format works follows:
each frame 4 level grayscale, there 2 bytes every 8 horizontal pixels, "back," or dark byte, , "front," or light byte. basically, every frame 2 monochrome binary images, first byte of first 1 followed first byte of second one, data stored follows:
fb(front buffer)[1],bb(back buffer)[1],fb[2],bb[2], etc... here's how display works: (defining 0 white , 3 black, 1 , 2 being in-between shades) each front buffer bit worth 1, if front buffer displayed nothing in buffer, "1" (or true) bits show light gray pixels. these added buffer bits, worth 2 (so if buffer displayed nothing in front buffer, "1" (or true) bits show dark gray pixels) get:
"0" bit on either buffer = white pixel (0+0=0)
"1" bit on front buffer not buffer = light gray pixel (1+0=1)
"1" bit on buffer not front buffer = dark gray pixel (0+2=2)
"1" bit on both buffers = black pixel (1+2=3)
i have down calculator-side, need know: 1) how convert video specific framerate using libs 2) how convert these frames 4-level grayscale @ 160x100 pixels , 3) how save these frames raw data in format described. thank in advance answer(s).
Comments
Post a Comment