fix h.264 encoding

Left in a couple of comments for future improvement.