Enable sw mpeg decode on rpi?

  • Hey guys. I own a bunch of Pi's and several codec licenses, but over the years everything has been moved, repurposed, etc so I don't know which boards I have licenses for, don't feel like paying again considering patents are expired.


    But, sw decoding doesn't seem to be enabled for mpeg2 by how the video acts (like there's just audio, roughly). How can I do this? I suspect this might be enough for me on an overclocked pi2.


    Or alternatively, maybe there's a way to bypass licenses now that that would be legal where I am?


    Thanks for advice.

  • You might try placing up to 8 license keys all on the same line of one of your RPi microSD cards. For example:


    Code
    decode_MPG2=0x8ff5a5c7,0xd4cb22af,0xe05b40bc,0xa54335b8,0x5964579b,0xafd24232

    which is part of a tutorial I wrote.


    Then you could boot each RPi with the microSD card and use the following command to check if the license is enabled.

    Code
    vcgencmd codec_enabled MPG2


    Note that I recently purchased an MPG2 license for a RPi3B+ and the process worked. I suspect that the RPi hardware doesn't magically recognize when a patent expires. :)

  • In the end I realized I could check the serial #'s remotely, so pi's in service I pulled serials, then rotated through the ones sitting on the bench looking up their serials and matched them around with licenses. So, I didn't have to figure out how to allow software decoding. But ah, after that I did google some interesting patches to start_elf that might work if someone looks around a little, in case someone comes after me looking for this info.

  • Why do you need licenses for pi3 pi4? Mine work fine without. Only needed in the Dark Ages of pi1b maybe pi2 (don't recall on pi2 didn't have one).

    Something wrong with hardware decoding?

  • I have a bunch of pi 2's. But regardless, it seems like the HW decoding is prioritized so that it doesn't even try to do SW decoding. So if anyone has the answer to that I'd still like to know.

  • Why do you need licenses for pi3 pi4? Mine work fine without. Only needed in the Dark Ages of pi1b maybe pi2 (don't recall on pi2 didn't have one).

    Something wrong with hardware decoding?

    I think it's fine for SD MPEG2 interlaced content - but decent deinterlacing of HD MPEG2 on a 3B may be pushing it. 4B will be fine I think (which is why they don't include an MPEG2 licence option for the 4B)

  • My 3B has no problem with anything I have asked of it. You might give it a try without. My Pi 1B could not display TV without the codec license. Maybe I just don't watch difficult to display shows 1080P works fine, I don't have a 3D TV or a 4K TV, I think I tried a HEVC file that worked


    I have been using incorrect terms. You need a license to enable HARDWARE decoding. Software decoding doesn't need it

  • My pi3b can handle 10 bit HEVC files with MMAL disallowed, has trouble with it allowed but tries. No codec license.

    My pi4b 1gb handles the file fine no MMAL.


    I don't know what paying for the license would do on a pi3 or pi4.

  • My pi3b can handle 10 bit HEVC files with MMAL disallowed, has trouble with it allowed but tries. No codec license.

    My pi4b 1gb handles the file fine no MMAL.


    I don't know what paying for the license would do on a pi3 or pi4.


    You can't purchase codec licences for the Pi 4B - they are only available for the Pi 3B+ and below. It's assumed that MPEG2 and VC-1 (the two licensable codecs) can be decoded in software on the Pi 4B.


    On the Pi 3B+ and below the MPEG2 and VC-1 software licences can reduce the CPU load on content that could otherwise be decoded in software, and for interlaced MPEG2 and VC-1 this can be significant. I'm not saying you need the licences - just that having them will reduce your CPU load (which in some cases may be desirable). On the single core Pis (Original A and B, A+ and B+, Zero, CM1 etc.) the hardware licences are even more important if you want to decode MPEG2 or VC-1 (particularly interlaced HD)

  • Anyways, the answer to the question "how to enable sw decoding" is disable MMAL.

    Pi1/Pi2 needs license for hw decoding Pi3 license is optional for hw decoding. Pi4 hw decoding not available.

    MMAL means hw decoding. The option wording is misleading it says "allow MMAL" which makes it sound like the Pi will make a decision, it really means "use MMAL instead of sw".

  • Now, suddenly my RPi3B with LE 9.2.1 decodes 10 bit HEVC just fine. If OMXPlayer is OFF and MMAL is ON. sound only if OMXPlayer is enabled.


    With no license.

  • To check if a Raspberry Pi is using the MPEG2 codec license:


    vcgencmd codec_enabled MPG2


    The response if the license is in use will be something like:


    MPG2=enabled