# Inclusion of patented video codecs in ParaView/VTK

**URL:** https://discourse.paraview.org/t/inclusion-of-patented-video-codecs-in-paraview-vtk/10189
**Category:** Development
**Created:** [August 24, 2022, 1:01pm UTC](https://discourse.paraview.org/t/inclusion-of-patented-video-codecs-in-paraview-vtk/10189 "2022-08-24T13:01:38Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jaswantp/32/11456_2.png) [@jaswantp](https://discourse.paraview.org/u/jaswantp)
#### Post date: [August 24, 2022, 1:01pm UTC](https://discourse.paraview.org/t/inclusion-of-patented-video-codecs-in-paraview-vtk/10189/1 "2022-08-24T13:01:38Z")

</div>

I’m putting this out here for us to learn how an open source project would go about using patented video codecs (h.264/h.265) to

1. generate video files in a patent-protected non-free container format like mp4
2. live stream the encoded bytes.

ParaView can generate an mp4 video from a sequence of still images with the help of an h.264/h.265 encoder. I’ll clear some doubts and confusion right away - [mp4](https://en.wikipedia.org/wiki/MP4_file_format) is a multimedia container for video, audio, and subtitles. [h.26x family](https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding) are the video codec specification that compresses an image sequence into a media container. Likewise, there are audio codec specs - vopus, vorbis to compress audio bits into a multimedia container.

For ParaView’s sake, we’re concerned about video codecs.

The h.26x spec is implemented by different vendors, it can be a software implementation -

1. [cisco/openh264](https://github.com/cisco/openh264) ← BSD-2 license
2. [x264](https://www.videolan.org/developers/x264.html) ← GNU GPLv2
3. [x265](https://www.videolan.org/developers/x265.html) ← GNU GPLv2, also available under a commercial license.

… or hardware implementation. All GPU vendors (intel, nvidia, amd) implement the codecs in their driver. As a developer, you are required to agree to the vendor’s terms and obtain an SDK (headers,…) from the vendor. As a user, you only need to set up the drivers properly. If you’re able to use ParaView, chances are your drivers are well set up.

There are some middleware that can be used to lighten the developer burden - ex: ffmpeg and gstreamer - but the licenses are a mix of GPL and LGPL.

1. Intel on windows: Developer needs [media-sdk-windows](https://www.intel.com/content/www/us/en/developer/tools/media-sdk/choose-download-client.html). User must have installed the intel graphics drivers.
2. Intel on linux: Developer needs [intel-onevpl](https://github.com/oneapi-src/oneVPL-intel-gpu) or [libva](https://github.com/intel/libva). A user must have installed intel’s graphics driver properly. Almost every simple distro does this automatically. Advanced distros have detailed documentation on how to DIY.
3. NVIDIA on windows and Linux: Developer needs [NVIDIA VIDEO CODEC SDK - Get Started | NVIDIA Developer](https://developer.nvidia.com/nvidia-video-codec-sdk/download). A user must install nvidia drivers properly. On Linux, you need proprietary drivers. nouveau wouldn’t work.
4. AMD on windows and Linux: Developer needs [AMF](https://github.com/GPUOpen-LibrariesAndSDKs/AMF) or [libva](https://github.com/intel/libva). A user must have a proper installation of AMD GPU drivers. On linux, the open source radeon driver can use libva.

**Question**  
Can we use the hardware SDKs to build ParaView binaries? The codec implementation sits in the drivers anyway and we’re not redistributing that non-free patent-protected piece of work. Since the hardware is paid for, does it imply that the patent fees are already paid?

If we pick software implementations, Kitware has to either distribute x265/x264 source - which we can’t due to license incompatibility with ParaView or ask users to download libx264/x265 from their package managers or build it from source.

**Alternatives**  
An alternative route is to pick the VP9 or AV1 codec specs which are royalty-free and come with BSD-2,3 software implementations - [libvpx](https://github.com/webmproject/libvpx), [svt-vp9](https://github.com/OpenVisualCloud/SVT-VP9) Although, mp4 cannot contain these bit streams. VP9 requires a WebM file format. It is not as universal as mp4 on the desktop. Ex: not playable in Quicktime.

Thoughts? @berkgeveci @cory.quammen@jourdain

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jaswantp/32/11456_2.png) [@jaswantp](https://discourse.paraview.org/u/jaswantp)
#### Post date: [August 24, 2022, 1:05pm UTC](https://discourse.paraview.org/t/inclusion-of-patented-video-codecs-in-paraview-vtk/10189/2 "2022-08-24T13:05:29Z")

</div>

Another route is to go through OS-specific frameworks.

1. Windows - [Media Foundation](https://docs.microsoft.com/en-us/windows/win32/medfound/microsoft-media-foundation-sdk)
2. Mac OS - [Video Toolbox](https://developer.apple.com/documentation/videotoolbox?language=objc)
3. Linux - Intel made an attempt to make libva the single video acceleration framework on linux. But, that was a failed attempt - each vendor came up with their own framework, so the state of video acceleration is quite sad on Linux.

---

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [August 24, 2022, 5:38pm UTC](https://discourse.paraview.org/t/inclusion-of-patented-video-codecs-in-paraview-vtk/10189/3 "2022-08-24T17:38:38Z")

</div>

Thanks Jaswant, well done.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 29, 2022, 1:39am UTC](https://discourse.paraview.org/t/inclusion-of-patented-video-codecs-in-paraview-vtk/10189/4 "2022-08-29T01:39:58Z")

</div>

Using libva on linux seems to be reliable enough.

Are the OS-specific frameworks installed by default on MacOS and Windows ?

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jaswantp/32/11456_2.png) [@jaswantp](https://discourse.paraview.org/u/jaswantp)
#### Post date: [August 29, 2022, 1:04pm UTC](https://discourse.paraview.org/t/inclusion-of-patented-video-codecs-in-paraview-vtk/10189/5 "2022-08-29T13:04:58Z")

</div>

> [@mwestphal](#):
>
> Are the OS-specific frameworks installed by default on MacOS and Windows ?

On Mac: Yes.  
On Windows:  
H.264: Yes  
VP9: No. (free download from MS store. [VP9 Video Extensions - Microsoft Apps](https://apps.microsoft.com/store/detail/vp9-video-extensions/9N4D0MSMP0PT?hl=en-us&gl=US))  
HEVC: No. Microsoft charges a dollar for this 😏[HEVC Video Extensions - Official app in the Microsoft Store](https://apps.microsoft.com/store/detail/hevc-video-extensions/9NMZLZ57R3T7?hl=en-us&gl=US)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 29, 2022, 1:25pm UTC](https://discourse.paraview.org/t/inclusion-of-patented-video-codecs-in-paraview-vtk/10189/6 "2022-08-29T13:25:44Z")

</div>

Then using commonly available frameworks maybe be a good idea.
