Jump to content

mpeg2 hardware decoding on the Raspberry PI


Tom83

Recommended Posts

The Raspberry Pi 3 has hardware encode/decode for h264, but also an mpeg2 decoder (which you have to purchase a license for).

 

This *should* make it somewhat ideal for a low-cost Emby server used primarily to transcode mpeg2 content from an HDHomerun to h264.  Although it has high CPU usage, it *mostly* accomplishes this task.  It does so smoothly for content less than 1080, but it does stutter every few seconds with HD channels.

 

While h264 hardware encode is a working with both OMX and V4L2, there are no hardware decoders available (for either h264 or mpeg2).  The h264 decoder does not require the purchase of a license, but the mpeg2 decoder does.  I've purchased the mpeg2 decoder, and then installed emby....but still no decoders are available.  

 

Is this a known issue, and/or are there any fixes or workarounds?

Link to comment
Share on other sites

Hi, @@softworkz can explain this better, but for use as a streaming server this currently is not available right now. The decoder API's require us to hook up the decoder with a video surface. Problem is, that's not on your server machine, that's on some other screen that you're watching from. In other words, it's not really made for a background transcoder like Emby Server is.

Link to comment
Share on other sites

Understood.

 

I had read that was an issue for decoding h265 on the rpi4, but I wasn't aware that was also an issue on the mpeg2 decoder on the rpi3. Sounds like it's an issue with rpi decoding in general.

 

Thanks for the quick response.

Link to comment
Share on other sites

Understood.

 

I had read that was an issue for decoding h265 on the rpi4, but I wasn't aware that was also an issue on the mpeg2 decoder on the rpi3. Sounds like it's an issue with rpi decoding in general.

 

Thanks for the quick response.

 

The rising popularity off all those single-board-computer platforms is exposing an exciting new area and we're trying to be on board with the most popular ones as good as we can.

Though, an important prerequisite for hw acceleration on those platforms is that these are supported by ffmpeg.

 

Now, look at the following tables here: https://trac.ffmpeg.org/wiki/HWAccelIntro

  • In the first table, you can see that there's support for OpenMax (OMX) and MMAL on the RPI.
  • The second table indicates that MMAL is supported for decoding and OMX is supported for encoding.
  • Now, look at the last column: "Usable from ffmpeg CLI"

    That last column indicates that OMX can be used from the command line (CLI) but MMAL can't

What "Usable from CLI" means, is that it doesn't need a GUI application with a vdeo surface for viewing. But MMAL is just suitable for local display - that's what @@Luke was referring to.

 

The codec you purchased was most likely to enable MP2 playback on the device while you have some display connected to it.

 

If you keep researching that subject, you might come across some cases where people were able to achieve more than what we're talking about right now.

But usually these are experimental and have requirements like: requires a specific hardware, a specific OS flavor, a specific OS version, certain OS patches/driver versions and - on top of this - some custom build of ffmpeg. What's happening there is impressive, but also - and unfortunately - very fragmented. It's impossible for us to keep up with all these things in detail.

 

Though, we try to support all hw acceleration features that are generally available and working.

 

Depending on your individual requirements, running Emby on those devices might even be a good option. But when you need reliable non-experimental live-transcoding, you should better choose a more common and more powerful hardware base. 

Edited by softworkz
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...