I am using nvenc to encode my still images to H.264. I would like to number (timestamp or frame number) my still images, overlay the text at the right bottom.
nvenc does the encode to video part great (as its designed to do) but I am not sure what to use to overlay my custom text as the still come images comes in. Any advice?
Nvenc: overlay text onto images being encoded to video
Input images to the encoder are YUV planes. Depending on which format and sampling you are using (420p, NV12, 422, 444, etc) there may be different configuration of luma/chroma planes/samples, but in essence these are raster-scan images, and one byte per luma or chroma value. You could think of luma plane as grayscale “intensity” image for example.
Data will be written in raster scan order, that is, the values for the first line first, then (optional) padding bytes (not used), then values for the second line and so on.
You’d want to write some font bitmaps into there. There are several options for getting those. One can even “design” crude lo-res “fonts” directly into C code arrays. On the better end of the spectrum, I have very good experience with the https://freetype.org library. It can generate bitmaps at desired resolution from variety of vector font formats. Good luck!