If you're only using to create free content then you can use h264 royalty free.
Incorrect.
There are 3 things to license. The Encoder, the Decoder and the Media Stream. For free content only the Media Stream is royalty-free, they still charge a fee for the encoder and decoder.
(From Wikipedia. My highlight).On August 26, 2010 MPEG LA announced that H.264 encoded internet video that is free to end users will never be charged for royalties.[11] All other royalties will remain in place such as the royalties for products that decode and encode H.264 video.[12] The license terms are updated in 5-year blocks.[13]