Project

General

Profile

Compiling on Raspberry Pi

Added by Gary D over 6 years ago

Hi all,

I am having some issues with the prebuilt Raspberry Pi TVH server (or it could be something all together different in my environment - I'm not sure)to do with buffering of IPTV streams. I'm trying to rule out as much as possible by building it myself. Certainly the feeds themselves are fine without using TVH.

One thing I have done is to compile FFmpeg with some of the recommending settings for use with the PI, including some of the hardware acceleration features to do with the GPU (just by following a guide). I'm wondering what information I should include when building TVH now. A lot of the switches in the configure script for TVH look to already have been covered off when i built ffmpeg (and I am making the assumption that the switches in TVH are related to ffmpeg).

My configure settings for ffmpeg are:
./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-static --enable-libx264 --enable-libfdk-aac --enable-libvpx --enable-libopus --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-omx --enable-omx-rpi --enable-mmal --enable-libxcb --enable-libfreetype --enable-libass --enable-gnutls --disable-opencl --extra-cflags="-march=armv8-a+crc -mfpu=neon-fp-armv8 -mtune=cortex-a53"

I believe when I build TVH, if add --disable-ffmpeg_static that should force tvheadend to use my ffmpeg right?

As an example as well with these configuration settings:
"libx264:yes"
"libx264_static:yes"
I am assuming "libx264:yes" enables the functionality in TVH, "libx264_static:yes" builds the libx264 software into my TVH application package? If I already have a prebuilt libx264 and wish to use that, is the correct configuration:
"libx264:yes"
"libx264_static:no"

Sorry for the noob questions I'm just a little confused and I can't seem to locate much information in the wiki.

Cheers,
Gary


Replies (7)

RE: Compiling on Raspberry Pi - Added by Robert Cameron over 6 years ago

Your ideas about configure options are correct.

As far as buffering issues, please remember that the Pi's networking is only 100Mbps, plus it is shared with the USB bus, so you're going to possibly have some bandwidth issues when using such a low-spec device.

RE: Compiling on Raspberry Pi - Added by Gary D over 6 years ago

Thanks for the confirmation. I think I can figure it out and at least have a crack.

I had considered the bus throughput, but I would have thought what I am doing is a lot less than what people would generally use it for - eg tv tuners. A HD terrestrial connection usually has a high bandwidth throughput, my inputs are usually 3-4mbit H264 720p streams. It's definitely worth consideration though, you're quite likely correct.

I've tried piping through ffmpeg with the same results, but I'm not sure if that writes to disk or whether it is all handled in memory. If it is all in memory than I should have the input and output of the LAN connection. Mine is a 3b+ with 1gbps LAN, but it is still on a shared bus with the SD Card. I tried binding tvheadend to the wifi module (apparently on a separate bus) - so input stream comes via LAN, output comes from WIFI - but still had the same problem.

Either way I'm learning some new things so not all is lost except my time and patience ;) I'll try a few permutations and combinations and see what works and what doesn't.

RE: Compiling on Raspberry Pi - Added by Hiro Protagonist over 6 years ago

Just a data point. I use a Pi 2 as a TVHeadend plus NFS server, and I can assure you the Pi is more than capable of recording HD DVB streams [using the USB both in from the tuner and out to disk], serving HD video over ethernet [using the USB twice again] and recording a 720p IPTV stream [using the USB twice again]. It can do all this simultaneously, so it is highly likely that USB bandwidth is NOT the problem unless you've got a lot more than this going on.

Piping through ffmpeg should not perform disk writes.

RE: Compiling on Raspberry Pi - Added by Gary D over 6 years ago

Thanks Hiro for the confirmation, what version of TVHeadend are you using? Precompiled or your own?

I also have a proxy running to serve up the URL's to tvheadend, I will run that up on a different machine and see if that helps. FWIW it's just doing a ffmpeg pipe:
\usr\bin\ffmpeg -i URL -vcodec copy -acodec copy -f mpegts pipe:1

RE: Compiling on Raspberry Pi - Added by Hiro Protagonist over 6 years ago

I'm running 4.26 which I compiled. Configured with the following flags:
--disable-satip_server --disable-satip_client --disable-hdhomerun_static --disable-ffmpeg_static --disable-bintray_cache

My ffmpeg pipes look like:

pipe:///usr/bin/ffmpeg -loglevel fatal -headers User-Agent:<user agent string>\r\n -i <url> -map 0 -c copy -metadata service_name=<channel ID> -f mpegts pipe:1

The stuff in <> filled in to suit your needs.

Note in linux the path separator is forward slash / not backslash \

RE: Compiling on Raspberry Pi - Added by Gary D over 6 years ago

Hiro Protagonist wrote:

I'm running 4.26 which I compiled. Configured with the following flags:
--disable-satip_server --disable-satip_client --disable-hdhomerun_static --disable-ffmpeg_static --disable-bintray_cache

My ffmpeg pipes look like:
[...]

The stuff in <> filled in to suit your needs.

Note in linux the path separator is forward slash / not backslash \

What's the purpose of useragent string? I only use Kodi (currently) to connect.

RE: Compiling on Raspberry Pi - Added by Hiro Protagonist over 6 years ago

If your stream works without a useragent string, then run with that. Some servers block agents they don't know about [presumably attempting to block robots], so you can get around that by pretending to be something they recognise.

    (1-7/7)