Jump to content

Recommended Posts

Posted

ok so this whole emby thing is new to me, just installed it 2 days ago, still learning. One thing I can't seem to get working is NVENC. using a 980ti with the latest drivers and any time video transcodes my cpu is 100% and my gpu is 0%. double checked the setting is on. Checked the log for ffmpeg and 'nvenc' is no where in it. I dunno what I'm doing wrong. help?

 

I attached a log for the transcode.

ffmpeg-transcode-083ecc88-13fe-41ae-a43f-99f4b19742af.txt

brando56894
Posted

I haven't gotten it to work, but you need to use an FFMPEG build that has nvenc support compiled in. If you're using Windows, you can use the builds found here https://ffmpeg.zeranoe.com/builds/, in Linux either compile from source of grab it from your distro's repository.

Posted

thanks for the reply... I got the newest version and pointed emby at it and now it's kinda working. I still get 70-80% cpu usage and 8-16% gpu usage... not as good as I had hoped but better than nothing I suppose. Checked the log and it looks correct now. Thanks again.

Posted

I'm finding NVENC working properly now using my 1050 video card. I'm using the latest driver that came out this month from Nvidia and ffmpeg built Jan. 25th from Zeranoe. I have three transcoding sessions in progress using less than 20% CPU load.

Are your 3 streams hardware acceletated??  NVENC is limited to 2 streams at once, but since Emby cuts down the stream in smaller chunks, it might be able to do more than 2 (do the 3rd file between chunks of the 2 first ones)...  Thanks for the info, very curious about this stuff.

Posted

I can't say for sure but it's working a lot better than it was before where the CPU usage was through the roof. It is quite possible it needs more improvements however I find it stable.

 

Sent from my STV100-3 using Tapatalk

Posted

Since my last post a few weeks ago, I've been fighting with this. And it still doesn't flippin' well work!!!!

 

I did find this little useful tidbit on the Arch Linux Wiki:

 

 

 

VAEntrypointVLD means that your card is capable to decode this format, VAEntrypointEncSlice means that you can encode to this format.

 

My vainfo doesn't show any encode profiles, hence why it won't encode. But the stupid thing is my graphics card (Kaveri GPU on the processor - A8-7600) allegedly supports VCE encode profiles. I've messed about in the BIOS, I've fiddled around re-encoding mesa, and I'm totally at a loss as to why this won't work. I'm toying with the idea of putting a spare nVidia card in the box, but I'll have to swap it's place with a NIC, which always results in a lot of fun! Plus I'll need to compile in all the VDPAU support! 

 

So... uh... I dunno. 

 

Anybody else got VAAPI working with an AMD APU?

  • 2 weeks later...
Posted (edited)

I haven't gotten it to work, but you need to use an FFMPEG build that has nvenc support compiled in. If you're using Windows, you can use the builds found here https://ffmpeg.zeranoe.com/builds/, in Linux either compile from source of grab it from your distro's repository.

 

Can you point out a specific version for Windows with a direct link? Currently trying since I had to replace my card and chose an passive Nvidia GT730 Kepler based, so it should work. But when I start a movie with the last zeranoe ffmpeg one, the stream never starts.

 

edit: Do I need to install the Video Codec SDK by Nvidia?

 

edit 2: OK managed to install the latest card driver, but performance seems not as fast as I thought. With the attached log, the GPU is heavy loading (checked with GPU-Z), but the CPU is also heavy loaded (but not as much than without NVENC)..

 

Anything I miss? Any help or little how to is greatly appreciated. Or am I just expecting too much? 

ffmpeg-transcode-e76da33c-bedd-4630-9bce-a6e642a6838f.txt

Edited by shorty1483
Waldonnis
Posted

Can you point out a specific version for Windows with a direct link? Currently trying since I had to replace my card and chose an passive Nvidia GT730 Kepler based, so it should work. But when I start a movie with the last zeranoe ffmpeg one, the stream never starts.

 

edit: Do I need to install the Video Codec SDK by Nvidia?

 

edit 2: OK managed to install the latest card driver, but performance seems not as fast as I thought. With the attached log, the GPU is heavy loading (checked with GPU-Z), but the CPU is also heavy loaded (but not as much than without NVENC)..

 

Anything I miss? Any help or little how to is greatly appreciated. Or am I just expecting too much? 

 

You shouldn't need the SDK at all, as everything needed for this type of operation is in the video driver already.  Looks like you figured that out already, but worth noting in case others are curious.

 

Looking over the log, the performance is a bit on the low side, but it's transcoding at a rate that's still well above the source's framerate so it shouldn't be an issue when streaming the output.  Most of the processor load is probably demuxing, decoding of both the video and audio streams, downscaling the video, and downmixing/resampling/re-encoding the audio (a small amount of overhead involved in shuffling data to/from the video card as well, but that shouldn't be much of a hit at all).  A lot of those operations can't be done on a GPU and end up having to be done on the processor; all we're asking the GPU to do in cases like this is encode an already-decoded video stream at a given target bitrate (or quality, depending on the options chosen).  If you really want to see what operations are taxing the CPU, you can always try each operation separately (e.g. only transcoding the audio with no video stream present, or transcoding only the video stream with vs. without scaling).

 

From what I see in the logs, I'm not sure that you'll be able to do significantly better with that particular transcoding situation, though.  Not sure it matters, since it's processing speed is still surpassing the native framerate enough so that you won't see a playback interruption from buffer depletion.  When it comes to hardware (and general) transcoding performance, there are a lot of factors that could affect it - I/O speeds (reading the source and writing the transcoded segments), processor capabilities, existing system/bus load, source file's codecs, and much more.  Also, the source material itself DOES matter quite a bit when it comes to transcoding speed, so try a few different types of videos (darker, lighter, animated, tons of motion, and such) to see if any of them transcode at an unacceptable rate.  It's quite possible that the file you logged is just more work to transcode than another may be.  One file/case just isn't enough to draw any conclusions from, so if you find any that can't transcode at an acceptable rate, then there's a real cause for concern that someone like me can help you look into.

 

Also, it may be worth trying two or more transcoding jobs at once to see how it affects the overall system load and the performance of each job...if for no other reason than to see what your server can handle before choking or dropping to unacceptable transcoding speeds.

  • Like 1
Posted (edited)

@@Waldonnis Thanks for clarification. Just recognized that with 2 streams GPU transcoded, I get around 120-140 fps overall with smaller load on the CPU. That's an improvement to the CPU transcoding before (80 fps overall with 100% CPU load). Also encoding in e.g. DVDFab with Cuda is now at 140 fps compared to 7-30 fps before :D

 

Overall this is absolutely enough for me since tha card was just a cheap reaplacement for my old dead AMD one with this additional benefit.

 

Last question:

 

1. With NVENC, does the CRF preset, encoding preset, throttling and number of transcoding threads have any influence?

Edited by shorty1483
Waldonnis
Posted

@@Waldonnis Thanks for clarification. Just recognized that with 2 streams GPU transcoded, I get around 120-140 fps overall with smaller load on the CPU. That's an improvement to the CPU transcoding before (80 fps overall with 100% CPU load). Also encoding in e.g. DVDFab with Cuda is now at 140 fps compared to 7-30 fps before :D

 

Overall this is absolutely enough for me since tha card was just a cheap reaplacement for my old dead AMD one with this additional benefit.

 

Last question:

 

1. With NVENC, does the CRF preset, encoding preset, throttling and number of transcoding threads have any influence?

 

Nice to hear  :)

 

There doesn't seem to be a CRF "mode" with ffmpeg's NVENC implementation - it seems to only have a QP equivalent and ignores the -crf option entirely (admittedly, I never played with vbr_minqp, which may end up being CRF-esque).  For QP encoding, it also ignores the -qp option and instead relies on setting "-rc constqp", along with global_quality (to set the quantizer value; none of this is documented in the help for some reason).  I'm not sure if Emby is using these options right now for live transcoding.  It may just be targeting a bitrate instead, since the main reason for many "live" transcodes is bitrate anyway.  Performance-wise, changes to target quality or bitrate will affect the encoding performance, but to varying degrees depending on the source material...and often not even enough to really care about.  Total encoding time for a normal 2hr movie source may have a 1-2min variance or less for typical bitrate/quality value ranges, in my experience.

 

I'm not sure about the throttling, as I never really looked into what that really does from an ffmpeg perspetive.  And for threads, even single-threading a GPU encode shouldn't have much of a performance impact on the video side (and is required when using hardware decoding), but it will likely slow down audio encodes a bit, as single-threading ffmpeg affects the entire process (including demux, decoding, etc.).  There are situations when single-threading encodes is a good idea or even necessary, but they don't really apply to what Emby does outside of maybe trying to use hardware decoding as well.  Compelling cases could be made for values like "# of CPU cores - 1", but that's more determined by individual taste/needs and server usage requirements.

  • Like 1
Posted

I'm finding NVENC working properly now using my 1050 video card. I'm using the latest driver that came out this month from Nvidia and ffmpeg built Jan. 25th from Zeranoe. I have three transcoding sessions in progress using less than 20% CPU load.

Thinking of replacing my 2nd Generation i5 era computer as my Emby server. Would you expect hardware transcoding to work with this computer which has a 1060 card? I don't game but currently can't hardware transcode which would be ideal.

 

https://www.fatwallet.com/forums/hot-deals/1555989

Posted

Hey Guys,

 

I've just installed emby and have issues with QS. I've a ASRock N3150 running Ubuntu 16.04, it's capable of hw-decoding H265 8 Bit at least, couldn't test 10 bit yet. If I want to play a H265 movie via browser the playback won't start. I looked in the log files and saw that ffmpeg is always started with the switch

 

"-codec:v:0 h264_qsv"

 

although it's H265 content and fails with

 

"Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height"

 

Does anybody have suggestions on that?

 

Posted

Hey Guys,

 

I've just installed emby and have issues with QS. I've a ASRock N3150 running Ubuntu 16.04, it's capable of hw-decoding H265 8 Bit at least, couldn't test 10 bit yet. If I want to play a H265 movie via browser the playback won't start. I looked in the log files and saw that ffmpeg is always started with the switch

 

"-codec:v:0 h264_qsv"

 

although it's H265 content and fails with

 

"Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height"

 

Does anybody have suggestions on that?

 

Hi @@Gerrit507, please attach the complete ffmpeg log. thanks.

  • Like 1
Posted

For starters you may want to try a newer ffmpeg build:

https://www.johnvansickle.com/ffmpeg/

 

After that if the issue persists then yes it looks like some kind of adjustment may be needed for the command line. thanks.

  • Like 1
Posted (edited)

Hi all! I've been following this thread for ages, but was awaiting support from Unraid for things like an i915 driver :)

 

I got this working with Plex (docker) but now I'm trying to make Emby work with QSV or VAAPI but none of them are working.

 

When enabling QSV, there's no errors in the logs, but there's also no mention to QSV. When choosing VAAPI I get the "Failed to create a VAAPI device".

 

How can one pass the dri device to Embry? For Plex docker I pass this as an extra parameter "--device /dev/dri:/dev/dri".

 

I added this to Emby but still nothing. As for permissions:

drwxr-xr-x 2 root root          100 Feb 26 20:08 dri/

crwxrwxrwx 1 root video 226,   0 Feb 26 20:08 card0
crwxrwxrwx 1 root video 226,  64 Feb 26 20:08 controlD64
crwxrwxrwx 1 root video 226, 128 Feb 26 20:08 renderD128
 
Any hints?
 
Appreciate!
 
Edit:
 
cpuinfo
 
# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 60
model name      : Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz
stepping        : 3
microcode       : 0x1e
cpu MHz         : 1600.036
cache size      : 6144 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts
bugs            :
bogomips        : 7000.10
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
Edited by anthonws
Posted

@@anthonws, the server transcoding configuration screen allows you to specify that.

Posted

@@anthonws, the server transcoding configuration screen allows you to specify that.

 

Hi Luke! Thanks for the reply.

 

Unfortunately that does not work.

 

Just to make sure, I need to pass the "--device /dev/dri:/dev/dri" in the docker config first, right?

[AVHWDeviceContext @ 0x3979800] No VA display found for device: /dev/dri/card0.
[vaapi @ 0x30321e0] Failed to create a VAAPI device

Thanks!

Posted

For starters you may want to try a newer ffmpeg build:

https://www.johnvansickle.com/ffmpeg/

 

After that if the issue persists then yes it looks like some kind of adjustment may be needed for the command line. thanks.

 

 

I added the latest git version and it's not using qsv. Do I need to add something?

 

Also, why is the a ffmpeg and ffmpeg-10bit? Tried that also, but it seems to be 10bit only right?

log.txt

10bit-log.txt

Posted

What does not work specifically?

Posted

I added the latest git version and it's not using qsv. Do I need to add something?

 

Also, why is the a ffmpeg and ffmpeg-10bit? Tried that also, but it seems to be 10bit only right?

 

Just use the regular ffmpeg. We have not tested 10-bit builds and therefore are not in a position to provide support for that.

  • Like 1
Posted

Just use the regular ffmpeg. We have not tested 10-bit builds and therefore are not in a position to provide support for that.

Ok the log.txt is with the normal version, it's not using qsv :/

Posted

Ok the log.txt is with the normal version, it's not using qsv :/

 

The server checks the build for support and prints out the decoders and encoders that it finds. try restarting the server, then you'll see these tests near the beginning of the main server log.

  • Like 1
Posted

What does not work specifically?

 

When choosing VAAPI video does not play.

 

The error, like stated, is:

[AVHWDeviceContext @ 0x3979800] No VA display found for device: /dev/dri/card0.
[vaapi @ 0x30321e0] Failed to create a VAAPI device

VA API Device is set to "/dev/dri/card0".

 

When choosing QSV, video plays but it's clearly doing SW Transcoding (4 cores working intensively).

 

Thanks!

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...