Wikipedia comments on this question:
"[...] H.264 is protected by patents owned by various parties. [...] The commercial use of patented H.264 technologies requires the payment of royalties to MPEG LA and other patent owners."
You need to find and license a library from a third party that offers it. STMicroelectronics does not offer any software protected by patents.
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
/Peter
In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.