Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3
Added by Kevan Brown almost 7 years ago
I've gone through a lot of threads on the forums here and found little bits of information here and there, but what I'm looking or is a true, quick, down and dirty, step-by-step for compiling Tvheadend on a Raspberry Pi 3 (or Cross Compile for RPi 3 on say, Ubuntu) with Tvheadend configured to support transcoding, as well as FFMpeg configured to support the OpenMAX hardware acceleration included in the Raspberry Pi 3. I know all of this is possible based on the various threads I've read, I just need some guidance on the best way to proceed and the steps associated.
I have a link here that I found that shows how to compile FFMpeg to use OpenMAX on the Raspberry Pi 3. Just don't know what I need to do for Tvheadend to use that and support transcoding on the RPi 3.
I also have purchased the MPEG-2 and VC-1 licenses for the RPi 3.
PS: I've been using the apt repository provided by the nice folks at Tvheadend for the Raspberry Pi, however that package doesn't include support for transcoding, and I'm assuming any ffmpeg it downloads probably doesn't have OpenMAX enabled.
Thank you for any help anyone is willing to provide, and for our patience with what will likely appear as a very noob question.
Replies (13)
RE: Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3 - Added by Mark Clarkstone almost 7 years ago
There's a reason transcoding isn't included in the rpi builds, it's not supported. There's been work to get it to run directly within tvh but this hasn't (to my knowledge) been successful, at least not for me so far.
I'll give it a shot tomorrow & see what I can do.
RE: Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3 - Added by Kevan Brown almost 7 years ago
Thank you very much for the reply and your willingness to assist. I'll eagerly await your results.
RE: Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3 - Added by Kevan Brown almost 7 years ago
Mark Clarkstone wrote:
There's a reason transcoding isn't included in the rpi builds, it's not supported. There's been work to get it to run directly within tvh but this hasn't (to my knowledge) been successful, at least not for me so far.
I'll give it a shot tomorrow & see what I can do.
Any luck Mark?
RE: Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3 - Added by Mark Clarkstone almost 7 years ago
I tried but it's still broken see #4572 with the results.
RE: Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3 - Added by Kevan Brown almost 7 years ago
Well thank you for trying. I appreciate your time.
RE: Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3 - Added by Mark Clarkstone almost 7 years ago
Kevan Brown wrote:
Well thank you for trying. I appreciate your time.
You could still use transcoding on the Pi though using the transcode spawn option, I haven't tried it yet, I should do.
RE: Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3 - Added by Kevan Brown almost 7 years ago
I'm afraid that without hardware acceleration (OpenMAX), the Pi just won't be able to keep up with the transcoding of MPEG-2 to H264, which is my primary use case as I'm looking to use TVHeadend with Plex to stream Live TV (which is encoded as MPEG-2 OTA).
RE: Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3 - Added by Adam Rybak almost 7 years ago
Im able to live transcode with ffmpeg used as command line:
/usr/local/bin/ffmpeg -threads 4 -c:v h264_mmal -i http://192.168.XXX.XXX:9981/stream/channelid/1040644304 -c:v h264_omx -s 480x270 -b:v 768k -pix_fmt yuv420p -bufsize 3000k -c:a libmp3lame -ac 1 -ar 22050 -f mpegts -r 25 - 2>/tmp/ff.log
and passing to php script...
CPU usage is about 80-90% and works well.
My tweaks in /boot/config.txt for good perf (found in internet forums):
core_freq=580
arm_freq=1380
over_voltage=4
disable_splash=1
gpu_mem=320
temp_limit=75
sdram_freq=460
i think the transcoding can be done in tvheadend.
RE: Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3 - Added by Mark Clarkstone almost 7 years ago
Adam Rybak wrote:
Im able to live transcode with ffmpeg used as command line:
/usr/local/bin/ffmpeg -threads 4 -c:v h264_mmal -i http://192.168.XXX.XXX:9981/stream/channelid/1040644304 -c:v h264_omx -s 480x270 -b:v 768k -pix_fmt yuv420p -bufsize 3000k -c:a libmp3lame -ac 1 -ar 22050 -f mpegts -r 25 - 2>/tmp/ff.log
and passing to php script...
CPU usage is about 80-90% and works well.
My tweaks in /boot/config.txt for good perf (found in internet forums):
core_freq=580
arm_freq=1380
over_voltage=4
disable_splash=1
gpu_mem=320
temp_limit=75
sdram_freq=460i think the transcoding can be done in tvheadend.
It can, but not directly, you may want to consider using the transcode spawn option instead though.
RE: Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3 - Added by Adam Rybak almost 7 years ago
Mark, Can you explain?
RE: Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3 - Added by Mark Clarkstone almost 7 years ago
Adam Rybak wrote:
Mark, Can you explain?
It's basically the same as the pipe way (like above) except you use stdin/out.
It's only in 4.3. When I get chance I'll give it a try & report back.
RE: Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3 - Added by Adam Rybak almost 7 years ago
How to use it? I can try ;-)
RE: Compile Tvheadend with Transcoding Support and FFMpeg with OpenMAX on RPi 3 - Added by Jan g over 6 years ago
Adam Rybak wrote:
Im able to live transcode with ffmpeg used as command line:
/usr/local/bin/ffmpeg -threads 4 -c:v h264_mmal -i http://192.168.XXX.XXX:9981/stream/channelid/1040644304 -c:v h264_omx -s 480x270 -b:v 768k -pix_fmt yuv420p -bufsize 3000k -c:a libmp3lame -ac 1 -ar 22050 -f mpegts -r 25 - 2>/tmp/ff.log
and passing to php script...
CPU usage is about 80-90% and works well.
My tweaks in /boot/config.txt for good perf (found in internet forums):
core_freq=580
arm_freq=1380
over_voltage=4
disable_splash=1
gpu_mem=320
temp_limit=75
sdram_freq=460
i think the transcoding can be done in tvheadend.
how are you doing this? 1080i only 18fps here. 576i 30fps but sometimes no picture. 720p 25fps but everytimes PES errors and other ffmpeg errors