Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th April 2024, 06:57   #41  |  Link
simple_simon
Registered User
 
Join Date: Feb 2003
Posts: 124
Quote:
Originally Posted by Boulder View Post
I think it's not changed much. What errors do you get?
I think I got it figured out. I changed "sstr" to "str" in line 65. I was also getting an error saying it didn't know what "limit" meant or something before but now I can't reproduce that again.

I'm still not sure how you use the debug switches to figure out the values to use? Do I just use the settings listed on screen? And debug=1 doesn't seem to do anything. How does it help determine the prefilter version to use?
simple_simon is offline   Reply With Quote
Old 29th April 2024, 07:08   #42  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,799
Quote:
Originally Posted by simple_simon View Post
I think I got it figured out. I changed "sstr" to "str" in line 65. I was also getting an error saying it didn't know what "limit" meant or something before but now I can't reproduce that again.

I'm still not sure how you use the debug switches to figure out the values to use? Do I just use the settings listed on screen? And debug=1 doesn't seem to do anything. How does it help determine the prefilter version to use?
Yes, use the values shown in debug=6 to see if thscd1 and thscd2 are set correctly in your script and adjust based on if there are clear missed scene changes or false detections. Nowadays I usually adjust thscd1 unless it gets insanely high, but the range can easily be 300-700 depending on the source and prefiltering.

Debug=1 interleaves the original and prefiltered video so you need to step back and forth in the video in VDub to see the effect.

Looking at the code more thoroughly, I do have a more recent version of the script on my system. I can post it if you want to try it out. There's at least more prefiltering options and some more debug options for determining what the script does to the video.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 1st May 2024, 16:30   #43  |  Link
simple_simon
Registered User
 
Join Date: Feb 2003
Posts: 124
Quote:
Originally Posted by Boulder View Post
Yes, use the values shown in debug=6 to see if thscd1 and thscd2 are set correctly in your script and adjust based on if there are clear missed scene changes or false detections. Nowadays I usually adjust thscd1 unless it gets insanely high, but the range can easily be 300-700 depending on the source and prefiltering.

Debug=1 interleaves the original and prefiltered video so you need to step back and forth in the video in VDub to see the effect.

Looking at the code more thoroughly, I do have a more recent version of the script on my system. I can post it if you want to try it out. There's at least more prefiltering options and some more debug options for determining what the script does to the video.
Ok, I understand debug=1 now. But I don't know what's going on in debug=6. It's probably because I'm not familiar with mvtools. Do I just copy the thscd1 & thscd2 from the stats listed in yellow? Or how do I determine if they are correct or need adjustment? And what are the stats in grey that change every frame that are above the yellow stats that never change? Also really not sure how to determine limit and blurlimit using debug=2.

And sure, please post newer script when you get a chance.
simple_simon is offline   Reply With Quote
Old 1st May 2024, 18:14   #44  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,799
Quote:
Originally Posted by simple_simon View Post
Ok, I understand debug=1 now. But I don't know what's going on in debug=6. It's probably because I'm not familiar with mvtools. Do I just copy the thscd1 & thscd2 from the stats listed in yellow? Or how do I determine if they are correct or need adjustment? And what are the stats in grey that change every frame that are above the yellow stats that never change? Also really not sure how to determine limit and blurlimit using debug=2.

And sure, please post newer script when you get a chance.
In debug=6, the yellow values are the function parameters currently in use. Then at the top, the first grey value tells you the average SAD of the blocks in the frame. The second value tells you how many blocks are over the limit set by the thscd1 parameter. The thscd2 parameter is used to tell how many blocks can be over the limit before the frame is considered to be a scene change. So in this debug mode, you should find some good representative range of the source (which includes scene changes) and check what values the average SAD shows and if there are false scene changes detected or clear ones missed. In a scene change frame, the first grey value usually shows a quite high value and also the dots and lines representing the motion vectors are gone. Usually with clean sources, you can lower thscd1 while a very grainy source requires a higher value. The prefiltering you select affects this part as well.

Here's the latest version. I'm not entirely sure if the dependecies are the exact same as I have all Dogway's packages in my Avisynth autoload folder. It should work fine with the latest versions.
https://pastebin.com/TX2g5E2m

Debug=7 now shows you interleaved comparison of the original frame, original vs. the blurred frame (used in MDegrain for bigger weight on areas which have more motion), original vs. MDegrain and finally original vs. filtered. Debug=8 shows the same but with a more pronounced effect.

I always use debug=7 to adjust the settings; the blurred frame for adjusting blurlimit and bias and the MDegrain frame for thsad and limit. Quite often I try to set limit so that the MDegrain frame starts showing a slight difference. With a low value, the frame might just look all black. The PlaneMDSI value is a metric which tells how big the change is. I've noticed that in the MDegrain frame, it usually needs to be over 0.1 in order to see any real effect in the final result.
After adjusting the parameters, use debug=2 to see how it looks in "real life", it interleaves the original and filtered frame. Change those values a lot and you can see the effect quite easily.

There's also five different prefilters with prefilter=1..5 with increasing strength.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...

Last edited by Boulder; 1st May 2024 at 18:24.
Boulder is offline   Reply With Quote
Old 11th May 2024, 09:18   #45  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,732
Quote:
Originally Posted by benwaggoner View Post
I am getting good results with what I listed above
Can you give us some numbers that you proved to be ok?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 6th August 2024, 15:14   #46  |  Link
Lucky38
Registered User
 
Join Date: Mar 2024
Posts: 25
thank you. It is very informitive
Lucky38 is offline   Reply With Quote
Old 6th August 2024, 15:36   #47  |  Link
Lucky38
Registered User
 
Join Date: Mar 2024
Posts: 25
Quote:
Originally Posted by Boulder View Post
In debug=6, the yellow values are the function parameters currently in use. Then at the top, the first grey value tells you the average SAD of the blocks in the frame. The second value tells you how many blocks are over the limit set by the thscd1 parameter. The thscd2 parameter is used to tell how many blocks can be over the limit before the frame is considered to be a scene change. So in this debug mode, you should find some good representative range of the source (which includes scene changes) and check what values the average SAD shows and if there are false scene changes detected or clear ones missed. In a scene change frame, the first grey value usually shows a quite high value and also the dots and lines representing the motion vectors are gone. Usually with clean sources, you can lower thscd1 while a very grainy source requires a higher value. The prefiltering you select affects this part as well.

Here's the latest version. I'm not entirely sure if the dependecies are the exact same as I have all Dogway's packages in my Avisynth autoload folder. It should work fine with the latest versions.
https://pastebin.com/TX2g5E2m

Debug=7 now shows you interleaved comparison of the original frame, original vs. the blurred frame (used in MDegrain for bigger weight on areas which have more motion), original vs. MDegrain and finally original vs. filtered. Debug=8 shows the same but with a more pronounced effect.

I always use debug=7 to adjust the settings; the blurred frame for adjusting blurlimit and bias and the MDegrain frame for thsad and limit. Quite often I try to set limit so that the MDegrain frame starts showing a slight difference. With a low value, the frame might just look all black. The PlaneMDSI value is a metric which tells how big the change is. I've noticed that in the MDegrain frame, it usually needs to be over 0.1 in order to see any real effect in the final result.
After adjusting the parameters, use debug=2 to see how it looks in "real life", it interleaves the original and filtered frame. Change those values a lot and you can see the effect quite easily.

There's also five different prefilters with prefilter=1..5 with increasing strength.
Hi,

I have got this for debug=7

https://imgur.com/a/acTJFsT

Have you got some advice how to solve it?
Lucky38 is offline   Reply With Quote
Old 6th August 2024, 16:04   #48  |  Link
Lucky38
Registered User
 
Join Date: Mar 2024
Posts: 25
Quote:
Originally Posted by Boulder View Post
In debug=6, the yellow values are the function parameters currently in use. Then at the top, the first grey value tells you the average SAD of the blocks in the frame. The second value tells you how many blocks are over the limit set by the thscd1 parameter. The thscd2 parameter is used to tell how many blocks can be over the limit before the frame is considered to be a scene change. So in this debug mode, you should find some good representative range of the source (which includes scene changes) and check what values the average SAD shows and if there are false scene changes detected or clear ones missed. In a scene change frame, the first grey value usually shows a quite high value and also the dots and lines representing the motion vectors are gone. Usually with clean sources, you can lower thscd1 while a very grainy source requires a higher value. The prefiltering you select affects this part as well.
.
Does it mean i need to look at the second grey value to adjust thscd1?

for example i have this
MDG(limit=0.1, prefilter=1, blurlimit=0.3, thscd1=600, thscd2=100,debug=6)

which gives me 110 0 grey values. Should i change thscd1 till then i get 0 on second grey value?

Could you please clarify ?
Lucky38 is offline   Reply With Quote
Old 6th August 2024, 19:32   #49  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,799
Quote:
Originally Posted by Lucky38 View Post
Hi,

I have got this for debug=7

https://imgur.com/a/acTJFsT

Have you got some advice how to solve it?
You need to have Dogway's SimilarityMetrics.avsi in your plugins folder as well, it's a dependency with ex_makediff and MDSI as a metric.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 6th August 2024, 19:39   #50  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,799
Quote:
Originally Posted by Lucky38 View Post
Does it mean i need to look at the second grey value to adjust thscd1?

for example i have this
MDG(limit=0.1, prefilter=1, blurlimit=0.3, thscd1=600, thscd2=100,debug=6)

which gives me 110 0 grey values. Should i change thscd1 till then i get 0 on second grey value?

Could you please clarify ?
What I usually do is check a "calm" frame with little motion to see the base level (the first value) as this is often dependent on the noisiness of the source (after prefiltering). Then I check one with more motion to see if the second value gets too close to triggering a scene change, in which case thscd1 would need to be a little higher. No need to have the second value at 0 because by default it needs to be over 85 to trigger a scene change. The default thscd1=600 is very much on the safe side and something like 400 would probably work with most sources as well. The difficult scene changes are ones with low luma, it's easy to miss them.

Find a scene change frame and you can see how big the values are there

For improved motion detection, I suggest changing search to 5 and raising the searchparam values to something like 16-24 as default. Those old defaults in the script are very conservative what comes to performance.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 8th August 2024, 10:21   #51  |  Link
Lucky38
Registered User
 
Join Date: Mar 2024
Posts: 25
Quote:
Originally Posted by Boulder View Post
What I usually do is check a "calm" frame with little motion to see the base level (the first value) as this is often dependent on the noisiness of the source (after prefiltering). Then I check one with more motion to see if the second value gets too close to triggering a scene change, in which case thscd1 would need to be a little higher. No need to have the second value at 0 because by default it needs to be over 85 to trigger a scene change. The default thscd1=600 is very much on the safe side and something like 400 would probably work with most sources as well. The difficult scene changes are ones with low luma, it's easy to miss them.

Find a scene change frame and you can see how big the values are there

For improved motion detection, I suggest changing search to 5 and raising the searchparam values to something like 16-24 as default. Those old defaults in the script are very conservative what comes to performance.
Thank you
Lucky38 is offline   Reply With Quote
Reply

Tags
grain, x265

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:02.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.