Jump to content

stuttering, frame dropping with 24fps content since 2.9.9


lifespeed

Recommended Posts

lifespeed

Does this require more resources?

While de-interlacing using vd-lavc-o=deint=adaptive in the MPV config file, Emby de-interlace set to NO and acceleration set to CUDA CPU was 6%, GPU was 40%.

 

After removing vd-lavc-o=deint=adaptive from the MPV config file, setting Emby de-interlace to YES and acceleration set to AUTO CPU was 6%, GPU was 60%.

 

So it definitely works better when MPV uses nVidia to de-interlace live TV, using fewer GPU resources.  Also, I noticed when MPV was configured to de-interlace live TV started playing nearly instantly, whereas when it was set to have Emby de-interlace it takes several seconds for live TV to start playing.

 

I don't know what is going on behind the scenes, but clearly the configuration where MPV handles de-interlacing with the assistance of the graphics card is faster and uses less resources.  I can't see any down side to this, and the improved responsiveness of live TV is nice as well.

Edited by lifespeed
Link to comment
Share on other sites

lifespeed

And here is the problem; inconsistent assignment of de-interlacing duties.  I guess when I set de-interlace=YES inside Emby client, it turns off de-interlace at the server level and MPV de-interlaces.  MPV does it well, I might add.  But if the client is to be assigned de-interlacing duties then it needs to be consistent across the platform.  So no when I play Live TV 1080i on Android I get interlaced artifacts.

 

Or at least I think that is what is happening, the server currently is handling de-interlacing duties for clients when Emby Theater configuration is set to YES.

Link to comment
Share on other sites

Guest asrequested

The options in theater have no influence on the server. Each app will have its own player with its own capabilities. If your android device isn't deinterlacing, then that needs to be addressed in that app/player. The server will deinterlace as a part of transcoding, but some apps, like android tv, have a setting for deinterlacing for the sever to follow, based on what ffprobe returns. MPV is one of the few players in emby that can do it internally, not needing the sever for help.

 

This is why I'm such a big supporter of HTPCs. I can make it do almost anything.

Edited by Doofus
Link to comment
Share on other sites

lifespeed

The options in theater have no influence on the server. Each app will have its own player with its own capabilities. If your android device isn't deinterlacing, then that needs to be addressed in that app/player. The server will deinterlace as a part of transcoding, but some apps, like android tv, have a setting for deinterlacing for the sever to follow, based on what ffprobe returns. MPV is one of the few players in emby that can do it internally, not needing the sever for help.

 

This is why I'm such a big supporter of HTPCs. I can make it do almost anything.

Thanks for the clarification, that was a point of confusion for me.  The android client displays de-interlaced video when it is playing over the internet as a side effect of transcoding to reduce the bitrate, but does not benefit from transcoding/de-interlacing on the local network.  So I guess this is a limitation of the android client.

 

So the conclusion remains unchanged - MPV de-interlacing using nVidia hardware acceleration performs significantly better than Emby de-interlacing.  Reduced GPU usage and significantly improved startup time for live TV playback are two noticeable improvements.

Link to comment
Share on other sites

Guest asrequested

I was having this discussion in the testing area for the Android TV app. There's an mpv Android app. It's not as fully developed, as Android devices are significantly different. But I have hopes for the future. I still haven't really tested it, but I intend to.

Link to comment
Share on other sites

lifespeed

So how is de-interlacing handled in Emby Theater?  Does Emby Theater call  ffmpeg to de-interlace before passing the stream to MPV?

Link to comment
Share on other sites

lifespeed

Generally not, no. Mpv will handle it.

So why is Live TV responsiveness so much better and GPU utilization lower when Emby Theater de-interlace is disabled, acceleration is set to CUDA, and the MPV config file contains "vd-lavc-o=deint=adaptive"?  It sounds like in either case MPV is doing the de-interlacing.

Link to comment
Share on other sites

Correct, it is. And I'm not sure. Perhaps in one case it is offloading to gpu and in the other case CPU. Or perhaps it performs better due to a cheaper deinterlacing method.

Link to comment
Share on other sites

lifespeed

Correct, it is. And I'm not sure. Perhaps in one case it is offloading to gpu and in the other case CPU. Or perhaps it performs better due to a cheaper deinterlacing method.

So you have tried this configuration and seen the improved performance?

Link to comment
Share on other sites

Guest asrequested

With the Nvidia, deinterlacing is happening during decode. Like a single process. Otherwise it's decoded then processed/deinterlaced.

Edited by Doofus
Link to comment
Share on other sites

Guest asrequested

So how is de-interlacing handled in Emby Theater? Does Emby Theater call ffmpeg to de-interlace before passing the stream to MPV?

MPV is built on ffmpeg. It's compiled directly into it. That's a large part of why it's so versatile.

Link to comment
Share on other sites

PrincessClevage

Just testing Theater 3.0 with Electron 2.0.0 beta 7, with the latest shinchiro mpv build. No dropped frames when watching live tv.

Some nice tips here for Nvidia users, makes a big difference and live tv is more fluid and audio is not falling out of sync. I have:

Download the mpv version doofus linked

Disable de-interlace in ET

Select coda-copy back hwa in ET

Enabled tv interlace in Nvidia control panel

Starting of live tv stream does seem faster also.

I have observed that movies with h264 with the new mpv player show that hardware acceleration =no

Doesn’t matter what I change the setting to in ET:-(

And dropping a lot of frames

Edit: Seems a restart of the server OS has resolved the hardware acceleration and is working as expected after OS restart. Looks like the gpu is not being fully release when I copied the new mpv files.

Edit 2:

I have performed some additional testing and noted that high bit rate hvec context would not play smoothly with hwa=Cuba copy and to get smooth play I had to change hwa=auto which always selects d3d11va. I also noticed that I was getting dropped frames with 23.97 content and simply by disabling deinterlace in ET client resolved the dropped frames but also resulted in some less than desirable live tv so I then changed deinterlace to auto and this seemed to work best for movies and live tv. Is it possible to add deinterlace active/disabled to stats for nerds?

Edited by PrincessClevage
Link to comment
Share on other sites

Guest asrequested

Ok so I've been getting dropped frames, again.....but only on some things. I've been running different configs to see what I get. I think I may have figured out what is happening. These later mpv builds have the deinterlacing changes, in them. And I think when setting to on, deinterlacing is on all the time. It didn't used to be. It used to get enabled based on flags in the stream. That proved unreliable, so they changed it to be on or off. So I think what it's doing is trying to deinterlace some progressive streams (haven't conclusively proved that). So I tried this config, and the results have been very good (still need to do more testing). In Theater, set HWA to Auto, and Deint to Auto, then use this in the mpv.conf. I get the most dropped frames when watching 720p live tv. But with this in the mpv.conf, my dropped frames go from thousands, to 1-5

vf=d3d11vpp=deint=yes:interlaced-only=yes:mode=adaptive
[vd] Using hardware decoding (d3d11va).
[   0.508][v][vd] Decoder format: 1280x720 d3d11[nv12] auto/auto/auto/limited/auto CL=mpeg2/4/h264 (auto 0.000000/0.000000/0.000000)
[   0.508][v][vf] [in] 1280x720 d3d11[nv12] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[   0.508][v][vf] [userdeint] 1280x720 d3d11[nv12] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[   0.508][v][vf] [d3d11vpp] 1280x720 d3d11
[   0.493][v][vd] Trying hardware decoding via mpeg2video-d3d11va.
[   0.493][v][vd] Selected codec: mpeg2video (MPEG-2 video)
[   0.493][d][user_filter_wrapper] Setting option 'deint' = 'yes' (flags = 0)
[   0.493][d][user_filter_wrapper] Setting option 'interlaced-only' = 'yes' (flags = 0)
[   0.493][d][user_filter_wrapper] Setting option 'mode' = 'adaptive' (flags = 0)
[   0.493][v][vf] User filter list:
[   0.493][v][vf]   d3d11vpp (d3d11vpp.00)
Edited by Doofus
Link to comment
Share on other sites

Guest asrequested

Some nice tips here for Nvidia users, makes a big difference and live tv is more fluid and audio is not falling out of sync. I have:

Download the mpv version doofus linked

Disable de-interlace in ET

Select coda-copy back hwa in ET

Enabled tv interlace in Nvidia control panel

Starting of live tv stream does seem faster also.

I have observed that movies with h264 with the new mpv player show that hardware acceleration =no

Doesn’t matter what I change the setting to in ET:-(

And dropping a lot of frames

Edit: Seems a restart of the server OS has resolved the hardware acceleration and is working as expected after OS restart. Looks like the gpu is not being fully release when I copied the new mpv files.

Edit 2:

I have performed some additional testing and noted that high bit rate hvec context would not play smoothly with hwa=Cuba copy and to get smooth play I had to change hwa=auto which always selects d3d11va. I also noticed that I was getting dropped frames with 23.97 content and simply by disabling deinterlace in ET client resolved the dropped frames but also resulted in some less than desirable live tv so I then changed deinterlace to auto and this seemed to work best for movies and live tv. Is it possible to add deinterlace active/disabled to stats for nerds?

 

Does your GPU support HEVC HWA?

Link to comment
Share on other sites

PrincessClevage

Does your GPU support HEVC HWA?

Yes,

I have resolved all my dropped frames but now fighting live tv 23.97 audio sync issues:-(

Link to comment
Share on other sites

Guest asrequested

There are a lot of changes in mpv that aren't in the manual, yet. Once the official release is out, it'll all be documented. Then we'll see what's what. They're cleaning up a lot of the GPU stuff. I need to run more tests with the standalone, and compare it to how it is in Theater.

Link to comment
Share on other sites

Guest asrequested

Yes,

I have resolved all my dropped frames but now fighting live tv 23.97 audio sync issues:-(

What config are you using?

Link to comment
Share on other sites

PrincessClevage

What config are you using?

Try an OS restart as it seems some setting cause gpu release issues and cause dropped frames
Link to comment
Share on other sites

Guest asrequested

Try an OS restart as it seems some setting cause gpu release issues and cause dropped frames

I've just reinstalled the OS, so it's been restarted, quite a few times. That doesn't have anything to do with my dropped frames. It's a combination of refresh rate, electron/chromium, mpv build and GPU utilization of deinterlacing.

Link to comment
Share on other sites

PrincessClevage

I've just reinstalled the OS, so it's been restarted, quite a few times. That doesn't have anything to do with my dropped frames. It's a combination of refresh rate, electron/chromium, mpv build and GPU utilization of deinterlacing.

ok, any ideas on what might stop the audio slowly drifting out of sync for live tv?
Link to comment
Share on other sites

PrincessClevage

What config are you using?

basically every thing on and set to auto except for audio sync (which seems to make a mess of it )
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...