Jump to content

Mac Mini (2018) final transcoding showdown, inconsistent playback


kezzism

Recommended Posts

kezzism

It's been a while

 

Just got Emby working on my 2018 Mac Mini which is more or less dedicated to being a media server. Works well but when someone starts playing a video that needs transcoding the CPU ramps up a ton for about two minutes for FFMPEG to transcode the file and have it ready. This has been the case since I first turned it on, starting with 'Enable Hardware Transcoding' set to 'yes' and no other options touched.

 

I realized that hypothetically I should be able to access whatever QuickSync/T2 based hardware acceleration this thing has via whatever FFMPEG Emby is using, so I checked out 'advanced' and then saw VideoToolbox which I guess acts as a wrapper for any hardware interfaces Apple would expose. I know there have been other threads talking about this, but none of them seem conclusive. Either way, turned it on, then things really started to get interesting.

 

The CRF setting never changed, I've always had it set to 23 (default) but for some reason when VideoToolbox was on the quality of the transcode dropped like a rock! Even in the client trying to tell it to get 60Mbps 1080p still resulted in the same blocky mess.

 

Disappointed with the results I decided to turn the Enable hardware acceleration when available back from advanced to yes and there I started encountering different problems. The Video quality went back to normal but I noticed sometimes in the clients I tried to use (chrome on another computer) the video would never start playing. I'd get a somewhat normal looking log file but I would never see the client playing information in the dashboard and the video would never start!

Restarted the computer and things seemed normal. Yet sometimes I'm having a hard time getting transcoded videos to play now using Chrome.

 

I wanna start by addressing the source of my first issue : Is hardware encoding on the Mac Mini ever going to actually be a viable thing or should I give up?

 

I will include two logs which resulted from trying to play one file, the first time with the software AVC encoder and the second with VideoToolbox.

 

There's some weird stuff going on here, without turning VideoToolBox on, the encoder goes through and checks if hardware transcoding is viable:
 

>>>>>>  Affected codecs
Encoder libx264 Software Encoder
        Profiles: Baseline Profile (Level 6.2), Main Profile (Level 6.2), High Profile (Level 6.2), High 10 Profile (Level 6.2), High 4:2:2 Profile (Level 6.2), High 4:4:4 Predictive Profile (Level 6.2)


>>>>>>  FindVideoEncoder - Media: h264, UseHardwareCodecs: True, Mode: Automatic
Info    Checking: 'libx264 Software Encoder'
Info    Check successful - selecting 'libx264 Software Encoder'

>>>>>>  FindVideoDecoder - MediaType: h264, Mode: Automatic
Info    Checking: 'Automatic software decoder'
Info    Check successful - selecting 'Automatic software decoder'

>>>>>>  Processing Plan
Info    Name                                        CanDoInHardware      WillDoInHardware     Reason                                  
Info    Automatic software decoder               >> False                False                Software Codec                           
Info    VideoInput                               >> False                False                Not a hardware decoder                   
Info    SubtitleBurnIn                           >> False                False                                                         
Info    VideoOutput                              >> False                False                Not a hardware encoder                   
Info    libx264 Software Encoder                 >> False                False                Software Codec                           

>>>>>>  Projected Processing Formats
Info    Previous                HW-Context   Format       SW-Format       Next
Info    h264                 >> -            yuv420p      yuv420p      >> subtitles
Info    subtitles            >> -            yuv420p      yuv420p      >> 

It seems to think it can't be done in hardware because it has subtitles. But with VideoToolBox turned on, it somehow makes due:
 

Affected codecs:
>>>>>>  VideoToolbox H.264
        Profiles: Baseline Profile (Level 6.2), Main Profile (Level 6.2), High Profile (Level 6.2), High 10 Profile (Level 6.2), High 4:2:2 Profile (Level 6.2), High 4:4:4 Profile (Level 6.2)


>>>>>>  FindVideoDecoder - MediaType: h264, Mode: Custom
Info    FindVideoDecoder - Checking: 'Automatic software decoder' (Priority: 0)
Info    FindVideoDecoder - Check successful - selecting 'Automatic software decoder'

>>>>>>  FindVideoEncoder - Media: h264, UseHardwareCodecs: True, Mode: Custom
Info    FindVideoEncoder - Checking: 'VideoToolbox H.264' (Priority: 100)
Info    Encoder supports input stream
Info    FindVideoEncoder - Check successful - selecting 'VideoToolbox H.264'

This is the first area of confusion and the first thing I'd like input on. I'll see if I still have difficulty getting playback to start later. Hopefully someone else who has a similar MacMini with the same processor (3.2 GHz Intel Core i7) can help me out.

Thanks

 

VideoToolBox_Off.txt

VideoToolBox_On.txt

Link to comment
Share on other sites

Hi we haven't quite given videotoolbox as much attention as the other hardware acceleration platforms, but yes as you can see the transcoding is able to complete and it looks like it performed quite well. Did it not play successfully?

Link to comment
Share on other sites

kezzism

Okay, this is interesting. I was able to get things back to normal (had to restart my DAS that's attached to the Mac Mini for some reason) and after turning VideoToolBox back on the log output is very... interesting!

 

It seems to attempt to use VideoToolBox as I've seen it do in the past:

Encoder VideoToolbox H.264
        Profiles: Baseline Profile (Level 6.2), Main Profile (Level 6.2), High Profile (Level 6.2)


>>>>>>  FindVideoEncoder - Media: h264, UseHardwareCodecs: True, Mode: Custom
Info    Checking: 'VideoToolbox H.264'
Info    Check successful - selecting 'VideoToolbox H.264'

>>>>>>  FindVideoDecoder - MediaType: h264, Mode: Custom
Info    Checking: 'Automatic software decoder'
Info    Check successful - selecting 'Automatic software decoder'

But now a days it seems to 'give up' before I can capture any evidence of quality degredation:

Info    Previous transcoding attempt failed. Falling back to software transcoding.

Thankfully now that the system is back to 100% this all happened very quickly and the software encoder stepped in before a user could realize.

But I'm still curious to find out why it worked once (albeit poorly) and now doesn't seem to be a thing.

I'm gonna leave VideoToolbox on and report any additional information here

 

thanks

VideoToolbox_TranscodeAttempt.txt

Edited by kezzism
Link to comment
Share on other sites

For the sake of simplification, can you turn off subtitles prior to playback? Because those subtitles are having to be burned in with transcoding which comes at a very high cost.

Link to comment
Share on other sites

kezzism

With Subs turned off it enters directPlay which works with no issues.

I guess the difficulty here is getting any T2/QuickSync tasks to work with Subtitle burn in which I know is an intense process but on unsupported clients totally worth the cost.

 

I'm surprised it worked that one time and I might want to look back at that transcode log and see exactly what the output was. I think there's real promise here for VideoToolbox; but right now things should be just fine using the softwareEncoder since there isn't that much demand and when a transcode finishes (in under two minutes) it goes back to consuming very little resources and works as expected.

 

See if it's something you get to play around with, feels like it has real potential to speed up all newer mac servers.

 

Thanks

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