Jump to content

Recommended Posts

TolkienBard
Posted

Since HW transcoding is still listed as experimental in the dashboard, I would not be surprised to see I am missing something in the setup, however; my new machine has a Nvidia 960 GTX, which, as I understand it, is up to the task of doing the task. So, I went ahead and selected NVENC and saved the settings. However, when ffmpeg runs, it is still dumping the load on the processor. The processor can handle it just fine, but the entire reason for the GPU's existence in the machine to begin with was to assist with HW transcoding.

 

Do I need to change some other setting or alter any scripts to get the server to start using the GPU for transcoding duties?

Posted

You need to supply your own ffmpeg build when using hardware encoders. if you're on windows, a good place to get it is here:

https://ffmpeg.zeranoe.com/builds/

Little question Luke : do still have licence stakes with NVENC decoding feature or not? Because it could be simplier to take the Zeranoe builds which support all of these special features and CPU decoding as well and to include them into Emby server releases no?

 

 

Sent from my iPhone using Tapatalk

Posted

 

Hi,

 

just registered because of that topic.

 

I am on Ubuntu 16.04 with and Intel N3700 which supports Vaapi which I already use with Kodi, but transcoding seems not to work with emby

 

I tried quicksync in the past, but to be honest its a mess to get in running, especially in a "up to date" environment

 

The ffmpeg of Ubuntu doesnt come with vaapi support, so i downloaded one from here      http://johnvansickle.com/ffmpeg/ and linked it as suggested.

 

now i get the needed result

  

 V..... h264_vaapi           H.264/AVC (VAAPI) (codec h264)
 V..... hevc_vaapi           H.265/HEVC (VAAPI) (codec hevc)
 V..... mjpeg_vaapi          MJPEG (VAAPI) (codec mjpeg)
 
and i setup transcoding in Emby to vaapi
 
and 
 /dev/dri/card0 
is also existent, but its still not working :(
 
when I lower the data rate, that it has to decode, it stops immediately and also when I just play with full Network capacity it still takes 100% CPU 
 
any hints what I can try?
 
Looking forward for a fast solution, if this works like a charm you will have sold another lifetime
 
 
EDIT
OK,
found something, but no clue howto to fix it yet
 
libva info: Trying to open /home/john/.custom.software/src/static/lib/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
[AVHWDeviceContext @ 0x3c3c640] Failed to initialise VAAPI connection: -1 (unknown libva error).
[vaapi @ 0x31171e0] Failed to create a VAAPI device
 
 
I have no john on my system ;)
 
so i guess ffmpeg is build stange or  wrong from  john van sickle?
 
when i just link 
 
/home/john/.custom.software/src/static/lib/dri/i965_drv_video.so -> /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
 
 will result in a coredump

 

 

EDIT2

this is getting a self-talk ;)

 

fixed the above error with an new ffmpeg (ubuntu really sucks at this point)

 

 

when i do  your ffmpeg comman as root now its working (with 50% cpu rate :))))) ) 

Input stream #0:0 frame changed from size:1920x800 fmt:yuv420p to size:1920x800 fmt:vaapi_vld
frame=   31 fps=0.0 q=-0.0 size=     445kB time=00:00:01.44 bitrate=2530.3kbits/s speed=2.76x
frame=   77 fps= 74 q=-0.0 size=     928kB time=00:00:03.33 bitrate=2278.4kbits/s speed=3.22x
frame=  127 fps= 83 q=-0.0 size=    1622kB time=00:00:05.49 bitrate=2417.0kbits/s speed=3.58x
frame=  173 fps= 85 q=-0.0 size=    2477kB time=00:00:07.36 bitrate=2753.2kbits/s speed= 3.6x
frame=  221 fps= 86 q=-0.0 size=    2972kB time=00:00:09.36 bitrate=2601.1kbits/s speed=3.66x

 

but as user emby

 

 [AVHWDeviceContext @ 0x258cd40] No VA display found for device: /dev/dri/card0.

[vaapi @ 0x63b0e8] Failed to create a VAAPI device

 

so added user emby to group video 

 

libva info: va_getDriverName() returns 1
libva error: va_getDriverName() failed with operation failed,driver_name=i965
[AVHWDeviceContext @ 0x2386ce0] Failed to initialise VAAPI connection: 1 (operation failed).
[vaapi @ 0x63b0e8] Failed to create a VAAPI device
 
hopefully edit3 will follow soon with permissions solved ;)
 
EDIT3
 
Yes, I got it working now
 
the issue was not depending on permissions anymore
 
/dev/dri/card0 was just bloyked already via kodi
 
so changing it to 
 
  /dev/dri/renderD128
 
did the trick.
 
now i can transcode on the fly with 50% cpu usage at max!!! 
 
the limiting factor is IO now :)))
 
had 4 transcode running at the same time and only waiting cause of IO 
 
Awsome guys, will immediately purchase a lifetime now
 
If someone interested in a howto i can sort it up a bit I guess
 
and a hint as well, the transcoding infos in the Board are really poor to be honest all depending on ffmpeg (of course it is), but get this all up and running (especially on Linux) isn`t really an easy task ;)

 

 

 

 

Which ffmpeg did you end up using?  I'm stuck at the "john" part...   Getting close though... ;)

Posted (edited)

I was lazy and took it from djcj

 

 https://launchpad.net/~djcj/+archive/ubuntu/hybrid

 

sudo add-apt-repository ppa:djcj/hybrid

sudo apt-get update

sudo apt-get dist-upgrade

 

but u will see the result is not that nice as expected, a lot of artefacts comin with Vaapi

Edited by schamane
TolkienBard
Posted (edited)

You need to supply your own ffmpeg build when using hardware encoders. if you're on windows, a good place to get it is here:

https://ffmpeg.zeranoe.com/builds/

 

I don't suppose I am lucky enough that I can just drop the 64-bit static build in the Emby Server ffmpeg file and be done am I?

 

That would be far too easy and would not seem very much like a developmental product. 

 

I  may just have a silly powerful vid card on my headless server for a while until I can figure out how to adapt codecs and all that jazz so that I can take advantage of NVENC hardware transcoding, especially for those 48 TB of Roku thumbnails..

Edited by TolkienBard
Posted

Use the configuration under playback -> transcoding.

Posted

I don't suppose I am lucky enough that I can just drop the 64-bit static build in the Emby Server ffmpeg file and be done am I?

 

That would be far too easy and would not seem very much like a developmental product.

 

I may just have a silly powerful vid card on my headless server for a while until I can figure out how to adapt codecs and all that jazz so that I can take advantage of NVENC hardware transcoding, especially for those 48 TB of Roku thumbnails..

You suppose right! I did this!

 

Take the static build, put it whenever you want, go in playback/transcoding as @@Luke mentionned, select the path to your ffmpeg (be careful to put also the ffbprobe from the static build in the same directory). And you're done!

 

After that, launch a transco (from a hd movie and force a transco from any client by putting 1 Mbps for instance). Try a long playback to test (like 10 minutes). If your playback stop after 3 or 5 minutes please inform us!

 

Welcome in the wonderful GPU transcoding world!

 

 

Sent from my iPhone using Tapatalk

TolkienBard
Posted

Well, setting it up was easy enough, I just replaced the ffmpeg and ffbprobe with the static ones. Sweet! I specified custom path (which the server had already detected). But trying to play HD content to my tablet (since my other PCs are running Emby Theatre and don't need to transcode), I get a generic playback error. I looked for the transcode log and there is indeed one there. I tried a few more movies, they all came up with the same issues.

 

I attached the log from the most recent attempt to stream a movie.

ffmpeg-transcode-0d25fbd7-b5d6-41b5-a87f-77cf90e63644.txt

TolkienBard
Posted (edited)

A completely fresh install of everything seems to have fixed this. Now, instead of my CPU ramping up to nearly 100% every time one or more ffmpeg processes run, it is running down closer to 13%. This is a huge improvement as ffmpeg obviously never needed anything close to the full processing power of the new i7 6700K processor.

 

Edit: From what I can tell, ffmpeg does not offload to the GPU when running for creating Roku thumbnails. Is this correct?

Edited by TolkienBard
  • Like 1
Posted (edited)

A completely fresh install of everything seems to have fixed this. Now, instead of my CPU ramping up to nearly 100% every time one or more ffmpeg processes run, it is running down closer to 13%. This is a huge improvement as ffmpeg obviously never needed anything close to the full processing power of the new i7 6700K processor.

 

Edit: From what I can tell, ffmpeg does not offload to the GPU when running for creating Roku thumbnails. Is this correct?

Could you install GPUZ and see if your gpu is really used?

 

 

Sent from my iPad using Tapatalk

Edited by jscoys
TolkienBard
Posted

CPUID HW Monitor is showing between 0-14% on GPU value when there is transcoding occuring. The rest of the time it sits idle at 0%. 

Posted

Those look like great numbers to me.

Posted

CPUID HW Monitor is showing between 0-14% on GPU value when there is transcoding occuring. The rest of the time it sits idle at 0%.

Is "enable throttling" option checked?

 

 

Sent from my iPhone using Tapatalk

TolkienBard
Posted

Is "enable throttling" option checked?

 

 

Sent from my iPhone using Tapatalk

I had to get home to check. Yes, "Enable throttling" is checked on the transcoding options screen.

Posted

I had to get home to check. Yes, "Enable throttling" is checked on the transcoding options screen.

Ok could you try to transcode and play a movie for at least 10 minutes and confirm it works?

 

 

Sent from my iPad using Tapatalk

TolkienBard
Posted (edited)

Ok could you try to transcode and play a movie for at least 10 minutes and confirm it works?

 

 

Sent from my iPad using Tapatalk

It is not, in fact, working for me right now. It turns out all of my results above were achieved without HW acceleration. When NVENC is selected, playback of actual titles results in "Video Error" There was an error playing the video. I have attached the logs. And here I was crediting the lower CPU load to the HW when it was just the CPU doing its thing.

ffmpeg-transcode-644a4aa9-e120-4743-bd7e-101cd29981d0.txt

ffmpeg-transcode-fc8861ad-69cc-4075-9ecc-59d882bd13a3.txt

server-63608263163.txt

ffmpeg-transcode-ab9f5d9a-4a3e-43fb-b010-352183ed5ea8.txt

Edited by TolkienBard
TolkienBard
Posted

Obviously I am missing a step somewhere. I just pulled the latest static release from yesterday and tried dropping ffmpeg and probe both into:

 

C:\Users\James\AppData\Roaming\Emby-Server\ffmpeg\20160410\ffmpeg.exe

 

That overwrites the ffmpeg version that comes bundled into Emby. I wind up with the same unable to play error when attempting to use NVENC.

Posted (edited)

Obviously I am missing a step somewhere. I just pulled the latest static release from yesterday and tried dropping ffmpeg and probe both into:

 

C:\Users\James\AppData\Roaming\Emby-Server\ffmpeg\20160410\ffmpeg.exe

 

That overwrites the ffmpeg version that comes bundled into Emby. I wind up with the same unable to play error when attempting to use NVENC.

I cannot remember if on the stable version you can point emby to a different directory that contains ffmpeg but on the beta one you are able to. Go to Settings>Playback>Transcoding and there should be an option for "ffmpeg Version" which will then let you specify a directory that contains a different version of ffmpeg then the one that comes with emby. I believe you have to enable hardware encoding first before it will unlock the field though(unless it has changed).

Edited by robertp221
TolkienBard
Posted

I cannot remember if on the stable version you can point emby to a different directory that contains ffmpeg but on the beta one you are able to. Go to Settings>Playback>Transcoding and there should be an option for "ffmpeg Version" which will then let you specify a directory that contains a different version of ffmpeg then the one that comes with emby. I believe you have to enable hardware encoding first before it will unlock the field though(unless it has changed).

For some reason my brain skipped over the fact that I need not copy/paste the ffmpeg into the default folder, even though I was verifying where it went using the "custom location" entry. Alas, simply redirecting Emby to look for the newer version of ffmpeg downloaded from Zeranoe did not fix the issue. I wound up with the same behaviour as when I moved the new static version to the default server location.

 

Any other thoughts on why this is not working? 

Posted (edited)

Don't remember the version it began with, but for my part Nvenc transco doesn't work anymore.

 

 

Sent from my iPhone using Tapatalk

Edited by jscoys
Posted

The emby command line hasn't changed, but I think it's a matter of working together to determine external dependencies.

Posted

The emby command line hasn't changed, but I think it's a matter of working together to determine external dependencies.

What do you mean by determine external dependencies? What can we do to help Luke?

 

 

Sent from my iPhone using Tapatalk

Posted

In other words, I implemented this from the Emby side of things, or rather, I accepted a community pull request that simply passes the proper instructions to ffmpeg to utilize Nvenc. Any system requirements that might exist in terms of drivers, driver settings, supported gpu's, I don't have the answers to all of these things so this is where community help is needed.

Posted (edited)

I am using Zeranoe FFmpeg Build Version: 2793ebd (2016-09-08) (Static x64 bit) Looks like it utilizes my GTX-1070x and its great. I can also see "-h264_nvenc" switch is used in transcoder logs.

But ffmpeg.exe still utilizes CPU times arround %20-25. Is this normal? (Throttling enabled and srt subtitles involved)

 

z4MFOEX.png

Edited by denethor

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...