Project

General

Profile

Nvidias NVENC

Added by Stephan Oelze almost 9 years ago

Hello!

is anyone using Nvidias NVENC for Streaming?
How to so?

regarding to this:
https://tvheadend.org/attachments/3688/qsv-fix.patch

this is allready in the code?

Thanks!
Stephan


Replies (14)

RE: Nvidias NVENC - Added by Brian Shensky almost 9 years ago

Well, you're not alone. I just compiled 4.1-1255 and I see the nvenc options in the Stream Profiles -> Video codec preset dropdown. I tried to use the nvenc options but the video encoder just gave up and only audio was enabled on the transport stream. Here's some debug...

2015-12-26 17:40:46.246 transcode: 0017: Using preset hp
2015-12-26 17:40:46.247 libav: Error setting preset/tune hp/(null).
2015-12-26 17:40:46.247 libav: Possible presets:
2015-12-26 17:40:46.247 libav:  ultrafast
2015-12-26 17:40:46.247 libav:  superfast
2015-12-26 17:40:46.247 libav:  veryfast
2015-12-26 17:40:46.247 libav:  faster
2015-12-26 17:40:46.247 libav:  fast
2015-12-26 17:40:46.247 libav:  medium
2015-12-26 17:40:46.247 libav:  slow
2015-12-26 17:40:46.247 libav:  slower
2015-12-26 17:40:46.247 libav:  veryslow
2015-12-26 17:40:46.247 libav:  placebo
2015-12-26 17:40:46.247 libav: Possible tunes:
2015-12-26 17:40:46.247 libav:  film
2015-12-26 17:40:46.247 libav:  animation
2015-12-26 17:40:46.247 libav:  grain
2015-12-26 17:40:46.247 libav:  stillimage
2015-12-26 17:40:46.247 libav:  psnr
2015-12-26 17:40:46.247 libav:  ssim
2015-12-26 17:40:46.247 libav:  fastdecode
2015-12-26 17:40:46.247 libav:  zerolatency
2015-12-26 17:40:46.247 transcode: 0017: Unable to open libx264 encoder
2015-12-26 17:40:49.587 libav: frame size not set
2015-12-26 17:40:54.483 transcode: 0017: Detected framedrop in audio
2015-12-26 17:40:59.925 webui: Stop streaming /stream/channel/711bf533c5cf6ea215b9784170598026?ticket=D5B6D0DE2023628215826F268E3EA7F9FCE8DD9F, muxer reported errors

RE: Nvidias NVENC - Added by Stephan Oelze almost 9 years ago

Yep stombeling into same error :)

Dec 27 18:52:46 skynet daemon.info tvheadend[22641]: mpegts: 1 in easy_rtl - tuning on IPTV
Dec 27 18:52:46 skynet daemon.info tvheadend[22641]: subscription: 0004: "HTTP" subscribing on channel "1", weight: 100, adapter: "IPTV", network: "easy_rtl", mux: "1", provider: "CBC", service: "RTL HD", profile="webtv-h264-aac-matroska", hostname="10.3.0.10", username="root", client="VLC/2.2.1 LibVLC/2.2.1" 
Dec 27 18:52:59 skynet daemon.info tvheadend[22641]: transcode: 0004: 1:H264 1920x1080 ==> H264 1920x1080 (libx264)
Dec 27 18:52:59 skynet daemon.info tvheadend[22641]: transcode: 0004: 2:AC3 ==> AAC (aac)
Dec 27 18:52:59 skynet daemon.warn tvheadend[22641]: TS: easy_rtl/1/RTL HD: TELETEXT @ #32 Continuity counter error (total 1)
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: transcode: 0004: missing meta data for H264
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: non-existing PPS 0 referenced
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: decode_slice_header error
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: no frame!
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: transcode: 0004: Using preset default
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: libav: Error setting preset/tune default/(null).
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav: Possible presets:
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  ultrafast
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  superfast
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  veryfast
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  faster
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  fast
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  medium
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  slow
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  slower
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  veryslow
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  placebo
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav: Possible tunes:
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  film
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  animation
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  grain
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  stillimage
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  psnr
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  ssim
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  fastdecode
Dec 27 18:53:00 skynet daemon.info tvheadend[22641]: libav:  zerolatency
Dec 27 18:53:00 skynet daemon.err tvheadend[22641]: transcode: 0004: Unable to open libx264 encoder
Dec 27 18:53:00 skynet daemon.warn tvheadend[22641]: parser: The timediff for TELETEXT is big (1113780013), using current dts
Dec 27 18:53:03 skynet daemon.warn tvheadend[22641]: libav: frame size not set

i will build tracelog tomorrow.

RE: Nvidias NVENC - Added by Stephan Oelze almost 9 years ago

@Prof Yaffle

its done through by:
https://tvheadend.org/issues/3438

its just possible now to build a statis ffmpeg with NVENC support as
ffmpeg is supporting this out of the box since 06.2015
https://ffmpeg.org/pipermail/ffmpeg-cvslog/2015-June/090257.html

Anyway, it dosent work for me. i am going to provide traced log soon.

RE: Nvidias NVENC - Added by Prof Yaffle almost 9 years ago

Stephan Oelze wrote:

its done through by:
https://tvheadend.org/issues/3438

Yes, that's the same thing - I linked the commit that addressed that issue. If there's still a problem, grab a log and/or post a new issue. I haven't tried building with this option as I don't have any (realistic) systems with NVidia chippery.

RE: Nvidias NVENC - Added by Stephan Oelze almost 9 years ago

Here is the trace attached. Normal software encode and a try to use NVENC.
I setup NVENC un my ubuntu 14.04.3 Server on a sepparated fresh install.
There is an ready build .deb for my distro from nvidia i used:
http://developer.download.nvidia.com/compute/redist/ffmpeg/1511-patch/FFMPEG-with-NVIDIA-Acceleration-on-Ubuntu_UG_v01.pdf

RE: Nvidias NVENC - Added by Stephan Oelze almost 9 years ago

found the log of my CUDA toolkit installation:

Do you accept the previously read EULA? (accept/decline/quit): accept
You are attempting to install on an unsupported configuration. Do you wish to continue? ((y)es/(n)o) [ default is no ]: y
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 352.39? ((y)es/(n)o/(q)uit): y
Do you want to install the OpenGL libraries? ((y)es/(n)o/(q)uit) [ default is yes ]: y
Install the CUDA 7.5 Toolkit? ((y)es/(n)o/(q)uit): y
Enter Toolkit Location [ default is /usr/local/cuda-7.5 ]: /usr/cuda-7.5
Do you want to install a symbolic link at /usr/local/cuda? ((y)es/(n)o/(q)uit): y
Install the CUDA 7.5 Samples? ((y)es/(n)o/(q)uit): y
Enter CUDA Samples Location [ default is /root ]:
Installing the NVIDIA display driver...
Installing the CUDA Toolkit in /usr/cuda-7.5 ...
Missing recommended library: libGLU.so
Missing recommended library: libXi.so
Missing recommended library: libXmu.so

Installing the CUDA Samples in /root ...
Copying samples to /root/NVIDIA_CUDA-7.5_Samples now...
Finished copying samples.

=========== = Summary = ===========

Driver: Installed
Toolkit: Installed in /usr/cuda-7.5
Samples: Installed in /root, but missing recommended libraries

Please make sure that
- PATH includes /usr/cuda-7.5/bin
- LD_LIBRARY_PATH includes /usr/cuda-7.5/lib64, or, add /usr/cuda-7.5/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run the uninstall script in /usr/cuda-7.5/bin
To uninstall the NVIDIA Driver, run nvidia-uninstall

Please see CUDA_Installation_Guide_Linux.pdf in /usr/cuda-7.5/doc/pdf for detailed information on setting up CUDA.

Logfile is /tmp/cuda_install_15006.log

RE: Nvidias NVENC - Added by Hafeez Ahmad almost 9 years ago

I was struggling with the same issue and was able to compile ffmpeg with nvenc myself but somehow ffmpeg as part of tvheadend kept compiling without nvenc.

I configured tvheadend with:
./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libexecdir=${prefix}/lib/tvheadend --disable-maintainer-mode --disable-dependency-tracking --enable-libffmpeg_static --enable-hdhomerun_static --enable-dvbcsa --enable-bundle --arch=x86_64 --enable-nvenc

It showed nvenc was enabled but ffmpeg kept compiling without nvenc because it missed the option: --enable-nonfree --enable-nvenc
setting "EXTRAARG += --enable-nvenc --enable-nonfree" from Makefile.ffmpeg doesn't seem to get enabled, only "ENCODERS += nvenc_h264 nvenc_hevc" is enabled.

I fixed this by adding in the last FFMPEG section in Makefile.ffmpeg: $(EXTRAARG) \:
...
--prefix=/ffmpeg \
$(EXTRAARG) \
--disable-all \
...

After a make & make install you will get new options nvenc_h264 & nvenc_hevc in the tvheadend stream profiles for Video codec.
You need to choose this one for nvenc.

Log will show nvenc is used:
Feb 6 15:41:37 ubuntu tvheadend: transcode: 001D: 1:MPEG2VIDEO 720x576 > H264 720x576 (nvenc_h264)
Feb 6 15:41:37 ubuntu tvheadend: transcode: 001D: 2:MPEG2AUDIO > AAC (aac)
Feb 6 15:41:38 ubuntu tvheadend: transcode: 001D: Using preset hq

I can now transcode 2 streams at once with my passive cooled GT720 :)

Maybe someone who has knowledge of coding can fix this in the source code.

RE: Nvidias NVENC - Added by David Mainem over 8 years ago

Just out of curiosity. I am using Ubuntu 16.04 Beta right now.
From what i have read i must have the Cuda SDK and the Nvidia driver min. Version 352 installed.

Both things are in the Xenial Repos, could it be so easy to install both and recompile a recent TVHeadend 4.1 to work?

RE: Nvidias NVENC - Added by Henry Madsen Jensen over 8 years ago

Hi I cant get TVH to configure using switch --enable-nvenc, I just get an error.

checking for cc nvEncodeAPI.h ...                 fail
ERROR: NVENC library (https://developer.nvidia.com/nvidia-video-codec-sdk) not found

Have tried to install nvidia driver + CUDA SDK, can someone make a step by step guide to how and what i need to install to make it work

RE: Nvidias NVENC - Added by Acid Rain over 7 years ago

Something new?
It is working now out of the box?
(with TvHeadEnd autobuild script?)
I'm thinking about to buy me a passive GTX Card, to get a bit less CPU usage on my DELL PowerEdge T20

Regards

    (1-14/14)