belos
Posts: 2
Joined: Tue Nov 20, 2018 4:08 pm

Raspberry Pi TV Hat DVB-T2 Gateway (Tvheadend with FFmpeg and realtime hardware video stream transcoding)

Tue Nov 20, 2018 4:23 pm

This is a very-very short installation manual that gives 100% working result.
Hardware: Raspberry Pi 3 Model B and Raspberry Pi TV Hat.

1. Install Raspbian Jessie (not Raspbian Stretch!) and update the system.

2. Install Tvheadend v4.3 (unstable) as described here:
https://tvheadend.org/projects/tvheaden ... tories#fn3

3. Configure Tvheadend, and test viewing your air TV channels using default MPEG-TS Pass-through "pass" stream profile.

4. Download and compile OpenMAX-enabled FFmpeg:
https://www.reddit.com/r/raspberry_pi/c ... ith_ffmpeg

4. Run the following command and make sure you can see the test picture. This means that hardware acceleration works properly:

Code: Select all

"gst-launch-1.0 -v videotestsrc ! omxh264enc ! h264parce ! omx264dec ! glimagesink"

5. Create new streaming profile in Tvheadend web interface (Configuration->Stream->Stream Profiles) using "MPEG-TS Spawn/ built-in" type with the command line:

Code: Select all

"ffmpeg -i - -f mpegts -c:a copy -c:v h264_omx -b:v 368k pipe:1"

This will generate the stream with the bitrate about 500-600 kbit/s instead of several Mbit/s using GPU hardware transcoding.
During the transcoding CPU usage will not be higher than 40-60% comparing to 150% in case if you are using any other software transcoding. CPU temperature will not raise above 60-65°C.

Most probably this configuration will work on any Raspberry Pi (even on RPi Zero), of course, depending on the input signal complexity.
I also have Kodi on my RPi Zero connected to TV that is used as a client system for the described installation.

Hope this info will help someone. I´m open for any comments and questions.

fruitoftheloom
Posts: 19569
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Raspberry Pi TV Hat DVB-T2 Gateway (Tvheadend with FFmpeg and realtime hardware video stream transcoding)

Tue Nov 20, 2018 6:23 pm

belos wrote:
Tue Nov 20, 2018 4:23 pm
This is a very-very short installation manual that gives 100% working result.
Hardware: Raspberry Pi 3 Model B and Raspberry Pi TV Hat.

1. Install Raspbian Jessie (not Raspbian Stretch!) and update the system.

2. Install Tvheadend v4.3 (unstable) as described here:
https://tvheadend.org/projects/tvheaden ... tories#fn3

3. Configure Tvheadend, and test viewing your air TV channels using default MPEG-TS Pass-through "pass" stream profile.

4. Download and compile OpenMAX-enabled FFmpeg:
https://www.reddit.com/r/raspberry_pi/c ... ith_ffmpeg

4. Run the following command and make sure you can see the test picture. This means that hardware acceleration works properly:

Code: Select all

"gst-launch-1.0 -v videotestsrc ! omxh264enc ! h264parce ! omx264dec ! glimagesink"

5. Create new streaming profile in Tvheadend web interface (Configuration->Stream->Stream Profiles) using "MPEG-TS Spawn/ built-in" type with the command line:

Code: Select all

"ffmpeg -i - -f mpegts -c:a copy -c:v h264_omx -b:v 368k pipe:1"

This will generate the stream with the bitrate about 500-600 kbit/s instead of several Mbit/s using GPU hardware transcoding.
During the transcoding CPU usage will not be higher than 40-60% comparing to 150% in case if you are using any other software transcoding. CPU temperature will not raise above 60-65°C.

Most probably this configuration will work on any Raspberry Pi (even on RPi Zero), of course, depending on the input signal complexity.
I also have Kodi on my RPi Zero connected to TV that is used as a client system for the described installation.

Hope this info will help someone. I´m open for any comments and questions.

Raspbian Jessie is no longer supported and any user not aware will try this on the 3B+ / 3A+......
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Buster.
Raspberry Pi Model 2B v1.1

belos
Posts: 2
Joined: Tue Nov 20, 2018 4:08 pm

Re: Raspberry Pi TV Hat DVB-T2 Gateway (Tvheadend with FFmpeg and realtime hardware video stream transcoding)

Wed Nov 21, 2018 8:35 am

Thanks, that´s right. But sometimes we have to use old, but proved solutions to achieve the desired result.

gkreidl
Posts: 5924
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Raspberry Pi TV Hat DVB-T2 Gateway (Tvheadend with FFmpeg and realtime hardware video stream transcoding)

Wed Nov 21, 2018 9:36 am

My rtranscode V4 package offers a complete transcoding solution which works with different backends on both Jessie and Stretch. Transcoding on Jessie is more efficient though because the gst-omx module has implemented hardware scaling, which is missing in the Stretch version.

viewtopic.php?f=38&t=123876
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

fanoush
Posts: 448
Joined: Mon Feb 27, 2012 2:37 pm

Re: Raspberry Pi TV Hat DVB-T2 Gateway (Tvheadend with FFmpeg and realtime hardware video stream transcoding)

Wed Nov 21, 2018 12:47 pm

Just wondering what type of trancoding (resolution? codec types?) is this targeted for? Can this transcode HEVC/h265 to h264 in realtime on pi3b+? Or does it trancode mpeg-2 to h264? Can it do mpeg-2 in realtime without paid HW codec?

Return to “HATs and other add-ons”