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 > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd April 2023, 14:11   #2301  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,705
The default SetMemoryMax plays it too safe. 4K processing can easily require over 10GB of cache
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is online now   Reply With Quote
Old 2nd April 2023, 14:21   #2302  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 128
Quote:
Originally Posted by LeXXuz View Post
You probably have to. 16GB is not very much for more complex filtering of 4k content.
Change of subject...

Is there a way to add .srt subtitles with AVS, and edit font size.
FTLOY is offline   Reply With Quote
Old 2nd April 2023, 14:43   #2303  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,335
Quote:
Originally Posted by FTLOY View Post
Change of subject...

Is there a way to add .srt subtitles with AVS, and edit font size.
Nothing to do with this thread. You should post somewhere else or start a new one

You can convert to .ass and specify font size there
poisondeathray is offline   Reply With Quote
Old 2nd April 2023, 14:50   #2304  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 128
Quote:
Originally Posted by poisondeathray View Post
Nothing to do with this thread. You should post somewhere else or start a new one

You can convert to .ass and specify font size there
Well, you never know what Dogway may have hidden in amongst all his scripts / filters.
FTLOY is offline   Reply With Quote
Old 2nd April 2023, 15:46   #2305  |  Link
coolgit
Registered User
 
Join Date: Apr 2019
Posts: 213
Put .srt sub with same filename as video in same folder and your player will load it and use player to change font size.
coolgit is offline   Reply With Quote
Old 2nd April 2023, 17:08   #2306  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 128
Quote:
Originally Posted by coolgit View Post
Put .srt sub with same filename as video in same folder and your player will load it and use player to change font size.
I do that most of the time, but I want to hardcode them for a series, before editing out lengthy intros, etc.
FTLOY is offline   Reply With Quote
Old 2nd April 2023, 17:33   #2307  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,525
SubtitleEdit is your friend. Go to thread
https://forum.doom9.org/showthread.php?t=162721
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 2nd April 2023, 22:16   #2308  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Quote:
Originally Posted by FTLOY View Post
Quote:
Originally Posted by Dogway View Post
Simply used:
Code:
pre=ex_Median(mode="IQMST",thres=255)
STTWM(sw=50,tw=50,aw=100,sthres=5,tthres=5)
SMDegrain(tr=2,thSAD=200,thSADC=100,contrasharp=true,prefilter=pre,str=1.2,refinemotion=true)
FrameRateConverterMIX(FrameDouble=true)
in AvsPmod, and I think without Prefetch() even as I only use it when encoding.
You might need to review your workflow, use avs+ test 9, setmemorymax to an appropiate value, and load the mt-modes.avsi. Also test with other source loaders.
I think I might have figured out what's going on...

What type (resolution) video did you test this script on ?

I am trying to use FrameConverter on 4K HDR10 content, and I think the combination is just too much for it, 'cause it seems to be ok, but slow, on lesser resolution's.
4K changes it all. Look at the script, 4 temporal filters, that requires a lot out of order access. Unless you have a lot of cache or/and use your highest RAM it's going to run very slow, and I'm not sure even if AVS+ is ok for smooth 4K workflows. You might improve it using RequestLinear(2*24) just before FrameRateConverter.

Also being HDR10 you need to supply SMDegrain (and ideally FrameRateConverter) an SDR prefilter, as suggested in the docs or at the top of the SMDegrain script.

Quote:
Originally Posted by LeXXuz
Should these two be identical in output?

Code:
PRE=ex_Median(mode="IQMST", UV=3,thres=255)
Code:
PRE0=ex_Median(mode="IQMST", UV=3,thres=255)
PRE=ex_blend(PRE0,"blend",opacity=1)


Since opacity is clamped between 0,1 in ex_blend
-output with opacity=0 seems identical with the last clip, as it should.
-output with opacity=1 seems not identical with the blend clip, which I would've expected.

Also I noticed some flickering in the output when opacity is used with anything but 0.
Quite subtle but noticeable in some backgrounds when you're very susceptible to flicker. Could these be rounding errors from the blending process by any chance?
Sorry I missed this post, I thought you were referring to the SceneStats issue. Yes this is a bug, only when opacity is 1 in 'blend' mode for TV range sources. It's fixed now.
As for the flicker, are you sure about that? it's a basic 2 clips blends, I forgot to say but you could also do Merge(clip1,clip2,0.5), output should be similar, that means it should not show flicker either.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 2nd April 2023 at 23:06.
Dogway is offline   Reply With Quote
Old 3rd April 2023, 00:01   #2309  |  Link
coolgit
Registered User
 
Join Date: Apr 2019
Posts: 213
Quote:
Originally Posted by FTLOY View Post
I do that most of the time, but I want to hardcode them for a series, before editing out lengthy intros, etc.
Don't hardcode them. What if there is a spelling mistake, missing word, lines etc. With subtitleedit you can fix them easily. With hardcode you will have to fix the subs and compress the files all over again.

Hardcode subs are a very bad idea.
coolgit is offline   Reply With Quote
Old 3rd April 2023, 01:05   #2310  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 128
Quote:
Originally Posted by coolgit View Post
Don't hardcode them. What if there is a spelling mistake, missing word, lines etc. With subtitleedit you can fix them easily. With hardcode you will have to fix the subs and compress the files all over again.

Hardcode subs are a very bad idea.
I find it interesting how many continuing comments you can get with an off topic subject

This will be the last comment I make about subtitles here, as it is WAY off the thread's topic....kinda wish I hadn't brought it up, here.

I know hard coded has all those issues, but when you want to edit, cut, trim, the video & audio, (for example the first 2 minutes of every Game of Throne episode), you'd have to separately re-time the subtitles to suit the new running time, whereas if the video is hard coded (and double checked for typo's etc), then the trimming will take care of the subtitles

@ Emulgator

And I know that "SubtitleEdit is your friend", I have been using it for years, but I don't think you can change the font size for .srt's.

If you want to reply, please send me a PM, not on here.
FTLOY is offline   Reply With Quote
Old 3rd April 2023, 01:08   #2311  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 128
Quote:
Originally Posted by Dogway View Post
4K changes it all. Look at the script, 4 temporal filters, that requires a lot out of order access. Unless you have a lot of cache or/and use your highest RAM it's going to run very slow, and I'm not sure even if AVS+ is ok for smooth 4K workflows. You might improve it using RequestLinear(2*24) just before FrameRateConverter.

Also being HDR10 you need to supply SMDegrain (and ideally FrameRateConverter) an SDR prefilter, as suggested in the docs or at the top of the SMDegrain script.
Sorry about the subtitles stuff

Yes, I will be changing a few things with the info I've got about this, I'm glad I mentioned the 4K HDR10 thing.

But as for the SDR pre-filter, if that is to change the HDR to SDR, I don't want to do that!!



UPDATE:-

OK, I've had some success

Added TIVTC, so as to use RequestLinear(2*24), and modified the script.

Now using

Code:
SetCacheMode()
SetMemoryMax(20480)
I found that using SetCacheMode(0) was a little slower.

And going from SetMemoryMax 16384 (16Gb) to 20480 (20Gb) was a nice little bump, however, going up to 24576 (24Gb), it basically maxed out my 32G of DD5 and didn't really even want to start

So if there's anyone else out there that's silly enough to want to use FrameRateConverter on 4K, you need to add all this to the script

I'm sure that if I upped the system RAM to 64Gb or beyond it would process even faster. but DDR5 RAM is a bit too much $.

Last edited by FTLOY; 3rd April 2023 at 02:32.
FTLOY is offline   Reply With Quote
Old 3rd April 2023, 01:19   #2312  |  Link
coolgit
Registered User
 
Join Date: Apr 2019
Posts: 213
Quote:
Originally Posted by FTLOY View Post
I find it interesting how many continuing comments you can get with an off topic subject

This will be the last comment I make about subtitles here, as it is WAY off the thread's topic....kinda wish I hadn't brought it up, here.

I know hard coded has all those issues, but when you want to edit, cut, trim, the video & audio, (for example the first 2 minutes of every Game of Throne episode), you'd have to separately re-time the subtitles to suit the new running time, whereas if the video is hard coded (and double checked for typo's etc), then the trimming will take care of the subtitles
Actually it isn't off topic as Dogway does have a sub filter SwipeSubs https://github.com/Dogway/Avisynth-S...ster/EX%20mods therefore your query and hope
Quote:
Well, you never know what Dogway may have hidden in amongst all his scripts / filters.
was valid within the realm of this thread even though it not what you wanted.

Re timing the srt files is easy and quicker, 10 seconds per file. I have been doing this for 2 decades. Trust me if you hardcode them you will create more problems and waste more time.

Up to you.
coolgit is offline   Reply With Quote
Old 3rd April 2023, 01:40   #2313  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 128
Quote:
Originally Posted by coolgit View Post
Actually it isn't off topic as Dogway does have a sub filter SwipeSubs https://github.com/Dogway/Avisynth-S...ster/EX%20mods therefore your query and hope was valid within the realm of this thread even though it not what you wanted.

Re timing the srt files is easy and quicker, 10 seconds per file. I have been doing this for 2 decades. Trust me if you hardcode them you will create more problems and waste more time.

Up to you.
Well, all right then

Yes, it's not really what I'm after, so maybe Dogway might come up with a solution to my situation.

I know that re-timing would be reasonably easy with just a trim at the start, but when you're chopping out bits throughout the video, makes it pretty difficult.

I've done hard with a few series, and the only issue I have is the font size.
FTLOY is offline   Reply With Quote
Old 3rd April 2023, 10:30   #2314  |  Link
LeXXuz
21 years and counting...
 
LeXXuz's Avatar
 
Join Date: Oct 2002
Location: Germany
Posts: 716
Quote:
Originally Posted by FTLOY View Post
But as for the SDR pre-filter, if that is to change the HDR to SDR, I don't want to do that!!
Not at all. It is just for the prefiltering process before handing the prefiltered clip to mvtools. Since mvtools does not support HDR, you need to change your HDR content to SDR with an additional prefilter like DGHDRtoSDR().

If not, mvtools "sees" the prefilter-clip like you would on a SDR screen, with heavily compressed luma and chroma range. Which reduces the accuracy of the motion estimation quite a lot.

Quote:
Originally Posted by Dogway View Post
Sorry I missed this post, I thought you were referring to the SceneStats issue. Yes this is a bug, only when opacity is 1 in 'blend' mode for TV range sources. It's fixed now.
As for the flicker, are you sure about that? it's a basic 2 clips blends, I forgot to say but you could also do Merge(clip1,clip2,0.5), output should be similar, that means it should not show flicker either.
Thanks Dogway.

Well, since you ask me that way, no, I'm not 100% sure anymore.
I'll do some more testing on different sources with the fixed ex_blend() and compare it with merge().

Last edited by LeXXuz; 3rd April 2023 at 10:38.
LeXXuz is offline   Reply With Quote
Old 3rd April 2023, 12:34   #2315  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 128
Quote:
Originally Posted by LeXXuz View Post
Not at all. It is just for the prefiltering process before handing the prefiltered clip to mvtools. Since mvtools does not support HDR, you need to change your HDR content to SDR with an additional prefilter like DGHDRtoSDR().

If not, mvtools "sees" the prefilter-clip like you would on a SDR screen, with heavily compressed luma and chroma range. Which reduces the accuracy of the motion estimation quite a lot.
OK, thanks for the explanation, would you be so kind to provide a example of a call for DGHDRtoSDR() as a pre-filter ??

Wait, what, I think I found it here:-

DGHDRtoSDR as pre filter

Something like this :-

Code:
pre=DGHDRtoSDR(mode="pq",white=112)
pre2=ex_Median(mode="IQMST",thres=255) or pre2=pre.ex_Median(mode="IQMST", UV=3, thres=255)
STTWM(sw=50,tw=50,aw=100,sthres=5,tthres=5)
SMDegrain(tr=2,thSAD=200,thSADC=100,contrasharp=true,prefilter=pre,prefilter=pre2,str=1.2,refinemotion=true)
RequestLinear(2*24)
FrameRateConverterMIX(FrameDouble=true)

Last edited by FTLOY; 3rd April 2023 at 14:24.
FTLOY is offline   Reply With Quote
Old 3rd April 2023, 17:42   #2316  |  Link
coolgit
Registered User
 
Join Date: Apr 2019
Posts: 213
Quote:
Originally Posted by FTLOY View Post
Well, all right then

Yes, it's not really what I'm after, so maybe Dogway might come up with a solution to my situation.

I know that re-timing would be reasonably easy with just a trim at the start, but when you're chopping out bits throughout the video, makes it pretty difficult.

I've done hard with a few series, and the only issue I have is the font size.

If you must use .srt instead of .ass then you can use

Code:
assrender("filepath and name.srt", scale=1.2, srt_font="verdana")
Scale adjust size of font.


Or use subtitleedit and load srt file and use <font size="10px">Hello World</font>. For each line.

I surmised assrender would be easier.

Last edited by coolgit; 3rd April 2023 at 17:48.
coolgit is offline   Reply With Quote
Old 4th April 2023, 03:24   #2317  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 128
Quote:
Originally Posted by coolgit View Post
If you must use .srt instead of .ass then you can use

Code:
assrender("filepath and name.srt", scale=1.2, srt_font="verdana")
Scale adjust size of font.


Or use subtitleedit and load srt file and use <font size="10px">Hello World</font>. For each line.

I surmised assrender would be easier.
It works a treat

The only problem is you'd have to change the script's subtitle path for EVERY episode, so you could end up with MANY scripts

Last edited by FTLOY; 4th April 2023 at 03:34.
FTLOY is offline   Reply With Quote
Old 4th April 2023, 06:34   #2318  |  Link
LeXXuz
21 years and counting...
 
LeXXuz's Avatar
 
Join Date: Oct 2002
Location: Germany
Posts: 716
Quote:
Originally Posted by FTLOY View Post

Something like this :-

Code:
pre=DGHDRtoSDR(mode="pq",white=112)
pre2=ex_Median(mode="IQMST",thres=255) or pre2=pre.ex_Median(mode="IQMST", UV=3, thres=255)
STTWM(sw=50,tw=50,aw=100,sthres=5,tthres=5)
SMDegrain(tr=2,thSAD=200,thSADC=100,contrasharp=true,prefilter=pre,prefilter=pre2,str=1.2,refinemotion=true)
RequestLinear(2*24)
FrameRateConverterMIX(FrameDouble=true)
You can only set one prefilter in SMDegrain and the white point is pretty low. Use 400 and adjust from there. That really depends on the source. Str of 1.2 is also quite below recommended default of 5.0.

Try:
Code:
pre=ex_Median(mode="IQMST",thres=255).DGHDRtoSDR(mode="pq",white=400)
STTWM(sw=50,tw=50,aw=100,sthres=5,tthres=5)
SMDegrain(tr=2,thSAD=200,thSADC=100,contrasharp=true,prefilter=pre,str=1.2,refinemotion=true)
RequestLinear(2*24)
FrameRateConverterMIX(FrameDouble=true)
LeXXuz is offline   Reply With Quote
Old 4th April 2023, 07:33   #2319  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 128
Quote:
Originally Posted by LeXXuz View Post
You can only set one prefilter in SMDegrain and the white point is pretty low. Use 400 and adjust from there. That really depends on the source. Str of 1.2 is also quite below recommended default of 5.0.

Try:
Code:
pre=ex_Median(mode="IQMST",thres=255).DGHDRtoSDR(mode="pq",white=400)
STTWM(sw=50,tw=50,aw=100,sthres=5,tthres=5)
SMDegrain(tr=2,thSAD=200,thSADC=100,contrasharp=true,prefilter=pre,str=1.2,refinemotion=true)
RequestLinear(2*24)
FrameRateConverterMIX(FrameDouble=true)
Hi LeXXuz,

Yes, I found that out the hard way, but I think I might have got it going, but I removed the DGHDR call, tho, afterwards.

I tried this, not sure if it worked, tho...

Code:
pre=DGHDRtoSDR(mode="pq",white=112)
pre2=ex_Median(mode="IQMST",thres=255) 
STTWM(sw=50,tw=50,aw=100,sthres=5,tthres=5)
SMDegrain(tr=2,thSAD=200,thSADC=100,contrasharp=true,prefilter=pre,str=1.2,refinemotion=true)
SMDegrain(prefilter=pre2)
RequestLinear(2*24)
FrameRateConverterMIX(FrameDouble=true)
But I will definitely try your script suggestion...



Quick Update:-

Just ran your script (only as a quick preview test), but it worked

Next thing I'm curious about is, FrameConverter doubles the original FPS, but is there a script/filter that you can enter the FPS you want ???
There probably is, I just haven't found it yet, or forgotten.

Last edited by FTLOY; 4th April 2023 at 07:44.
FTLOY is offline   Reply With Quote
Old 4th April 2023, 10:35   #2320  |  Link
LeXXuz
21 years and counting...
 
LeXXuz's Avatar
 
Join Date: Oct 2002
Location: Germany
Posts: 716
Quote:
Originally Posted by FTLOY View Post
Hi LeXXuz,

Yes, I found that out the hard way, but I think I might have got it going, but I removed the DGHDR call, tho, afterwards.

I tried this, not sure if it worked, tho...

Code:
pre=DGHDRtoSDR(mode="pq",white=112)
pre2=ex_Median(mode="IQMST",thres=255) 
STTWM(sw=50,tw=50,aw=100,sthres=5,tthres=5)
SMDegrain(tr=2,thSAD=200,thSADC=100,contrasharp=true,prefilter=pre,str=1.2,refinemotion=true)
SMDegrain(prefilter=pre2)
RequestLinear(2*24)
FrameRateConverterMIX(FrameDouble=true)
That way you would run SMDegrain twice. And the 2nd time with default settings and no HDR to SDR conversion for the prefilter either which would make your first call with those subtle settings pretty much useless.

Also you have quite low thresholds for 4k but use a pretty strong prefilter with IQMST mode of ex_Median.
You may want to balance that a little more. Your low thresholds plus extra refinement will do you no good to preserve fine details if your prefilter is too strong and kills them in the first place.
LeXXuz is offline   Reply With Quote
Reply

Tags
avisynth, dogway, filters, hbd, packs

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 09:00.


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