I would like to use h.264 as the codec inside .mp4 container for my user uploaded videos for my website. But I saw somewhere that h.264 is non free. I am unsure whether I can use this technology or not. My question whether I can use it to compress my user uploaded videos in my website? If yes, then its great. And if no, what other solution can I go with? Thank you.
You are correct: h.264 is non-free and content producers as well as developers are obliged to pay royalties to MPEGLA for its use - but only if they are charging for their content, and the volume goes over the threshold MPEGLA sets (which is in the order of 100,000 paying subscribers or > 12 minutes in length if charging title-by-title). Thjey have also said that they will never charge for h.264 video that is freely distributed.
See MP4 / h.264 patent issues? for more info.
TL;DR if your video is free to view, then h.264 is free for you to use, and as @LordNeckbeard points out, it's a ripper of a codec, so knock yourself out.
Just to be more clear, it will be a video sharing website like keek or youtube, and I won't take any fees from the users, just will show ads. Therefore just to be on the safer side, following your answer, I don't have to pay even if my users are more that 100,000 right?– RobinFeb 18, 2015 at 6:01
Remember rhat my legal advice is worth all the money you're paying me. To be "on the safer side" I'd get a lawyer once your user base > 100,000. But there's links to the MPEGLA terms in the other question I mentioned, if you want to judge for yourself.– stibFeb 18, 2015 at 6:13
Yeah, I've seen people ask before if making money from adds still counts as free. The consensus on the doom9.org thread was that it's fine, you only need to pay the MPEG-LA if you're requiring money for content. (So I think even free but donation-supported would be ok.) Feb 26, 2015 at 6:01
Use it. Nothing else can provide the the same quality per bitrate as x264 (the top-class H.264 encoder) while not taking 10,000 years to encode (x265 'n VP9).
Use a recent
ffmpegbuild since development is so active. Static builds are available and easy.
-movflags +faststartto your command. Once encoding is finished this option will relocate the
moovatom to the beginning of the file allowing playback to begin for your viewer before the file is completely downloaded.
ffmpegattempts to avoid chroma subsampling using
-pix_fmt yuv420pis recommended to ensure a widely compatible pixel format.
Some devices may require you to use a more restrictive profile and level. You can do this with the
-leveloptions. Be aware of attempting to force a specific level on outputs that will not conform (such as trying to force
-level 3on a 1920x1080 video).
ffmpegwill give level limit warnings in the console output if this is the case.
Very informative! Thank you. I can't accept the answer as it does not state much regarding my question, but I have vote your answer. Thank you again for such an informative answer!– RobinFeb 18, 2015 at 5:59
VP9 does required 10,000 years to encode , while x265 able to do
mealtime encodingeven on my weak VPS
for SD formatwhich is impossible with
VP9– Salem FJun 13, 2018 at 23:13
@SalemF Looks like x265 may have gotten faster since this answer was written. I'll have to give it a try and maybe update this answer. Now there is an even slower newcomer, AV1, which when stable will put the others to shame in this slow race.– lloganJun 13, 2018 at 23:33
If I am right, HTML5 supports H.264 codec with mp4 container. In this case the company which developed the browser has paid it's license.
You can also use video servers for VOD playing, like Wowza Streaming Engine.
2That's not true. Although the software has paid a license, if you are charging viewers for the content and you go above the threshold for number of subscribers you owe MPEGLA royalty fees for using the codec.– stibFeb 16, 2015 at 3:49