Project

General

Profile

Cant't transcode with NVENC

Added by Andre-Guy Otis 9 months ago

Hello,

I tried to compile tvheadend from git but I can't get the NVENC transcoder working. I configure the build with --enable-nvenc

I was able to compile without error but once I tried to use the H264_NVENC, I got this error:

2021-01-28 19:48:48.248 transcode: 0001: 01:H264: [mpeg2video => h264_nvenc]: encode failed

I also tried the latest stable release for Debian Stretch TVH 4.2.8 and that one is working correctly. One thing I noticed is from the codec profile tab, the H264_NVENC preset is not present. However, this preset is available on TVH 4.2.8 version, see images in attachment.

I'm sure there is something wrong when I compile TVH from git but I don't know what I'm doing wrong. Can you guys give me an hint about this?


Replies (84)

RE: Cant't transcode with NVENC - Added by dorin ilut 5 months ago

I just did a build using the internal ffmpeg. It works great with nvidia, if you do not select hardware accelerated. I can see the GPU working, CPU level is low, picture quality is great. if HW accelerated is clicked it does the error with filters.

The only issue I see is that dvbsub is not passed when using copy on the streaming profile on VLC based players (tested on IOS and windows with VLC). Oddly enough it works in KODI.

RE: Cant't transcode with NVENC - Added by Kiril St. 5 months ago

dorin ilut wrote:

The only issue I see is that dvbsub is not passed when using copy on the streaming profile on VLC based players (tested on IOS and windows with VLC). Oddly enough it works in KODI.

I read somewhere, that this is bug in vlc player, try SMPlayer, works perfect!

RE: Cant't transcode with NVENC - Added by saen acro 5 months ago

Kiril St. wrote:

dorin ilut wrote:

The only issue I see is that dvbsub is not passed when using copy on the streaming profile on VLC based players (tested on IOS and windows with VLC). Oddly enough it works in KODI.

I read somewhere, that this is bug in vlc player, try SMPlayer, works perfect!

Or show output of stream in ffprobe

RE: Cant't transcode with NVENC - Added by dorin ilut 5 months ago

all working quite well. i am noticing these in the log (viewing experience is not affected). just putting this here as a FYI.

2021-05-21 13:26:19.535 tsfix: transport stream MPEG2VIDEO, DTS discontinuity. DTS = 1495606907, last = 1495624907
2021-05-21 13:26:19.546 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1495610507) <= last (1495624907), dropping frame
2021-05-21 13:26:19.550 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1495614107) <= last (1495624907), dropping frame
2021-05-21 13:26:19.636 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1495621307) <= last (1495624907), dropping frame
2021-05-21 13:26:19.640 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1495624907) <= last (1495624907), dropping frame
2021-05-21 13:26:19.972 tsfix: transport stream MPEG2VIDEO, DTS discontinuity. DTS = 1495650107, last = 1495664507
2021-05-21 13:26:19.975 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1495650107) <= last (1495664507), dropping frame
2021-05-21 13:26:19.978 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1495653707) <= last (1495664507), dropping frame
2021-05-21 13:26:20.125 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1495657307) <= last (1495664507), dropping frame
2021-05-21 13:26:20.130 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1495664507) <= last (1495664507), dropping frame
2021-05-21 13:26:20.392 tsfix: transport stream MPEG2VIDEO, DTS discontinuity. DTS = 1495693307, last = 1495700507
2021-05-21 13:26:20.403 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1495693307) <= last (1495700507), dropping frame
2021-05-21 13:26:20.426 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1495700507) <= last (1495700507), dropping frame
2021-05-21 13:26:20.872 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1495736507) <= last (1495736507), dropping frame
2021-05-21 13:26:29.928 tsfix: transport stream MPEG2VIDEO, DTS discontinuity. DTS = 1496557307, last = 1496560907
2021-05-21 13:26:29.937 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1496557307) <= last (1496560907), dropping frame
2021-05-21 13:26:29.984 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1496560907) <= last (1496560907), dropping frame
2021-05-21 13:26:41.941 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1497637307) <= last (1497637307), dropping frame
2021-05-21 13:28:02.112 transcode: 0002: 01:H264: [mpeg2video => h264_nvenc]: Invalid pts (1504851707) <= last (1504851707), dropping frame

RE: Cant't transcode with NVENC - Added by Jonathan Young 5 months ago

Just like to say that it works for me too (after applying the fix to profile.c) in Kodi.

However, I can't get the codec preset to work correctly. I think nvenc now needs p1 ... p7 rather than Slow, Medium or Fast etc. The only option that does not throw a warning is Default.

Would it be possible to add these options when using nvenc?

RE: Cant't transcode with NVENC - Added by dorin ilut 4 months ago

Did the update to 4.3-1966~g04853f0da. it's running well. still getting the same messages as my previous post, but it's running.

RE: Cant't transcode with NVENC - Added by kosacik 1 2 months ago

I am facing same issues using NVENC transcoding. My tvh version is tvheadend_4.3-1975, but the same is with 1940.
I thought, it is an nvidia driver issue, so i tried few versions. But it is always the same. Then i found, that if Watching via kodi, it looks like session is not exited correctly and remains running in gpu memory (nvidia-smi), but When using vlc, memory is clearing itself fine (same profile). One session takes around 80MB, so after 50 chanell changes, only sound remains :-)

RE: Cant't transcode with NVENC - Added by Flole Systems 2 months ago

So you aren't facing this issue but you're facing the "session not cleaned" issue? There's a patch for that on GitHub (which is not perfectly correct but works for now), so you might want to try that.

RE: Cant't transcode with NVENC - Added by saen acro 2 months ago

When building FFMPEG with full nvidia hardware acceleration decode/encode/resize/deinterlace

--enable-cuda-nvcc
--enable-cuvid
--enable-nvenc
--enable-cuda-llvm
--enable-libnpp

!!! libnpp cannot be statically linked.
llbnpp need to be instaled on OS

@ Flole Systems can be maked more detailed check and informing message when some of them missing.

(76-84/84)