oneam / h264bsd

A simple h264 software decoding library
Other
194 stars 52 forks source link

Windows BMP? #18

Closed e1ioan closed 2 years ago

e1ioan commented 3 years ago

I would like to make a request, if it's not too much to ask. I would really like to see an example on how to safe frames into bmp files. I see the h264bsdNextOutputPictureBGRA but I can't figure out how to get from that to a bmp.

e1ioan commented 3 years ago

Never mind. I think I figured it out. If you want to put it in a example let me know and I'll send you the code.

e1ioan commented 3 years ago

Well, my code works, I can save the windows bmp files for each frame, but the images are upside down 1

oneam commented 2 years ago

Glad to see you got it working.

Windows BMP usually uses bottom-up encoding (where lines are stored left to right, bottom to top order). This is also called "negative step" since the distance between the first pixel in each row is negative.

If you decode assuming top to bottom encoding, it will appear upside down.