Skip to content

More post-processing options: different post processing modes per video #258

Closed
wants to merge 1 commit into from

5 participants

@CrHasher
CrHasher commented Jul 7, 2011

2011.Oct.12 Updated for no conflicts with master.

Post-processing all videos with high quality pp filter combination 'ha:128:7,va,dr' makes videos too blurred. Not all videos need so much vertical/horizontal de-blocking. From experience with MPlayer's video filter settings I would suggest the following changes:

Introduce 3 PP Modes that can be switched in the GUI and saved per video:

  • Default: 'ha,va,dr' (this is accurate but not too aggressive and it is based on FFMpeg default that is 'hb:a,vb:a,dr:a', only changed horizontal/vertical deblocking to accurate and disabled auto switch-off flag). Because this is the mode that can be overridden in xml, advanced users with own pp settings won't be affected by this change.

  • Aggressive: 'ha:128:7,va,dr' (high quality but not suitable for all videos this is FFMpeg high quality pp filter combination 'ha:a:128:7,va:a,dr:a' without the ':a' flag)

  • Auto (slow CPU): 'hb:a,vb:a,dr:a' (FFMpeg's default setting that automatically switches the subfilters off if the CPU is too slow)

See: http://trac.xbmc.org/ticket/11556

@elupus: libavfilter was put in place but the currently integrated version does not have a filter named 'mp' so we could use what we have now until ffmpeg will be updated.

@elupus elupus was assigned Sep 4, 2012
@wmyrda
wmyrda commented Jan 30, 2013

idea itself seems great to me. any chance this gets implemented? BTW I am using external ffmpeg 1.0 and would like to move to the 1.1 as well. Would it work with them as well?

@elupus
Team Kodi member
@wmyrda
wmyrda commented Jan 31, 2013

I updated the patch http://pastebin.com/0h5g1UdB with polish translation and added additional post-processing settings which I personally like to use and tested it with external ffmpeg 1.0.3 and seems to work well with that combination.
One thing I didn't personally like in the original patch is naming one of the options SLOW_CPU as fast cpus might like this setting too for some videos hence the change to AUTO. BASIC or AUTO_BASIC would probably be more appropriate as well.

@MartijnKaijser
Team Kodi member

Translations must be handled through Transifex and should not be added directly. Only English strings

@CrHasher
CrHasher commented Feb 1, 2013
Please change:
ha:a:128:7,va:a:128:7,dr:a -> ha:a:128:7,va:a,dr:a

See man-page of mplayer:
"The horizontal and vertical deblocking filters share the difference and flatness values so you cannot set different horizontal and vertical thresholds."

Also do not use name "Auto" for the filter:

hb:a,vb:a,dr:a - this filter should be used only on slow CPU's

It's ok to name the filter Auto internally in the source but not as a setting to the user

@wmyrda
wmyrda commented Feb 26, 2013

I read mplayer manual filtering (pp) section http://www8.mplayerhq.hu/DOCS/man/en/mplayer.1.txt back and forward several times and could not find information about thresholds, but then I typed "mplayer -pphelp" and it sure mentioned that setting it the same for H & V is required. Still I believe that mine should work too as I set same levels for both. It probably was just redundant, but I could be wrong. In either case definatly extra 128:7 should be removed.
That said is is possible to add INSANE/EXTREME/SLOWEST filter with levels od something like 255:3 for example? What is the limit there if any?
What about h1 & v1 filetrs. Are there any better than any of the below combinations or if somebody says so it is just a placebo?

Localy I already switch "Auto" to "Basic", but before I post it I consider changing it a bit to something like this. Please take a look if it makes sense

Highest = "ha:255:3,va,dr";
Higher = "ha:128:7,va,dr";
High = "ha:a:128:7,va:a,dr:a";
Normal [set to default] = "ha,va,dr";
Fast = "hb:a:128:7,vb:a,dr:a";
Faster = "hb,vb,dr";
Fastest = "hb:a,vb:a,dr:a";

@CrHasher

This is the HTML version of the documentation: http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html

About setting "ha:255:3,va,dr" – I don’t know the upper limit for difference and flatness the documentation says nothing about that. I think we could use ha:128:7,va,dr as the maximum. Other than that, 8 different settings for pp is just too much. And hb:a,vb:a,dr:a is not faster than hb,vb,dr, the difference is that some or all filters are switched of when computer is too slow. On a fast computer they are the same setting.

I think 3 settings are just fine let’s just take defaults from mplayer:

  • Default: "ha:a,va:a,dr:a" (mplayer de/default option)
  • Accurate: "ha:a:128:7,va:a,dr:a" (mplayer ac option)
  • Fast: "h1:a,v1:a,dr:a" (mplayer fa/fast option)
@wmyrda
wmyrda commented Apr 5, 2013

I must have missed notification about your post so hence only now the response. I agree having to many choices may not be what one desires, and sticking to those automatic once will be better choice for more users, but I would keep that ha:255:3 in there as I tested it with some very bad quality low res samples and it did in fact not only work but made them look better. With that said it would get it down to only 4.

Highest = "ha:a:255:3,va:a,dr:a";
High = "ha:a:128:7,va:a,dr:a";
Default = "ha:a,va:a,dr:a";
Fast = "h1:a,v1:a,dr:a";

Following is what I had used till now http://pastebin.com/pHgXzpSM with FernetMenta tree which worked quite fine for me for the past month until recent changes in the settings directory. Another one http://pastebin.com/EawcXZSk is current WiP reflecting that change however I am not able to find reason why it would not compile for me with errors in MediaSettings.cpp and VideoDatabase.cpp

On the side note to further extend on the idea I believe a quite welcomed feature would be to add an ability for an users to pick different postprocessing method for different resolution/s. Once they enable PP if they do not take additional action then the default would be picked. Then they could enter as many resolutions as they want just like with "adjustrefreshrate" and then pick among those 4 above PP methods.
That way I could for instance set Highest for 576, High for 720, Default for 1080

@CrHasher
CrHasher commented Apr 8, 2013

@wmyrda
Don’t really understand the Highest = "ha 255:3,va:a,dr:a"; setting but if you tested and works fine than I see no reason not to add it. About the "PP settings"/resolution, video quality is not related to resolution, you can have a 1080p video that was up-scaled from a very bad quality low-res video and then you want to let the user set the PP option for that video. Currently the user sees the video and decides what PP option to use (that's just fine). Personally I keep PP off until I play an SD quality video that looks awful, than I switch PP to an option I like. If you can somehow detect HD quality video (I think we do show icon for SD and HD) then you could add an option to turn off PP for HD and that would be more useful.

@CrHasher CrHasher closed this Apr 8, 2013
@CrHasher CrHasher reopened this Apr 8, 2013
@CrHasher
CrHasher commented Apr 8, 2013

Sorry for closing pull, my mistake :dancer:

@bulkzooi

I think this needs some work after all the FFMPEG changes....

@CrHasher

At the time avfilter was introduced, post-processing filters were unavailable. We should add the new pp filter to our filter chain and remove the old code completely.
@wmyrda:
You can add the pp filter (with same options) to the filter chain in function:

unsigned int CDVDVideoCodecFFmpeg::SetFilters(unsigned int flags)

This function is called from:

void CDVDPlayerVideo::Process()
  • here you can see how other filter flags are set (deinterlace, rotate)
  • also mPostProcess and anything related should be removed from CDVDPlayerVideo
@CrHasher CrHasher closed this Jun 26, 2013
@CrHasher

@wmyrda: Please if you make changes submit a new pull request from your fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.