Tvheadend Transcode and HW minimum

Added by Jan Konečný 7 months ago

Hello, I have a machine here where the G41M-VS3 motherboard with CPU Core 2 Duo E7300 at 2.66 GHz and 4 GB RAM
I accept about 60 programs from DVB-T and I would like to transcode them to a smaller bit rate. Will this machine be enough if I take into account that some 10 clients with Kodi could join this machine? Now it has a stream of about 5-10 Mbit and I would like to reduce it to about 1.5 Mbit per stream.
And one more question. Do you have any pattern how to set the profile in the stream to the transcode ??

Thank you very much for your advice


Replies (17)

RE: Tvheadend Transcode and HW minimum - Added by saen acro 7 months ago

Take some newer nVidia GPU.
10x0 series.

RE: Tvheadend Transcode and HW minimum - Added by Jan Konečný 7 months ago

like to add ???? not enough Radeon R9 260x ??

RE: Tvheadend Transcode and HW minimum - Added by Jan Konečný 7 months ago

would I even have 1050?

RE: Tvheadend Transcode and HW minimum - Added by saen acro 7 months ago

Jan Konečný wrote:

like to add ???? not enough Radeon R9 260x ??

If you find way to make AMD gpu to transcode write manual, lot of people will like it.

With 1050 without problem.

RE: Tvheadend Transcode and HW minimum - Added by Alex Mills 7 months ago

best to check compatibility here https://developer.nvidia.com/video-encode-decode-gpu-support-matrix

note on low end gpu's only support max of 2 streams

(it seems to be per system not per gpu card ie 2 1050s still only allow 2 concurrent encodes)

RE: Tvheadend Transcode and HW minimum - Added by saen acro 7 months ago

Alex Mills wrote:

best to check compatibility here https://developer.nvidia.com/video-encode-decode-gpu-support-matrix

note on low end gpu's only support max of 2 streams

(it seems to be per system not per gpu card ie 2 1050s still only allow 2 concurrent encodes)

better not to read for nvidia's software limits
https://github.com/keylase/nvidia-patch

RE: Tvheadend Transcode and HW minimum - Added by Jan Konečný 7 months ago

So with 1050, only two streams could be transcoded in one outace ???

RE: Tvheadend Transcode and HW minimum - Added by Alex Mills 7 months ago

saen acro wrote:

Alex Mills wrote:

best to check compatibility here https://developer.nvidia.com/video-encode-decode-gpu-support-matrix

note on low end gpu's only support max of 2 streams

(it seems to be per system not per gpu card ie 2 1050s still only allow 2 concurrent encodes)

better not to read for nvidia's software limits
https://github.com/keylase/nvidia-patch

awesome post, i hoped there was such a release :-)

gracias

RE: Tvheadend Transcode and HW minimum - Added by Jan Konečný 7 months ago

So, no chance without a graphics card to get the stream down on my machine? Quietly with the worse image variant.

RE: Tvheadend Transcode and HW minimum - Added by A T 7 months ago

And one more question. Do you have any pattern how to set the profile in the stream to the transcode ??

Just try it for yourself.

1)Go config -> Stream -> Codec profiles

Check for webtv_xxx or create one with the codec of choice.
Here are the settings you want to play with btw.

2)Next go config -> Stream -> Stream profiles
Add a transcode profile and use the video codec you wish (from last step)

3)Now in Kodi for example set up the addon to use your stream profile or make transcode your default.

Now you can play with the settings and check your cpu usage.

I guess you need some kind of gpu.
BTW maybe you can look for the upcoming j5005.
I have a j4205 and atm i can transcode up to 4 HD streams (same input even more) with the igpu.
Its just drawing 10w and approx. the same cost as one of the capable nvidia gpus...

RE: Tvheadend Transcode and HW minimum - Added by sirk98 qwerty98 5 months ago

saen acro wrote:

Alex Mills wrote:

best to check compatibility here https://developer.nvidia.com/video-encode-decode-gpu-support-matrix

note on low end gpu's only support max of 2 streams

(it seems to be per system not per gpu card ie 2 1050s still only allow 2 concurrent encodes)

better not to read for nvidia's software limits
https://github.com/keylase/nvidia-patch

hello,

I bought an gtx 1050 ti nvidia card, but I m not able to use the respawn option so that server can use external ffmpeg...
I also compiled tvheadend with nvenc support, that seems to work, but when I run nvidia-smi I see only tvheadend and if I run top I see that tvheadend eating cpu a lot, over 150% .

The followed steps on ubuntu 17.10 are :
installed cuda and nvidia drivers
patched nvidia driver 390
compiled and installed ffmpeg
compiled and installed tvheadend with static ffmpeg + nvenc

Please give ne an hints,
best regards
sirk98

RE: Tvheadend Transcode and HW minimum - Added by saen acro 5 months ago

Do you use GUI?
And is only nvidia drivers used?

RE: Tvheadend Transcode and HW minimum - Added by sirk98 qwerty98 5 months ago

Hello,

I installed ubuntu server and I don't use GUI.
I don't know if only nvdia drivers are used.. Can you explain what I need to check for clear your requests ?

But I 'd like to use this server only with tvh+gtx card for reduce the bitrate of the streams .
I can't find an how to that explain what are the right steps, and after a little search I read that ubuntu 17.10 server don't working good with nvidia drivers...

I'm really lost . :(

RE: Tvheadend Transcode and HW minimum - Added by saen acro 5 months ago

Even 18.04 work without problems

RE: Tvheadend Transcode and HW minimum - Added by sirk98 qwerty98 5 months ago

Ok,

but can you explain what are the right steps that I have to follow to make the best configuration ?

1 install ubuntu server 18.04
2 install latest nvidia driver for gtx 1050 ti
3 patch driver
4 install cuda --------->> is needed or not ?
5 compile tvheadend ------------->> (ffmpeg static or not, enable-nvenc or not, enable-libav or not ) ----------->> here I m a little confuse
6 compile external FFmpeg ------------->> yes or no ?

what are the missing steps ?

RE: Tvheadend Transcode and HW minimum - Added by sirk98 qwerty98 5 months ago

Hello this is the result with my configuration.. Nvenc profile h264-nvenc + aac
5 streams are not stable and freezing ... How use mpegts respawn profile ?

but can you explain what are the right steps that I have to follow to make the best configuration ?

1 install ubuntu server 18.04
2 install latest nvidia driver for gtx 1050 ti
3 patch driver
4 install cuda --------->> is needed or not ?
5 compile tvheadend ------------->> (ffmpeg static or not, enable-nvenc or not, enable-libav or not ) ----------->> here I m a little confuse
6 compile external FFmpeg ------------->> yes or no ?

what are the missing steps ?

Schermata 2018-04-15 alle 13.05.00.png - CPU Load 5 streams (79.3 KB)

Schermata 2018-04-15 alle 13.05.57.png - nvidia-smi output (101 KB)

RE: Tvheadend Transcode and HW minimum - Added by sirk98 qwerty98 5 months ago

Hello,

after more and more research on the web I found a way to get some things work .
1 install ubuntu server 17.10
2 download and install nvidia driver for installed card ( gtx 1050 ti in my case )
3 download and install cuda tools kit that is needed for many things like the ffmpeg building step
4 compile and install tvh
5 compile and install FFmpeg with nvidia support

6 start with tvh configuration and with the channel scan
7 create stream profile with respawn option and add a link to ffmpeg custom script .

Now I can reduce the bit rate of my streams via the external GPU, but I need an help to fix my ffmpeg script that I thing is not the best :
#!/bin/bash
/home/hts/ffmpeg -fflags +genpts -nostats -nostdin -hide_banner -loglevel quiet -hwaccel_device 0 -hwaccel cuvid -c:v h264_cuvid -deint 2 -drop_second_field 1 -surfaces 10 -resize 1280x720 -i -map 0:v -c:v h264_nvenc -preset fast -profile:v high -rc vbr -cq 1 -bf 2 -b:v 2200k -minrate 2200k -maxrate 2200k -bufsize 3002k -map 0:a -c:a libfdk_aac -ac 2 -b:a 128k -strict experimental -f mpegts

Can some one help me to find the best script to have a good result ?
Actually result is good but screen sometimes becomes black or images are interrupted by freeze .

Best regards
sirk98

Schermata 2018-04-17 alle 00.55.48.png - stream profile spawn option (145 KB)

(1-17/17)