Skip to content

Instantly share code, notes, and snippets.

@satori99
Created July 1, 2019 09:09
Show Gist options
  • Save satori99/2bdb3902e64370ca057741c0746b93a8 to your computer and use it in GitHub Desktop.
Save satori99/2bdb3902e64370ca057741c0746b93a8 to your computer and use it in GitHub Desktop.

Revisions

  1. satori99 created this gist Jul 1, 2019.
    17 changes: 17 additions & 0 deletions rpi_patch_for_mpeg2_vc1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/bin/bash

    # https://www.reddit.com/r/raspberry_pi/comments/5x7xbo/patch_for_mpeg2_vc1_license/

    function do_patch() {
    if [ -f "/boot/${1}" ]; then
    cp "/boot/${1}" "/boot/${1}_backup"
    perl -pne 's/\x47\xE9362H\x'${2}'\x18/\x47\xE9362H\x'${2}'\x1F/g' < "/boot/${1}_backup" > "/boot/${1}"
    echo "Patched /boot/${1}..."
    fi
    }

    do_patch start.elf 3C
    do_patch start_x.elf 1D

    vcgencmd codec_enabled MPG2
    vcgencmd codec_enabled WVC1