Skip to content

Instantly share code, notes, and snippets.

@satori99
satori99 / rpi_patch_for_mpeg2_vc1.sh
Created July 1, 2019 09:09
Patch Raspberry Pi boodcode to enable HW MPG2 enc/dec
#!/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