Jump to content
Florux

MB Server OSX - Extreme CPU load while transcoding

Recommended Posts

Florux

Hello,

 

I am in the process of moving from Plex to MediaBrowser, and have noticed that the server load when transcoding is rather extreme.

 

Server: MediaBrowser Server Version 3.0.5518.3
Hardware: Mac Mini (2011) with 2.7GHz Intel Core i7 with 8GB RAM running OSX 10.9.5
 
Client: Nexus 7 (Android 5.0.2) running MediaBrowser version 2.2.03
 
 
Network: Same subnet, Nexus 2 meters away from high speed access point with 1GE link to MacMini
 
Symptom: ffmpeg using 372% CPU, Mac Mini getting warm, fan going full speed.
 
The file being transcoded is as follows. Have not changed any default transcode settings. Server set to "Auto". 
Codec: H264
Profile: High
Level: 41
Resolution:1920x1080
Aspect ratio:16:9
Anamorphic: No
Interlaced: No
Framerate: 23.97602
Bitrate: 10732 kbps
Bit depth: 8 bit
Pixel format: yuv420p
Ref frames: 4
CABAC: Yes
 
Pictures of system load:
While transcoding, extreme load:
54e63f11b98c4_ScreenShot20150219at173440
 
After transcoding, normal load:
54e63f3e24208_ScreenShot20150219at173525
 
As you can see it's a huge difference.
 
I have run Plex Media Server for a few years, and it manages to transcode multiple sessions to multiple different clients without getting the same extreme load. 
 
Is this due to a horrible misconfiguration on my end, or a bug in how MediaBrowserServer on OSX uses ffmpeg?
 
Attached is what I presume to be the correct transcode log.
 
Please advise - this is my first experience with Media Server, and first day of using it, and as I didn't find this referenced anywhere, I figured this would probably be the place to ask.
 
Thanks much in advance!
 
 
 
 

Share this post


Link to post
Share on other sites
Logos302

As far as I know this is normal, it is set to trans-code as fast as possible.  But shares the cpu with other tran-scoding sessions just fine.

  • Like 1

Share this post


Link to post
Share on other sites
Florux

Thanks for quick response! 

 

I'm a bit puzzled if this is normal as the CPU load now is many times higher than multiple similar transcoding loads on Plex, which I believe also uses ffmpeg. I also found the picture to be a tad more grainy here, so I have been a bit reluctant to lower the transcode quality. I know full well it's not a good habit to compare too much to previously used, competing solutions. However, in this case I would say the difference is so big that it could constitute a real problem.

 

 -Florux

Share this post


Link to post
Share on other sites
Florux

Hi again,

 

I tried changing the transcoder settings to both Fast and Higher Quality, as well as Max Quality, and there was no noticable difference in CPU usage between them. It all maxed out at 370-380% CPU usage.

 

 -Florux

Share this post


Link to post
Share on other sites
Logos302

I've never used plex so I'm not sure about how it does it transcoding but just because it uses ffmpeg does not mean that it uses it the same way.  MB3 tries to transcode the whole file as fast as possible so that it's finished, and the server can get on doing what ever else it needs too.   But @@Luke or @@ebr can probably give you a better explanation of what is happening then me.  

Share this post


Link to post
Share on other sites
Tuxedo

Hi again,

 

I tried changing the transcoder settings to both Fast and Higher Quality, as well as Max Quality, and there was no noticable difference in CPU usage between them. It all maxed out at 370-380% CPU usage.

 

 -Florux

 

If you look at BaseStreamingService.cs you can see the various settings used for each of those depending on what codec is being used for your client. It maxes out because ffmpeg is going to transcode the whole video to HLS (or MPEG-DASH) unless you have throttling on, in which case ffmpeg will be getting paused and unpaused.

 

I've never used plex so I'm not sure about how it does it transcoding but just because it uses ffmpeg does not mean that it uses it the same way.  MB3 tries to transcode the whole file as fast as possible so that it's finished, and the server can get on doing what ever else it needs too.

This. emby kicks off ffmpeg to reencode the video to HLS in 3 second chunks (at least that's what it does for my AndroidTV clients) and it takes full advantage of your system to produce each one.

 

Looking at TranscodingThrottler.cs, if you have the throttler turned on it'll check every 5 seconds to see how far ahead the encode process is compared to how much of the video has been downloaded. ffmpeg will get paused every now and then as the server lets the client catch up, but any moment when ffmpeg is running it'll be working as hard as possible.

Edited by Tuxedo

Share this post


Link to post
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...