Jump to content

4k dropping frames


Mbedford

Recommended Posts

PrincessClevage

It does. How do you have everything configured?

 

Don't listen to that guy.

In ET I have deinterlace =auto and

My current mpv.conf =

 

## VIDEO ##

hwdec=auto

hwdec-codecs=all

opengl-pbo=yes

scale=spline36

cscale=spline36

sigmoid-upscaling=yes

dither-depth=auto

saturation=5

brightness=3

contrast=-3

gamma=14

deinterlace=no

target-trc=pq

 

## SUBTITLES ##

sub-create-cc-track=yes

sub-pos=90

 

## AUDIO ##

audio-stream-silence=yes

audio-exclusive=yes

 

## AUTO-PROFILES ##

 

## [interlaced] ##

## profile-desc=cond:p["video-frame-info/interlaced"] ##

## hwdec=d3d11va-copy ##

## vf=bwdif ##

 

 

[720p]

profile-desc=cond:p["video-params/w"]==1280

deinterlace=no

 

[HDR]

profile-desc=cond:p["video-params/primaries"]=="bt.2020"

dither-depth=no

deband=yes

deband-iterations=1

contrast=-6

saturation=4

brightness=6

Link to comment
Share on other sites

sooty234

Use this, and enable deinterlacing as auto in Theater.

## VIDEO ##
target-trc=pq
target-prim=bt.2020
hwdec=auto
hwdec-codecs=all
opengl-pbo=yes
scale=spline36
cscale=spline36
sigmoid-upscaling=yes
deband=yes
deband-iterations=1
deband-grain=0
dither-depth=auto
saturation=5
brightness=3
contrast=-3
gamma=14

## SUBTITLES ##
sub-create-cc-track=yes
sub-pos=90

## AUDIO ##
audio-stream-silence=yes
audio-exclusive=yes


## AUTO-PROFILES ##

[720p]
profile-desc=cond:p["video-params/w"]==1280
deinterlace=no

[HDR]
profile-desc=cond:p["video-params/primaries"]=="bt.2020"
dither-depth=no
deband=no
contrast=-6
saturation=4
brightness=6
gamma=0
Link to comment
Share on other sites

IndianaGeorge

Your information is specific to using mpv in and of itself, with no scripts and profiles. If you read the manual more thoroughly, and poke around github to see what else the mpv devs made for mpv, you will learn more. Here's the auto-profiles script, written by the main mpv developer. And here're links to profiles, auto-profiles, and the properties that can be used in those profiles.

You seem to be aggressive for whatever reason... I just wanted to add to the discussion.  I am currently topped out at 1080p, so I will not comment on 4K/UHD/HDR since I can't verify results.  Here is my current mpv.conf:

 

## Logging for debugging ##

 

#log-file="~~/mpv logs/mpv log.txt"

#msg-level=v

 

 

## IMPORTANT: You must set the following in Emby Theater Settings ##

##   Emby Theater Video                                           ##

##     Enable deinterlacing         -> Yes (works for OTA)        ##

##     Enable video display syncing -> Display resample           ##

##     Enable interpolation         -> No (unchecked)             ##

 

 

## The following lines in case stand alone version of MPV is used ##

## Already set in ET->Settings->Video (see above)                 ##

 

deinterlace   =yes

video-sync    =display-resample

interpolation=no

 

 

## VIDEO ##

 

gpu-api     =auto

hwdec       =no #cuda-copy #software decoding recommended, if yes then uncomment:

#hwdec-codecs=all

 

cscale=lanczos

scale =lanczos #ewa_lanczossoft #lanczos #ewa_lanczossharp #

dscale=mitchell

tscale=oversample

 

linear-downscaling=no #SSimDownscaler tuned for linear-downscaling=no

sigmoid-upscaling =yes

blend-subtitles   =yes

 

dither-depth=no #not recommended if computer monitor dithers

 

deband-iterations= 4 #default:  1

deband-threshold =20 #default: 64

deband-range     =16 #default: 16

deband-grain     = 0 #default: 48, set to 0 if using static grain shader

 

 

## PROFILES ##

 

[FHD-shaders]

glsl-shaders-clr

glsl-shader="~~/KrigBilateral.glsl"

deband=no

 

[HD-shaders]

glsl-shaders-clr

glsl-shader="~~/FSRCNNX_x2_16-0-4-1.glsl"

glsl-shader="~~/KrigBilateral.glsl"

glsl-shader="~~/SSimDownscaler.glsl"

deband=no

 

[sD-shaders]

glsl-shaders-clr

glsl-shader="~~/noise_static_chroma.hook"

glsl-shader="~~/noise_static_luma.hook"

glsl-shader="~~/FSRCNNX_x2_16-0-4-1.glsl"

glsl-shader="~~/KrigBilateral.glsl"

glsl-shader="~~/SSimSuperRes.glsl"

deband=yes

 

[default]

 

 

## AUTO-PROFILES ##

 

[Movies]

profile-desc=cond:(string.match(p.path, "movies")~=nil and not string.match(p.path, "recorded movies")~=nil)

deinterlace  =no

interpolation=yes

 

[Recorded Movies]

profile-desc=cond:(string.match(p.path, "recorded movies")~=nil)

deinterlace  =yes

interpolation=no

 

[shows]

profile-desc=cond:(string.match(p.path, "Star Trek %(1966%)")~=nil or string.match(p.path, "Lost in Space %(1965%)")~=nil or string.match(p.path, "That '70s Show %(1998%)")~=nil or string.match(p.path, "Mannix %(1967%)")~=nil)

deinterlace  =yes

interpolation=yes

 

[Recorded Shows]

profile-desc=cond:(string.match(p.path, "recorded shows")~=nil and not (string.match(p.path, "Star Trek %(1966%)")~=nil or string.match(p.path, "Lost in Space %(1965%)")~=nil or string.match(p.path, "That '70s Show %(1998%)")~=nil or string.match(p.path, "Mannix %(1967%)")~=nil))

deinterlace  =yes

interpolation=no

 

[FHD]

profile-desc=cond:(p["video-params/h"] == 1080)

profile=FHD-shaders

 

[HD]

profile-desc=cond:(p["video-params/h"] ==  720)

profile      =HD-shaders

deinterlace  =no

interpolation=no

 

[sD]

profile-desc=cond:(p["video-params/h"] ==  480)

profile=SD-shaders

 

[default]

Link to comment
Share on other sites

sooty234

Some of that is wrong, and some of that will be overridden by settings in Theater (depending of what you've set in Theater).

Link to comment
Share on other sites

IndianaGeorge

Some of that is wrong, and some of that will be overridden by settings in Theater (depending of what you've set in Theater).

I have commented on what must be set in theater, but I am always anxious to learn, what is wrong?  It seems to work correctly, but mpv and emby are always a challenge, please comment further.

Edited by IndianaGeorge
Link to comment
Share on other sites

sooty234

What are you trying to accomplish? How have you configured the audio and video settings in Theater? What hardware are you using?

Edited by sooty234
Link to comment
Share on other sites

sooty234

@@IndianaGeorge, my apologies. What I was perceiving as 'wrong' appears to be a weird copy/paste text flow, thing. Your config does actually appear to be correct. But there are some things that Theater is going to override in your config. Deinterlacing is one. Applying 'yes' in the settings will override any 'deinterlace=no' options in your mpv.conf. The 'auto' option does actually work as expected. But if you want to control deinterlacing with your config, you can use this, if you set it 'no' in the Theater settings.

[Interlaced]
profile-desc=cond:p["video-frame-info/interlaced"]
deinterlace=yes

A little side note:  If you use the ffmpeg deinterlacer bwdif, it's actually a better deinterlacer. To use it, this is what it would look like:

[Interlaced]
profile-desc=cond:p["video-frame-info/interlaced"]
hwdec=d3d11va-copy
vf=bwdif

Also, if you are use audio passthrough, 'video-sync=display-resample' won't work. It requires the ability to resample the audio, which it can't do with audio passthrough enabled, and then is silently disabled. Which also means 'interpolation' won't work.

 

And when the new version of Theater is finished, you'll need to revise it all. As it will be using libmpv, and some of the commands will be different. Not sure how the scalers will work when not using 'vo=gpu'. 

Link to comment
Share on other sites

IndianaGeorge

@@IndianaGeorge, my apologies. What I was perceiving as 'wrong' appears to be a weird copy/paste text flow, thing. Your config does actually appear to be correct. But there are some things that Theater is going to override in your config. Deinterlacing is one. Applying 'yes' in the settings will override any 'deinterlace=no' options in your mpv.conf. The 'auto' option does actually work as expected. But if you want to control deinterlacing with your config, you can use this, if you set it 'no' in the Theater settings.

[Interlaced]
profile-desc=cond:p["video-frame-info/interlaced"]
deinterlace=yes

A little side note:  If you use the ffmpeg deinterlacer bwdif, it's actually a better deinterlacer. To use it, this is what it would look like:

[Interlaced]
profile-desc=cond:p["video-frame-info/interlaced"]
hwdec=d3d11va-copy
vf=bwdif

Also, if you are use audio passthrough, 'video-sync=display-resample' won't work. It requires the ability to resample the audio, which it can't do with audio passthrough enabled, and then is silently disabled. Which also means 'interpolation' won't work.

 

And when the new version of Theater is finished, you'll need to revise it all. As it will be using libmpv, and some of the commands will be different. Not sure how the scalers will work when not using 'vo=gpu'. 

Sooty, no need to apologize and sorry for the late reply.  I had forgotten all about Luke making the "Auto" selection something different than the mpv meaning and had to do some testing.  Then I recalled that it never worked right for me since Emby was misidentifying 720p recordings as 720i.  It seems to work correctly where I am now, but it's also a different 720p station.  Currently though Emby misidentifies 2 out 3 progressive DVDs I have as 480i.  Sure, they could be fixed by conversion, but I also find that interpolation messes up some TV channels, so I just want to set interpolation for my movies and the TV series recordings that work well with it.

 

You are correct that setting deinterlace to the opposite of what it is set to within ET will not change it.  I do set them to the same as I have within ET so that I can test things with the stand-alone mpv (see comments in my mpv.conf).  Toggling deinterlace works within Auto-Profiles, which is where we both are doing it.  I do not use the "video-frame-info/interlaced" flag since some DVDs have incorrect flags in my experience.  I only have a handful of DVDs left which are unavailable on Blu-ray, but since I have to selectively enable interpolation I might as well do deinterlace at the same time.

 

I learned a lot of tricks from mpv.conf files uploaded from people on this forum, particularly Doofus, and also stand-alone mpv tutorials (I can post links if anyone is interested).  I find it takes some time to figure out what part of their config file might be applicable to what I want, but I finally think I have a robust solution, limited to 1080p and USA ATSC 1.0 broadcasts of course.

 

It appears to me that Emby restarts mpv with each new video played with the possible exception of playing the next episode in a series automatically.  I thought that the stand alone would only run mpv.conf when you start it, so I try to have my Auto-Profiles work such that if you drop another file onto mpv stand-alone before the previous one ended then the correct settings would be made.  It's probably academic, but it's fun :lol:

 

One last thing, as I think you already pointed out a few posts above, deinterlace must be disabled if vf=bwdif is used.  Also, if you want to allow your Auto-Profiles to disable interlacing after it already has been set, then vf-remove=bwdif must be used.  If options were used for bwdif, then the same options must be used with vf-remove.

Edited by IndianaGeorge
Link to comment
Share on other sites

sooty234

One last thing, as I think you already pointed out a few posts above, deinterlace must be disabled if vf=bwdif is used.  Also, if you want to allow your Auto-Profiles to disable interlacing after it already has been set, then vf-remove=bwdif must be used.  If options were used for bwdif, then the same options must be used with vf-remove.

 

That only applies if you use a playlist directly in mpv, as the player doesn't get restarted, so runtime changes need to be applied. As you said, Emby/Theater plays each file independently from the server's directive. This makes mpv restart each time. So all of the settings/options are reset and reapplied for each file that is played. This negates the need for an 'undo' profile, to countermand whatever option is set. This makes using auto-profiles for Theater, much more simple and easy. If deinterlacing is set to yes for one video, when the next video starts, that setting is re-evaluated. So if you use an auto-profile to deinterlace for a specific video, when the next video plays, it will revert to its default unless you specifically tell it to do something different. And the way the settings are applied in Theater (nodeJS directly to the API, I think it is), the way the API is written, can set a 'hard' option that can't be changed by the mpv.conf. This is why we now have the hardware acceleration option "Unset (for mpv.conf)". So we can set hwdec with auto-profiles in the mpv.conf.

 

 

You are correct that setting deinterlace to the opposite of what it is set to within ET will not change it.  I do set them to the same as I have within ET so that I can test things with the stand-alone mpv (see comments in my mpv.conf).  Toggling deinterlace works within Auto-Profiles, which is where we both are doing it.  I do not use the "video-frame-info/interlaced" flag since some DVDs have incorrect flags in my experience.  I only have a handful of DVDs left which are unavailable on Blu-ray, but since I have to selectively enable interpolation I might as well do deinterlace at the same time.

 

You can still use that option, and then for the videos that don't have the flags, just do what you've done and have a profile specifically for that video. This will then be 'foolproof', and not run the risk of deinterlacing progressive media.

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