Page MenuHomePhabricator

Investigate if it is legally okay to have h264 decoder run on production and/or labs, or provide the decoder in JS for a browser to run
Open, Needs TriagePublic

Description

[18:51]	<brion> oh yeah one other problem with those: legal (ffmpeg JS conversion)
[18:51]	<brion> since it compiles and ships an h.264 decoder
In T157319#3010458, @brion wrote:

We'd need to run this through legal to use anything in production; it's already potentially dubious to let an unlicensed h.264 decoder run on labs.

Event Timeline

So there's two separate questions:

  1. can we run an h.264 decoder (via ffmpeg) on a service in production that converts from files we don't serve directly

-or-

  1. can we ship a JavaScript h.264 decoder (ffmpeg compiled to JS) in a web page

I'm thinking 2) is unfeasible, but 1) _might_ simply be a case of having a licensed ffmpeg for a few server seats. Or might not. We never quite figured out what they want last time through since we concentrated on the serving of h.264.

Aklapper added a subscriber: ZhouZ.

VIA sells codec licenses for between zero and $0.20 per copy. Licensed products are required to have a EULA statement along the lines of:

This product is licensed under the AVC patent portfolio license for the personal use of a consumer or other uses in which it does not receive remuneration to (i) encode video in compliance with the AVC standard (“AVC video”) and/or (ii) decode AVC video that was encoded by a consumer engaged in a personal activity and/or was obtained from a video provider licensed to provide AVC video. No license is granted or shall be implied for any other use.

See e.g. https://www.google.com/intl/en_au/chrome/terms/ . I think our proposed use of AVC codecs can be classified as "other uses in which it does not receive remuneration", so I think we could decode H.264 video under an end-user license. The legal team should review this proposition.

FFmpeg does not hold an AVC patent license, so by using FFmpeg, there is no patent license, even for non-commercial use. The FFmpeg patent mini-FAQ is unconvincing.

OpenH264 does have a license and can be compiled into FFmpeg, however according to the FFmpeg documentation, it can't decode the most common profile.

So to use an AVC licensed product, we would have to use some kind of commercial decoder, not FFmpeg.

If we don't want to use an AVC licensed codec then I think the next best option is to negotiate with VIA for a gratis or cheap patent license. For example, they may accept that our use falls under "title-by-title streaming" and they are entitled to 2% of the associated revenue (i.e. zero). I assume that if we held such a license, we would be able to use FFmpeg under its terms.

So to use an AVC licensed product, we would have to use some kind of commercial decoder, not FFmpeg.

Someone could wrap FFmpeg with a VIA codec license and sell the binaries to us for $1, that would solve the problem.

@tstarling Would it make a difference if you used the hardware decoder from an integrated GPU?

@tstarling Would it make a difference if you used the hardware decoder from an integrated GPU?

It's hard to answer that in general, but the NVIDIA SDK license agreement explicitly denies that they are granting a patent license, and I suspect the others would be the same. So it probably doesn't make a difference.

You can see from the VIA pricing page that they shake down streaming platforms pretty hard -- they want $100k p.a. minimum even before the platform has any customers. All their license agreements will be structured to avoid a loophole which would allow streaming platforms to avoid paying that fee.

All their license agreements will be structured to avoid a loophole which would allow streaming platforms to avoid paying that fee.

The page does seem to be structured around people who want to stream H.264 content, not just ingest it. Its a bit unclear how much they care about the ingestion side, although i suppose they want to extract as much money as possible.

The timing here is a little unfortunate. Until recently they offered free licenses to people who stream video as long as the video is free to view (https://web.archive.org/web/20181123154815if_/http://www.mpegla.com:80/Lists/MPEG%20LA%20News%20List/Attachments/74/n-10-08-26.pdf ). I guess they decided to try and extract every dime before the last patent expires.


I think its also important to keep in mind here that H.264 is only one type of codec present in mp4. Many mp4's contain H.265 video, and there is also the audio codec situation

I think its also important to keep in mind here that H.264 is only one type of codec present in mp4. Many mp4's contain H.265 video, and there is also the audio codec situation

@TheDJ is working on a patch for help with this: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TimedMediaHandler/+/1265412 if you want to review it, It'd be amazing :)

AFAICS we don't fit into any of the pricing categories listed on the VIA pricing page, and I expect that a h.264 streaming licence would still be free for us

We could just ask MPEG LA for a free licence, and they might say yes. Does anyone know if we've ever talked to them?

edit: sorry, just realised this ticket is about decoding in particular and not streaming. Sorry for muddying the waters

Cross-referencing with T358266#11801688 Legal department has officially signed off on allowing to upload/store/convert of MPEG 4 Part II after July 19th, 2026. Do you think it's enough for you or do you want to still look into MPEG-4 Part 10? (They have patents pending up to 2030 so we need to look into the royalties discussion and whether we should pay or not)

Cross-referencing with T358266#11801688 Legal department has officially signed off on allowing to upload/store/convert of MPEG 4 Part II after July 19th, 2026. Do you think it's enough for you or do you want to still look into MPEG-4 Part 10? (They have patents pending up to 2030 so we need to look into the royalties discussion and whether we should pay or not)

Um, MPEG-4 Part 2 = MPEG-4 ASP = 1999 tech.

Nobody uploads that. Its only potential use is to serve it as a transcoded format for iOS devices (the task you linked, T358266) which requires an encoder and (for patent-encumbered formats) a streaming license. This task is about video decoding, which doesn't require a streaming license nor an encoder, only a decoder.

MPEG-4 Part 10 = AVC = H.264.

Which is much more common, but MPEG-H Part 2 = HEVC = H.265 is also very common these days. The iPhone 6S (2015) can't record it, but the iPhone 8 (2017) can. It uses the same MP4 container. It'll be hard to explain to users why they can upload some .mp4 files but not others, so preferably all common codecs for the MP4 container would be allowed: H.264, H.265, AAC and perhaps HE-AAC.

If I'm confused please correct me.

There are two other patent pools competing with VIA. Avanci Video offers patent licenses for AV1, H.265, H.266, MPEG-DASH, and VP9, all together in a bundle, for a percentage of video-related revenue. And Access Advance VDP is a pool covering AV1, H.265, H.266 and VP9 which has a royalty waiver tier for small businesses.