Jump to content

FFMPEG at 50-60% of 10-core CPU whenever I launch a new recording


sward
 Share

Recommended Posts

On 10/21/2021 at 9:20 PM, sward said:

 

BTW, I don't see Intel QuickSync as an option under Video HW acceleration types, although it is listed as an option in the transcoding section.

The server and Emby Theater are two distinct parts, so the playback hardware decoding is not related to the server transcoding hardware acceleration. Does that make sense?

Link to comment
Share on other sites

sward

@cayars I'm just saying it would be nice to figure out why HW acceleration isn't working on desktop version for MPEG2, so I can make the switch from Windows store app, which currently supports HW acceleration for MPEG2 but needs to transcode b/c of wtv container.

Link to comment
Share on other sites

I think you may be confusing a couple of things.
Are you running Theater on the server machine?  If so run it from a different computer so that you're not seeing any server processes when looking at CPU/GPU use.

For example if I run them on the same computer with the store version I see it transcode and I see hardware decoding taking place but this is from the server, not theater.
Same for the desktop version if I force a transcode.

This makes sense because if using hardware to transcode you want both the decode and encode taking place in hardware to remove the CPU from shuffling data around.
But for display purposes for mpeg2 video it's usually not needed and could be more overhead for any little gain of decoding in HW.  Mpeg2 HW decoding is often times turned off in software by default on many platforms such as MPV (used in Theater desktop).  You can certainly read more about this on the MPV website and even create your own config files for MPV that Emby will use and can test this yourself and force it's use.

Link to comment
Share on other sites

  • 3 weeks later...
sward

@cayars"Mpeg2 HW decoding is often times turned off in software by default on many platforms such as MPV (used in Theater desktop).  You can certainly read more about this on the MPV website and even create your own config files for MPV that Emby will use and can test this yourself and force it's use."

After tinkering with this a bit more, CPU utilization with the desktop version of Emby Theater drops from ~15% down to 1 or 2% if I disable deinterlacing, and yes, I'm running both server & theater on the same machine by necessity. Why wouldn't deinterlacing be done in hardware by the GPU? Definitely need to turn it on b/c most of my cablecard recordings are interlaced (1080i), and the interlacing is visible if I leave this off.

Link to comment
Share on other sites

sward

Well I don't see this type of high CPU utilization with the Windows app if it doesn't need to transcode. That tells me that the Windows app is de-interlacing in hardware, whereas the desktop version isn't.

Link to comment
Share on other sites

I don't see that kind of CPU use on any of my machines. But it's going to depend on the machine and it's abilities.
For a simple codec like mpeg2 it's often better to software decode it.

With desktop Theater and MPV you can certainly adjust how this works on any system.

Link to comment
Share on other sites

sward

Since I want to run the desktop version of Emby Theater, I've decided to deinterlace my CableCard TV recordings during the editing process. This will enable me to playback MPEG2 recordings with minimal CPU utilization (~2-5%). 

  • Like 1
Link to comment
Share on other sites

sward

So I tried deinterlacing an MPEG2 recording with VideoRedo, and it takes a really long time (like 10 minutes instead of 1), even using the BOB method which is the simplest. I then tried using an mpv.conf file to force HW deinterlacing 'on the fly' using the following custom commands:

hwdec-codecs=all
hwdec=yes
vf=d3d11vpp=deint=yes:interlaced-only=yes

This seemed to get everything working the way I want, but the video locks up after less than a minute. Any ideas?

Link to comment
Share on other sites

1 hour ago, sward said:

So I tried deinterlacing an MPEG2 recording with VideoRedo, and it takes a really long time (like 10 minutes instead of 1), even using the BOB method which is the simplest. I then tried using an mpv.conf file to force HW deinterlacing 'on the fly' using the following custom commands:

hwdec-codecs=all
hwdec=yes
vf=d3d11vpp=deint=yes:interlaced-only=yes

This seemed to get everything working the way I want, but the video locks up after less than a minute. Any ideas?

So this is playing the completed recording after this process is done?

Link to comment
Share on other sites

sward

I'm discussing two separate topics:

1) Deinterlacing an MPEG2 recording with VideoRedo, which takes a really long time (like 10 minutes instead of 1), although resulting video quality and playback are good.

2) Trying instead to deinterlace MPEG2 recordings in HW 'on the fly' using a custom mpv.conf file (details in my previous post). This seemed to get everything working the way I want, but the video playback locks up after less than a minute.

My preferred approach would be #2 above, as it doesn't require me to do anything special (once the mpv.conf file is configured correctly), whereas option#1 above is a cumbersome workaround requiring a major re-encoding of my MPEG2 recordings (i.e. no 'fast frame' copying seems to be available when deinterlacing with VideoRedo).

Link to comment
Share on other sites

Hmm, to be honest I'm not sure. I haven't heard of that happening before.

Link to comment
Share on other sites

sward

Do you have any 11th gen Core-i9 processors you can test against? Perhaps the new onboard graphics (UHD Graphics 750) are incompatible with version of MPV currently bundled with Emby Theater.

Link to comment
Share on other sites

12 hours ago, sward said:

1) Deinterlacing an MPEG2 recording with VideoRedo, which takes a really long time (like 10 minutes instead of 1), although resulting video quality and playback are good.

2) Trying instead to deinterlace MPEG2 recordings in HW 'on the fly' using a custom mpv.conf file (details in my previous post). This seemed to get everything working the way I want, but the video playback locks up after less than a minute.

My preferred approach would be #2 above, as it doesn't require me to do anything special (once the mpv.conf file is configured correctly), whereas option#1 above is a cumbersome workaround requiring a major re-encoding of my MPEG2 recordings (i.e. no 'fast frame' copying seems to be available when deinterlacing with VideoRedo).

10 minutes does not sound bad at all depending on what you're doing.  Keep in mind when you deinterlace a file you're essentially transcoding it so it will take a bit of time. This isn't as simple as doing s remux.

Deinterlacing isn't CPU intensive, nor is decoding MPEG2 for that matter.  It also depends of course on the type of deinterlacing you're doing and what frame rate.

Just my opinion but I think you're  trying to get the 15% CPU down while running both the server and client on the same machine.  Sure you can do that but at a cost  that may or may not matter.  For example if you have an Nvidia consumer card you only get 2 or 3 simultaneous decode/encodes to use. So if you move decoding to the GPU for something very light weight and easy on the CPU to do you end up burning a "slot" that could be used for actual transcoding streaming. If you only have one or two streams from your server at a time it likely doesn't matter but if you stream to other family and friends this could come into play.  If you take up a slot that could have been used by Emby to transcode h.265 you'll pay the price later and wish you had the 15% CPU use back. :)

Almost all players being sold these days (hardware or software) can most easily handle deinterlacing of MPEG2 and give you a choice of a single or double frames which you really want for sports or fast paced action. If you pre-deinterlace the file keeping it as MPEG2 and play it back on a client that could have de-interlaced on it's own you actually diminished the quality of the video. You don't really want to do that.

If on the other hand if you are cutting out the commercials and then preparing to keep these permanently you will want to convert them to H.264 or H.265 and it certainly makes sense to deinterlace at that point in the conversion as you won't take a quality hit for doing it then.

So the point is that there are reasons why many software packages do not use hardware to deinterlace MPEG2 and do it strictly in software.

Link to comment
Share on other sites

  • 2 weeks later...

I ended up configuring VLC as my external player. Not only does it de-interlace perfectly in hardware with only 1-2% CPU utilization, but the video playback quality is far superior to MPV. It's like going from DVD to Blu-ray, and furthermore VLC can play anything you throw at it. Would be great if Emby could standardize on VLC instead of MPV.

Link to comment
Share on other sites

That sounds like VLC is setup for your hardware where MPV isn't.
You can find threads here on this forum how to change the configuration of MPV or better yet could visit their site which of course specializes in MPV.

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
 Share

×
×
  • Create New...