When you say you have a bitmap I guess you have an RGB or BGR bitmap?
To do a one off file conversion I would get a copy of
IrfanView[
^] . In fact I would get it anyway if you don't have it as it is the best tool I know for viewing not quite correctly formatted image data.
If you are trying to turn a series of bitmaps into H264 or some other form of MPEG video then RGB to YUV is the least of your problems. Encoding H264 is a deal more complicated than that. If you need to do this you should look into Microsoft Media Foundation for a very Windows/COM way to do that or into GStreamer for an open source Linux and Windows way to do it.
All the code you might ever need is somewhere in a GStreamer plugin but unfortunately it is also probably an undocumented mess written in C by a professor of hacking.
I have written the actual RGB to YUV code myself and it's not difficult to work out once you are certain about the relative sizes and ordering of the blocks of data and how the stride length is used ( Remember there are many YUV formats, YV12 and YUV422 being popular ones ). I can't post sample code sadly as I wrote it for a commercial client. I suggest you give it a try and post your code attempt if you get stuck.