Jump to content

GPU Transcoding (Intel QuickSync and nVidia NVENC)


witteschnitte

Recommended Posts

babgvant

any chance nVidia CUDA can also be utilized - I run Emby on Dell PowerEdge R710's and my CPU's do not have intel integrated gfx however I do have nVidia 750Ti's installed in them for CUDA support (nvenc)

 

I don't think ffmpeg added support for other HWA transcoding schemes.

Link to comment
Share on other sites

babgvant

Analysis of our current encoding command lines and what needs to change to utilize the features

 

@@Luke I found where it's embedded in the server code and added basic QSV decoder support (makes a reasonably big diff), but I'm not sure how to trigger all of the consumers (Web and Android App are covered). Can you let me know which clients use which streaming service?

Link to comment
Share on other sites

I don't think ffmpeg added support for other HWA transcoding schemes.

 

I figured based on this link http://ffmpeg.org/doxygen/trunk/nvenc_8c_source.html and https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/nvenc.c they have it enabled in FFMpeg - It does not utilize CUDA but it looks like it utilizes the same block of hardware that GameStream is utilizing when remote gaming.

 

I am willing to test it if someone would like to look into implementation.

Edited by mbnwa
Link to comment
Share on other sites

I must have missed that. LMK the codec names and I can have a look at how to add them.

Some of the details I have found are the following, it would seem the key is -vcodec nvenc

 

-c:v nvenc -preset llhq. Presets are

hq = high quality (I think libnvenc uses this)

hp = high performance

bd = Bluray Disk

ll = low latency

llhq = low latency high quality

llhp = low latency high performance 

default = between llhq and llhp, I suppose it's same as ll

 

I am not sure if this is what you are looking for or not but maybe it helps.

Link to comment
Share on other sites

babgvant

Unfortunately it looks like while ffmpeg can be built to support NEVC, you can't distribute (--enable-nonfree) it. It's not difficult to build ffmpeg on Linux using a build script like this one.

Edited by babgvant
Link to comment
Share on other sites

Ugh that sucks - Not sure if Emby can support the feature set and leave it up to user to compile ffmpeg with NEVC enabled

Link to comment
Share on other sites

Hi,

 

Just curious, how is development going on this?

 

I see that you have done some interesing thing in your fork babgvant.

 

Will they be merged with the official Emby?

 

//TjaLfE

Link to comment
Share on other sites

babgvant

I submitted a pull request for the HWA decoder enhancement (which has been very reliable and reduces load significantly in some cases). HWA encoding hasn't been as successful in testing. I can't get it to work reliably, so I think it's probably not a good idea to enable it yet (although it is all opt-in).

Link to comment
Share on other sites

babgvant

Narrowed down the issues with h264_qsv encoding to the scaling filter in ffmpeg. Unfortunately, I'm not sure why yet.

Link to comment
Share on other sites

Nice work babgvant.

 

I really think GPU Transcoding will be appreciated :)

 

Please keep us informed in progress, but surely take your time to do it right :D

 

//TjaLfE

Link to comment
Share on other sites

Tranquil

has anyone been able to get the QSV encoder to work reliably?

 

I made a post on DVBLink forums recently about HWA encoding. The devs, in that case Oberon, also mentioned big problems and unstable software. That's why they did not introduce HWA encoding yet.

 

Thread can be found here: http://forum.dvblogic.com/viewtopic.php?f=58&t=30034&p=105706#p105707

 

Maybe it would be a good thought to get in touch with them and exchange experiences!? 

Link to comment
Share on other sites

babgvant

I think the issue needs to be solved in ffmpeg directly. I plan to file a bug report when I understand the issue a bit more.

 

The unfortunate part is that even before it locks the process scaling has a 50% performance impact so it's clearly not using the scaling HW or if it is it's doing at least one GPU->system->GPU memory transfer in flight. Currently the only place where a GPU->system->GPU transfer should be required is when burning subtitles (overlaying surfaces), but that is supposed to be supported in a future release. Most likely this is an artifact of ffmpeg's design and will require significant effort on their part to resolve. Either way, still more efficient (for HD video) to do it that way than pure SW.

  • Like 1
Link to comment
Share on other sites

dark_slayer

Narrowed down the issues with h264_qsv encoding to the scaling filter in ffmpeg. Unfortunately, I'm not sure why yet.

 

I can't find the exact post I was looking for anymore. @@mjb2000 had noticed that within windows 8/8.1 if the frame-size didn't change then qsv would fail (I think). There was some discussion about it, and I thought it was in this topic but I can't find the specifics. There is some mention at the bottom of this post http://emby.media/community/index.php?/topic/10723-gpu-transcoding-intel-quicksync-and-nvidia-nvenc/?p=164569

Also http://emby.media/community/index.php?/topic/10723-gpu-transcoding-intel-quicksync-and-nvidia-nvenc/?p=177294

Link to comment
Share on other sites

  • 2 weeks later...
babgvant

Any news on how development og GPU transcoding i going? Or has it come to a standstill because of technical limitations?

 

Still going. I submitted a ticket on the scaling issue in ffmpeg. Support for decoding has been submitted as a pull request.

  • Like 1
Link to comment
Share on other sites

babgvant

My changes were around support for HWA decoding (which is not impacted by scaling issues). Encoding is still a discrete opt-in, so a merge shouldn't impact that.

Link to comment
Share on other sites

there's now a setting for intel quicksync hardware decoding in the server dev build, although unfortunately our source for windows builds doesn't include it at this time. perhaps someone can volunteer to help us with a new build for windows users.

Link to comment
Share on other sites

jmgriffes

there's now a setting for intel quicksync hardware decoding in the server dev build, although unfortunately our source for windows builds doesn't include it at this time. perhaps someone can volunteer to help us with a new build for windows users.

 

If you can hook me up with build instructions (and I apologize in advance if there's an easy guide somewhere), I can spin up a VM to do it tomorrow.

Link to comment
Share on other sites

jmgriffes

copy zeranoe verbatim

 

http://ffmpeg.zeranoe.com

 

Apparently others have asked and there's a line in the build script that can be uncommented to enable it:

 

https://ffmpeg.zeranoe.com/forum/viewtopic.php?t=2562

 

And we need both x86 and x64. thanks.

 

Oh, so the ffmpeg souce you're using doesn't contain QuickSync, versus the Server build source? (IE, I would only need to build ffmpeg?)

Link to comment
Share on other sites

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