amigaholic
Posts: 25
Joined: Tue Mar 10, 2015 10:20 am

Transcoding in hardware?

Tue Mar 10, 2015 12:18 pm

Hello,

I'm using Serviio on my Pi 2 to stream media to any DLNA client in my house. Works like a charm for most things, but only if I encode the video into .MP4 format (MPEG2 video, AC3 audio) using Handbrake on my PC first.

And even then, when I say "most things", that doesn't mean "all things" ... :cry:

My TV is a Panasonic Viera, and it has a *very* limited DLNA capability. Really poor. It won't play any audio files at all, and will only play one specific video format.

I'd like Serviio on my Pi to be able to transcode my media, but even a standard definition (SD) DVD rip stutters, because the Pi 2 can't keep up.

Serviio uses ffmpeg to transcode. Is it possible to get some (or all) of the transcoding done in hardware? i.e. if I buy the MPEG2 license from the Pi shop, will the decoding part of the transcoding process be handled automagically by hardware? Or will it work, but require additional reconfiguration? Or will it not work at all, under any circumstances, period?

Any help offered would be greatly appreciated.

Kind regards
Graeme

amigaholic
Posts: 25
Joined: Tue Mar 10, 2015 10:20 am

Re: Transcoding in hardware?

Tue Mar 10, 2015 12:22 pm

Oh - worth noting that I built ffmpeg from source on the Pi2, and it is transcoding in software, but using multiple threads. It maxes out all four cores if I tell it to use that many, and still stutters. I restrict it to three.

I haven't tried overclocking my Pi2, and don't want to risk it until I can improve its cooling.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 28362
Joined: Sat Jul 30, 2011 7:41 pm

Re: Transcoding in hardware?

Tue Mar 10, 2015 1:50 pm

Overclock it, it wont do any harm. But I suspect SW transcode is not possible even with all four cores - there are some OpenMAX examples for transcoding that use the GPU, that may help, but I think that 1080p30 may be too much even for the HW, SD might be possible.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

amigaholic
Posts: 25
Joined: Tue Mar 10, 2015 10:20 am

Re: Transcoding in hardware?

Tue Mar 10, 2015 2:27 pm

I didn't expect it to be able to manage a BluRay rip in software, even with four overclocked cores - my desktop PC can manage to convert MKV to MP4 at around 35fps (using Handbrake), and that's a Core i5-2500K, and I'm not even using all that much in the way of compression. So it takes more than an hour and a half to recode a two hour movie. (actually, thinking about it, I'll need to check if Handbrake does that in hardware or in software - my video card is an nVidia GeForce 760, which supports both CUDA and nVidia PureVideo, so it has two paths in which work could potentially be offloaded from the CPU)

If the Broadcom SoC is capable of hardware-based MPEG2 decoding (albeit with the proper license to use that feature), then potentially some kind of Pi-specific hardware-assisted transcoding application (call it Pi-FFMPEG?) could be written? NOT by me, I hasten to add, you don't want to be running any of *my* code ... The transcoder would need to check for the presence and validity of an MPEG2 license, of course, so users of this app would still need to buy the proper license for their Pi.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 28362
Joined: Sat Jul 30, 2011 7:41 pm

Re: Transcoding in hardware?

Tue Mar 10, 2015 3:40 pm

As I said, someone has written code to do that (Google for Pi transcoding).

There are limitations because the encoder uses some of the same HW as the decoder, so full HD at 30fps may not be possible due to contention over that hardware.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Return to “Media centres”