09.12.2020

Mpeg-2 License Key Generator Raspberry Pi

The point of buying the license keys is to enable hardware decoding of MPEG-2 and VC-1 — see Why does the Raspberry Pi need a MPEG-2 licence? For more information on why you might want this. While there was much rejoice recently at the patents expiring for MPEG-2, this makes little difference to Pi users, it seems.

  1. Mpeg-2 License Key Generator Raspberry Pi Windows 10
  2. Mpeg-2 License Key Generator Raspberry Pi 3
  3. Mpeg-2 License Key Raspberry Pi Generator
  • Mar 08, 2015 Raspberry Pi 2: In this video, I go over MPEG 2 decoding on the Raspberry Pi 2 with and without the MPEG 2 License Key. I also go over installing the key on Raspberry Pi.
  • MPEG-2 patent expiration opens door for royalty-free use. And sell hardware without paying license fees for MPEG-2 content. Patents should allow the Raspberry Pi Foundation to unlock this.

This is an effort to reverse-engineer the Raspberry Pi license key check forMPEG-2 and VC-1 hardware video encoding.

Patch

A patch for start.elf, a firmwware blob for the VideoCore IV processor used byall Raspberry Pi models, was posted toredditby /u/fuck_the_mpeg_laon 03-03-2017:

Applying it to a4.14.44 start.elf(latest as of time of writing) results in the following diff:

Raspberry

Some initial analysis was done by q3kon Hacker News:

Yes, it seems to patch a licensing function at 0xEC95FD4 [1] to always return 1,by patching the jump at 0xEC95FE2 (that should be only taken for the always-allowed H263 codec)to always be taken, thus always allowing all codecs.

Reverse-engineering

The initial entry point is disassembled using theVideoCore IV pluginfor IDA Pro 6 by hermanhermitage. https://celestialsusa.weebly.com/blog/omnisphere-2-app.

After loading and analyzing start.elf, we can find the is_licensed routineat address 0xEC96290 by jumping to the file offset given to us by xxdbeforehand. The relevant code sections are available insub_EC96290.asm and is_licensed.asm.

Here, two memory locations (0xEE86680 for MPEG-2 and 0xEE869E0 for VC-1)that point to the .bss segment are checked to determine the return value ofis_licensed. There are no other obvious references to these locations instart.elf, so memory-breakpoint debugging (TBD) is probably needed.

Mpeg-2 License Key Generator Raspberry Pi Windows 10

Hardware decoding of additional codecs on the Pi 3 and earlier models can be enabled by purchasing a licence that is locked to the CPU serial number of your Raspberry Pi.

On the Raspberry Pi 4, the hardware codecs for MPEG2 or VC1 are permanently disabled and cannot be enabled even with a licence key; on the Pi 4, thanks to its increased processing power compared to earlier models, MPEG2 and VC1 can be decoded in software via applications such as VLC. Therefore, a hardware codec licence key is not needed if you're using a Pi 4.

decode_MPG2

decode_MPG2 is a licence key to allow hardware MPEG-2 decoding, e.g. decode_MPG2=0x12345678.

decode_WVC1

Mpeg-2 License Key Generator Raspberry Pi 3

decode_WVC1 is a licence key to allow hardware VC-1 decoding, e.g. decode_WVC1=0x12345678.

If you have multiple Raspberry Pis and you've bought a codec licence for each of them, you can list up to eight licence keys in a single config.txt, for example decode_MPG2=0x12345678,0xabcdabcd,0x87654321. This enables you to swap the same SD card between the different Pis without having to edit config.txt each time.

Mpeg-2 License Key Raspberry Pi Generator

This article uses content from the eLinux wiki page RPiconfig, which is shared under the Creative Commons Attribution-ShareAlike 3.0 Unported license