Jump to content

Set thread count for FFmpeg decode (halves GPU memory during hw-trscd)


Recommended Posts

Posted (edited)

GPU memory usage for a single high quality file is more than 1.2Gb. The same file for Plex "costs" only around 600Mb.

That means, with a GPU with 2Gb of memory, I can have 3 transcoding streams at the same time on Plex, and only one on Emby. The second stream will start with CPU transcoding.

image.thumb.png.8042bf48056702f4280ac80b24e31621.png

The cause is that Emby does not set any FFmpeg decoding thread count (=auto). After setting the thread count to 1 using Diagnostics/Replace...

image.png.308dc546c0f5f712b894eabe26b2f0bc.png

... the memory usage is now totally normal and on par with Plex, without any noticeable performance loss.

image.thumb.png.1ef98276bf7f4b56dc353e6b8e4a3636.png

 

This seems like a very easy fix to be done, it would very much improve the hardware transcoding feature, and comes at no performance cost or any downside whatsoever that I can see.

Please consider fixing this soon.

Also, please note all these tests are done using the same source file.

This is a summary of the issue I opened here.


Thanks

Edited by Sungray
  • Like 1
Happy2Play
Posted

What is your Transcoding "Transcoding thread count:" set to?  Settings-Transcoding

Transcoding thread count:

Select the maximum number of threads to use when transcoding. Reducing the thread count will lower cpu usage but may not convert fast enough for a smooth playback experience. Not all encoders and decoders support multi-threading, so this may have an effect in some cases but not others.

 

Posted (edited)
49 minutes ago, Happy2Play said:

What is your Transcoding "Transcoding thread count:" set to?  Settings-Transcoding

Transcoding thread count:

Select the maximum number of threads to use when transcoding. Reducing the thread count will lower cpu usage but may not convert fast enough for a smooth playback experience. Not all encoders and decoders support multi-threading, so this may have an effect in some cases but not others.

 

Auto. Reducing it doesn't help.

image.thumb.png.11469cee1ccb1401cadd141b3081bd21.png

 

With transcoding thread count set to 1 :

image.png.55d597727cc018047d68e1bd63f344e2.png

First bump was when I still had the -copyts -threads:v:0 1 diagnostic/replace. Second is when I removed it.

I think this setting only impacts the encoding thread count. The decoding thread count is never set in the Emby ffmpeg cmd, and it should be set to 1.

Edited by Sungray
Posted
On 22/06/2022 at 00:19, Happy2Play said:

What is your Transcoding "Transcoding thread count:" set to?  Settings-Transcoding

Transcoding thread count:

Select the maximum number of threads to use when transcoding. Reducing the thread count will lower cpu usage but may not convert fast enough for a smooth playback experience. Not all encoders and decoders support multi-threading, so this may have an effect in some cases but not others.

 

Hello, did you get the chance to look into this?

Posted

Hello there!

@Happy2Play did you get a chance to look into this? Maybe confirm the problem, perhaps address it?

Again, I believe this is a big issue with an easy fix.

Posted

It is fixed already.

@Luke just needs to merge my changes.

Posted
7 hours ago, softworkz said:

It is fixed already.

@Luke just needs to merge my changes.

Thanks @softworkz.

  • 2 months later...
Posted

In which version will this fix become available? Any chance it gets pushed to be released in a stable version soon?

  • Like 1
Posted

In the latest betas, the transcoding thread count doesn't have an effect anymore.

It will be removed from the settings UI in a future update.

For hw decoders, the thread count is set to 1, for sw decoders it remains to be unset (= auto: use maximum reasonable amount).

Starting with  4.8.0.9, there is a new thread count parameter for the H264 and HEVC software encoders (in the codec parameters dialog).

  • Like 1
  • 1 month later...
Posted
10 minutes ago, Luke said:

@Sungray are you still having an issue with this?

Fixed on 4.8.0.9 beta.

  • Like 1
  • Thanks 1

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