View Full Version : Adding/using dither/ GradFun3 to VirtualDub2
stormy1777
21st November 2018, 12:36
So, Hello_Hello, in this thread:
https://forum.doom9.org/showthread.php?p=1858027#post1858027
suggested to use GradFun3 to try and improve an encode from another thread :) :)
It seems to not be there by default:
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
Script error: there is no function named "GradFun3"
(L:\Open_Filter_test.avs, line 4)
---------------------------
OK
---------------------------
picked up latest dither from here:
http://ldesoras.free.fr/prod.html#src_ditheravsi
any chance someone knows how to "install" or "use" this, within VirtualDub2 ?
Inside are 2 dlls in win32/win64, as well as top level avsi scripts, but no clear indication how to "put this in the path" or have VD2 load them on startup or via a script?
I do have other AVS scripts that work fine... this thing looks different than a plugin or an external encoder, so not sure where/how to use it :) :)
Stormy.
poisondeathray
21st November 2018, 17:32
Put dither.avsi, and dither.dll in the plugins directory to autoload. You need to match the proper version for the .dll (32bit vs 64bit) with the avisynth version (32bit vs 64bit)
hello_hello
21st November 2018, 18:34
Now I feel a bit obligated.... ;)
If you have Avisynth installed you can put plugins in the Avisynth/plugins folder and Avisynth will auto-load them each time it runs. 32 bit versions of plugins for 32 bit Avisynth and the 64 bit versions for 64 bit Avisynth. It's probably less hassle to use 32 bit versions of plugins and 32 bit Avisynth, at least for the moment, so here's 32 bit instructions.....
You need dither.dll and avstp.dll from the win32 folder in the zip file.
The included scripts also need to be in the plugins folder (dither.avis and mt_multi_expand.avis). If you open dither.avis with Notepad you'll see the GradFun3() function if you scroll down a bit, so you definitely need it. Avisynth scripts can include functions, and often they contain nothing but functions (give it a couple of days and you'll probably be experimenting with creating your own :)). If a script has an avis extension and it's in the plugins folder, Avisynth will auto-load it too.
The "dither package" requires additional plugins, and there's often many versions to ensure confusion, and plugins can have dependencies of their own, but I sense you're committed and can't turn back now.....
AddGrainC (http://avisynth.nl/index.php/AddGrainC) needs to be in the Avisynth/plugins folder. It requires the Microsoft Visual C++ 2012 Redistributable Package. There's a link for it on the AddGrainC page in case you need to install it.
Dfttest (http://avisynth.nl/index.php/Dfttest).dll should be in the Avisynth/plugins folder. For additional funkiness, Dfttest requires libfftw3f-3.dll, but it's not an Avisynth plugin. Download fftw-3.3.5-dll32.zip from here (http://www.fftw.org/install/windows.html). libfftw3f-3.dll is inside. The 32 bit version needs to be in the Windows\SysWOW64 folder if you run a 64 bit flavour of Windows. For 32 bit Windows, it needs to be in the windows\system32 folder. There's a few plugins that require libfftw3f-3.dll, but sometimes with a different name, so make a copy of libfftw3f-3.dll and rename it fftw3.dll. Put fftw3.dll in the SysWOW64 or system32 folder as appropriate along with libfftw3f-3.dll.
RgTools (http://avisynth.nl/index.php/RgTools) is a required plugin and needs to be in the Avisynth/plugins folder. RgTools requires Microsoft Visual C++ Redistributable for Visual Studio 2017. There's a link on the RGTools page if you don't have it already.
mvtools2 is required. Download it here (https://github.com/pinterf/mvtools/releases). Copy the x86 version of mvtools2.dll to the Avisynth/plugins folder. Don't be afraid to do the same for Depan.dll and DepanEstimate.dll. You don't need them now but you will sooner or later. Microsoft Visual C++ Redistributable 2015 Update 3 (https://www.microsoft.com/en-us/download/details.aspx?id=53587) is a requirement for that flavour of mvtools2.
Masktools2 (https://github.com/pinterf/masktools/releases).dll should be in the Avisynth/plugins folder too.
To be honest I'd forgotten the whole dither tools package required that much work, but I've done most of it, and all that's left is a bit of downloading for you to do. :)
Don't be put off. Many Avisynth functions use the above plugins and once they're working they'll keep working. No doubt you'll need additional plugins down the road (my Avisynth/plugins folder contains around 80 avsi scripts and 50+ dlls), but you'll be off to a pretty good start once this is done, and relative to getting VD's external encoder option to work, it's fairly easy to do. :)
stormy1777
23rd November 2018, 15:27
Well, Hello^2...
Although I'm very determined overall, I think you've (grossly) over-estimated the "determination" going this route - in a fun way :) Trying to simplify things as much as possible :) however, since your nice/long/detailed response, decided to try it anyways, followed all steps.. I cannot believe if it's that complex why no1 zipped it all up but then possibly there are so many things that can go wrong, hence each one needs to dig their own hole :) :)
even noticed broken download links on this: http://www.fftw.org/install/windows.html
Tried something like this:
Vid = DirectShowSource("Y:\test.MOV", audio=false)
Vid = GradFun3(thr=0.25)
It failed with:
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
Script error: Invalid arguments to function "GradFun3"
(Y:\open_Filter_test.avs, line 4)
---------------------------
OK
---------------------------
even without any arguments to GradFun3, same error, so i think I'll pass on this effort, since it is way over my head, lots of moving parts, and seems impossible to debug if you're not a developer :)
maybe one day, until then, I'll just take the default filters and live with it or expand the filesize to make it look better.
Thanks so much!
Stormy
poisondeathray
23rd November 2018, 16:44
Tried something like this:
Vid = DirectShowSource("Y:\test.MOV", audio=false)
Vid = GradFun3(thr=0.25)
It failed with:
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
Script error: Invalid arguments to function "GradFun3"
(Y:\open_Filter_test.avs, line 4)
---------------------------
OK
---------------------------
Vid = DirectShowSource("Y:\test.MOV", audio=false)
Vid = GradFun3(Vid, thr=0.25)
Because you have variable = something, you don't have an implied "last"
This would work too, because now you have implied "last"
DirectShowSource("Y:\test.MOV", audio=false)
GradFun3( thr=0.25)
Is the same thing as
DirectShowSource("Y:\test.MOV", audio=false)
GradFun3(last, thr=0.25)
stormy1777
23rd November 2018, 17:16
oohhh.... wow, thanks for that rather basic and embarrassing avisynth lesson :) it then fails with this:
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
SmoothGrad: input must be planar.
(dither.avsi, line 1704)
(dither.avsi, line 1685)
(dither.avsi, line 114)
(L:\Open_Filter_test.avs, line 4)
---------------------------
OK
---------------------------
again, don't spend too much time on this, I don't see myself managing such a complex streamline....
Thanks much for everyone's help! hopefully this will help other brave folks :)
Stormy.
poisondeathray
23rd November 2018, 17:25
What is your source MOV ? what does mediainfo say about it?
The problem with DirectShowSource() , is it relies on your system installed codecs . So computer A might return something different than computer B. It can be quite unreliable , and has all sorts of problems with seeking
What does info() say about what DirectShowSource() is returning ?
DirectShowSource("Y:\test.MOV", audio=false)
Info()
It might be as simple as adding ConvertToYV12(matrix="rec709") , but it might be the wrong thing to do depending on what the source is
DirectShowSource("Y:\test.MOV", audio=false)
ConvertToYV12(matrix="rec709")
GradFun3( thr=0.25)
hello_hello
23rd November 2018, 20:09
You're so close now you must be able to hear the fat lady warming up.
I cannot believe if it's that complex why no1 zipped it all up but then possibly there are so many things that can go wrong, hence each one needs to dig their own hole
It's not always that complex. You just got lucky.
It's partly because everything's in a constant state of flux. For example, QTGMC is a very good de-interlacing script that requires quite a few plugins (all of the plugins you just installed are either requirements or necessary for some of it's options) and there was a link to a plugin package in the opening post of the original QTGMC thread. I think it's still there, because someone new to QTGMC at VideoHelp used it not so long ago, but the plugins are quite old and the latest version of the script won't work with some of them.
I created a new plugins package for it about a year ago, and despite the fact the link is buried in the middle of the QTGMC thread somewhere it's been download over 600 times, but the problem with plugin packages is they need to be maintained. Anyway...
LSMASHSource.dll should be in the "MeGUI\tools\lsmash" folder, if you haven't deleted MeGUI. Make a copy and put it in your Avisynth plugins folder (assuming you have the 32 bit version of MeGUI).
I don't think mov files need indexing as such, so try this first.
LSmashVideoSource("Y:\test.MOV")
Failing that....
It'll probably take several seconds to open because it'll index first.
LWLibavVideoSource("Y:\test.MOV")
poisondeathray
23rd November 2018, 20:43
I don't think mov files need indexing as such, so try this first.
LSMASHSource("Y:\test.MOV")
yes, MOV files don't need indexing with lsmash
But it's LSmashVideoSource
LSmashVideoSource("Y:\test.MOV")
hello_hello
24th November 2018, 02:19
Whoops. It was probably a failure to pay attention when copying and pasting. I fixed my post. Cheers.
stormy1777
24th November 2018, 10:04
wow, I deeply appreciate your replies to this thread, sounds like you're some sort of experts or created this maze yourself so as to trap us in this forever :) :)
Seems you are having so much fun, and I'm now on a road with no return.. follow the white rabbit, so:
Info() shows:
Colorspace: YUY2 1280x720 FPS: 59.9402
Fearing of using the "lsmash", that might "smash" my video, ok, lets make a back up, just in case (humor friends...), then, Info() shows:
Colorspace: YV12 1280x720 FPS: 59.9401
ok, so it converted to YV12 colorspace, which I suspect is a "good" thing for the GradFun3()..
LSmashVideoSource("Y:\test.MOV")
Info()
GradFun3()
no crashes, but in VD2, the video is not advancing, tried both play buttons, the timeline shows it is moving, but the actual video is frozen on first frame.
now, maybe that is expected, and even appears in the "fine print", that you cannot preview the magic before encoding, but really, impossible to edit in such a way, the preview is critical :)
Using my very old and basic skills of avisyth, attempted to do PIP, b/c that always helped decide/understand how things/filters/operations really behave, if it was me, all examples would be like that, to show original video and processed, attempted something like:
vid1 = LSmashVideoSource("Y:\test.MOV")
vid2 = LSmashVideoSource("Y:\test.MOV")
vid2 = GradFun3(vid2)
vid2 = vid2.ReduceBy2()
xpos = 0
ypos = 0
Overlay(vid1, vid2, mode="blend", opacity=100)
loaded OK, first frame looks as expected, however playing that in VD2 started a wonderful "fireworks" show, of all colors, blue, green, on both videos, all over the place, so , even the original video was affected?!!? I would expect the original video "vid1" to show unaffected, but it does not. Removed the GradFun3 and still similar crazy colors all over, pretty cool though, attached one screenshot for fun :)
Then replaced Lsmash with the direct show, and still things were super sluggish, and then noticed even older scripts are not working anymore (cannot seek, VD2 goes into cpu loop).. so possibly all these changes caused the system's codecs to change or something, or maybe that's how it was before and i just didn't notice???
I think i'll call it a day for this, since again, this is not my day job. will now focus on trying to get the original PIP scripts working again.. my use case is extremely limited in scope, just mux mov and mp3 :)
I deeply appreciate your help, but not sure being on the cutting edge is for me, since I don't have the background (yet) for all these terms, etc.
I think i need to reboot maybe it may clear things up, not sure...
Cheers....
Stormy.
hello_hello
25th November 2018, 11:40
I'd be very surprised if LSmash converted the colorspace. It has an option for doing so but you have to specify it. It's far more likely DirectShow was converting it. If you uploaded a small sample somewhere it'd speed up the process of finding the problem considerably. It's just a guessing game otherwise.
Could I be so bold as to condense your script a bit? It shouldn't have anything to do with the problem displaying the overlayed video. I don't know why that's happening.
vid1 = LSmashVideoSource("Y:\test.MOV")
vid2 = Vid1.GradFun3().ReduceBy2()
Overlay(vid1, vid2, x=0, y=0, mode="blend", opacity=100)
Although to compare the two, it might work better to stack them.
vid1 = LSmashVideoSource("Y:\test.MOV").Spline36Resize(640,360) # any resizing optional
vid2 = Vid1.GradFun3()
StackVertical(vid1, vid2) # or StackHorizontal
stormy1777
26th November 2018, 11:08
I have to admit, by this time almost forgot what GradFun3() is all about... but the "StackedVertical" got my attention, so, tried again, and new day, new luck!!!!
Rewrote the split to put the ORIGINAL smaller:
vid1 = LSmashVideoSource("Y:\test.MOV")
vid2 = vid1.GradFun3()
vid1 = vid1.ReduceBy2().Info()
Overlay(vid2, vid1, x=0, y=0, mode="blend", opacity=1)
and again, thanks for the StackVertical!!
So, it DOES work, but... no fat lady was singing :) :)
To be honest, without looking with a microscope, the two images look the same, so changed to
GradFun3(thr=1000)
there, clearly there is a huge difference, things are totally FUZZY on the bottom image... changed to "0" complained about having to be positive (so we know it works), then set to thr=0.01, but again, saw no noticeable difference..
anyways, Thanks for everyone's positive support and help... it was a journey, and now can mark checkbox been there, done that on GradFun3(), so I'm good until someone comes up with GradFun4() :)
Stormy.
StainlessS
26th November 2018, 12:18
Something to play with, choose your own values for Thr and ThrC
LSmashVideoSource("Y:\test.MOV") # clip is assigned to special variable Last
####### Config ########
THR = 1.2 # Default 1.2 (pick your own after check)
THRC = 1.2 # Default 1.2
DOSUB = True # True, put subtitles, else not
ORIGSIZE = True # Reduce stacked size to same as input source
#######
Result = GradFun3(Thr=THR , ThrC=THRC) # Calling GradFun3 with Special Last clip and assign result to Result
#Return Result # return Result clip if uncommented
d1 = ClipDelta(Result,Last,Amp=False) # Subtract Last clip from Result
d2 = ClipDelta(Result,Last,Amp=True) # Subtract Last clip from Result, and amplify
Last = (DOSUB) ? TSub(Last ,"Source" ,True,$0000AA) : Last # If DOSUB then Last is subtitled with FrameNumber on blueish bar, else no change
Result = (DOSUB) ? TSub(Result ,"Result") : Result # If DOSUB then Result is subtitled else no change
d1 = (DOSUB) ? TSub(d1 ,"Difference") : d1 # If DOSUB then d1 is subtitled else no change
d2 = (DOSUB) ? TSub(d2 ,"Diff, AMP'ed") : d2 # If DOSUB then d2 is subtitled else no change
Lft = Stackvertical(Last,Result) # Source Stacked above Result
Rgt = Stackvertical(d1,d2) # d1 Stacked above d2
StackHorizontal(Lft,Rgt) # Stacked x 4, is assigned to Last clip
W = Width # Width of Last clip (same as W=Last.Width)
H = Height
W = W / 2 # As for original source width
H = H / 2
Last = (ORIGSIZE) ? Spline36Resize(W,H) : Last # If ORIGSIZE then downsize, else no change
Return Last # End Of Script, returning Last clip
########################
# Return Clip Difference of input clips (amp==true = Amplified, show==true = show background)
Function ClipDelta(clip clip1,clip clip2,bool "amp",bool "show") {
amp=Default(amp,false)
show=Default(show,false)
c2=clip1.levels(128-32,1.0,128+32,128-32,128+32).greyscale()
c1=clip1.subtract(clip2)
c1=(amp)?c1.levels(127,1.0,129,0,255):c1
return (show)?c1.Merge(c2):c1
}
# Stack Overhead Subtitle Text, with optional FrameNumber shown.
Function TSub(clip c,string Tit,Bool "ShowFrameNo",Int "Col"){
c.BlankClip(height=20,Color=Default(Col,0))
(Default(ShowFrameNo,False))?ScriptClip("""Subtitle(String(current_frame,"%.f] """+Tit+""""))"""):Subtitle(Tit)
Return StackVertical(c).AudioDubEx(c)
}
stormy1777
26th November 2018, 12:47
So much power floating unaccounted for.. Thanks StainlessS... Very impressive 4 split, I'll clearly need to study this topic/area a bit more.. very nice output!!!
Thanks Hello*2 for "insisting" and providing all the earlier setup details...
Need to figure out what to do with this seemingly powerful tool :) :) :) :) :)
Groucho2004
26th November 2018, 13:47
I find flash3kyuu_deband (https://forum.doom9.org/showthread.php?t=161411) much more effective than any of the GradFun implementations. Also, much better detail retention. Just my 2c.
StainlessS
26th November 2018, 14:52
I dont think I've every tried any debanding whotsit, but am quite sure that I have both script functions, maybe I'll givem a try one day.
Stormy,
I'll leave it to you to mod this line with the flash3 thingy, "Result = GradFun3(Thr=THR , ThrC=THRC)", and to change config to whatever args it uses,
and similarly supply in the flashy function call.
Hope that the script function requirement dont differ too much from Gradfun3, but even if there are some additional plugs required, there will come a time
when you have pretty much all the major plugs set up, and most things will become a lot easier.
If you want a quick easy reference for avisynth, see Stainless@MediaFire below this post, in the DATA directory there is a compressed help file (*.chm),
can put on a hot key for instant access. Study the entire docs set, and you will soon become quite proficient, good luck.
Groucho2004
26th November 2018, 15:08
I dont think I've every tried any debanding whotsit, but am quite sure that I have both script functions, maybe I'll givem a try one day.
Here's a clip (https://www.dropbox.com/s/sy4h1zp29fhqksi/strong_banding.mkv?dl=1) with strong banding I made a long time ago for testing. Just compare f3kdb() / gradfun3() with this clip.
Edit: Here's another good test clip (https://www.dropbox.com/s/88klxys2d4eevin/Gradient2K.mkv?dl=1)
StainlessS
26th November 2018, 17:38
Hey G2K4, you got dat dare f3kdb thing, seems to be bit AWOL, only the Github source seems available, and I dont really fancy trying to compile that lot.
Maybe someone should archive it somewhere, and post valid link on wiki.
EDIT: OK, got the plugin, see end of post.
Stormy,
Take a peek here to whet your appetite,
Some HanFrunz stuff (yep its nearly that time again everybody):-
2010:- https://forum.doom9.org/showthread.php?t=158676
2011:- https://forum.doom9.org/showthread.php?t=163597
2012:- https://forum.doom9.org/showthread.php?t=166752
2013:- https://forum.doom9.org/showthread.php?t=169943
2014:- https://forum.doom9.org/showthread.php?t=171573
2015:- https://forum.doom9.org/showthread.php?t=172979
2016:- https://forum.doom9.org/showthread.php?t=174134
2017:- https://forum.doom9.org/showthread.php?t=175126
2018:- Coming soon to a cinema near you.
Gavino YUV demo as animated GIF:- https://forum.doom9.org/showthread.php?p=1402326#post1402326
(And see post 1 for the creation script)
Some DavidHorman stuff,
Quad:-
https://forum.doom9.org/showthread.php?p=1595308
(And ~1MB demo by Martin53 using Davids plug):- http://www.mediafire.com/file/hyz3tl...rbars.mp4/file
rgba_rpn0.1.zip
https://forum.doom9.org/showthread.php?p=1738374
Visible Human Project, quite amazing stuff from David (he da man!).
https://forum.doom9.org/showthread.php?p=1792302#post1792302
Think I'll go to bed, hard to keep my eyes open. (well after I finish my glass of perry).
EDIT: From this thread:- https://forum.doom9.org/showthread.php?t=174527&highlight=BouncingBallMovie
BouncingBallMovie(~198KB):- http://www.mediafire.com/file/nh8mzennpvib94s/BouncingBallMovie.mp4/file
BouncingBallMovie2(~1MB):- http://www.mediafire.com/file/ijyrq530512tybi/BouncingBallMovie2.mp4/file
James Bond style Intro(~2MB):- http://www.mediafire.com/file/tp7290587f2ft26/SpotExpose2.mp4
EDIT: ChaosKing to the rescue:- http://chaosking.de/repo/avsfilters/Restoration_Filters/Debanding/
5 versions of Flash3kyuu, including 2x x64 packages.
Groucho2004
26th November 2018, 17:55
Hey G2K4, you got dat dare f3kdb thing, seems to be bit AWOL, only the Github source seems available, and I dont really fancy trying to compile that lot.
Maybe someone should archive it somewhere, and post valid link on wiki.
I have added it to my 'Stuff' page.
StainlessS
26th November 2018, 18:02
Thanks G2K4, me found it in ChaosKing's suppository :)
(but methinks me will down your compile too).
EDIT: Damn, me had to refresh your Stuff Page again, FireFox shows cached page unless F5 refresh.
Groucho2004
26th November 2018, 18:07
but methinks me will down your compile too.It's not my compile, just a mirror. I also added the mirror link to the Wiki.
Thanks G2K4, me found it in ChaosKing's suppositoryDo you have a link for that? It's always good to have some backup suppositories. :p
StainlessS
26th November 2018, 18:33
Backup (or should it be Back Up :) ) Suppositories as via Avisynth.nl HomePage, ExternalFilters, DownLoad Sites:- http://avisynth.nl/index.php/External_filters#Download_sites
EDIT: I think user Librarian used to have a significant archive, but dont remember where (and he dont come here often now).
Groucho2004
26th November 2018, 18:38
Suppositories as via Avisynth.nl HomePage, ExternalFilters, DownLoad Sites:- http://avisynth.nl/index.php/External_filters#Download_sitesThanks!
stormy1777
26th November 2018, 18:41
Tin Woodman, thanks so much!!! Believe it or not, immediately pressed your MediaFire link on first reply; was lost from amount of files, and said... hmm... one day I'll be back to this Emerald City..
Well, that took few hours, now loaded that help file, and... lo-and-behold, the stack vertical is on the first page!! so, definitely, I'll find more time in the future to look through that file as things come up :)
Groucho:
Also tried the TEST clip, I mean, the real test clip, not the spinning girl :) :)
Fails to open for some reason.. the .mkv itself opens OK directly in VD2, but not through the AVS script. Fails with:
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
LSMASHVideoSource [Fatal]: Failed to read an input file
(y:\temp\test.avs, line 3)
---------------------------
OK
---------------------------
and, line 3 is:
LSmashVideoSource("Y:\TEMP\Gradient2K.mkv")
changing it to a MOV test clip, loads fine:
LSmashVideoSource("Y:\TEMP\test.mov")
reading the FAQ: http://avisynth.nl/index.php/FAQ_loading_clips#How_do_I_load_MP4.2FMKV.2FM2TS.2FEVO_into_AviSynth.3F
it says to install and use FFmpegSource, however, that thing is apparently not defined? reading more folks say to use this construct for mkv:
A = FFAudioSource(X)
V = FFVideoSource(X)
AudioDub(V, A)
in this case it is simply this line:
FFVideoSource("Y:\TEMP\Gradient2K.mkv")
Loaded OK, but again, I'm not a hard-core A/V person, to me, the source looks better than the processed clip..
almost looks like some sort of "smoothness" filter is needed....
Anyways, I'm eternally thankful to everyone for the info/support, hopefully this thread will help someone else in the future too :)
Stormy.
poisondeathray
26th November 2018, 18:48
Avisynth open failure:
LSMASHVideoSource [Fatal]: Failed to read an input file
For LSmash in avisynth,
LWLibavVideoSource() for MKV or other containers - this requires indexing (automatic)
LSMASHVideoSource() for MP4, MOV - no indexing required
StainlessS
26th November 2018, 18:55
LSmashVideoSource is only for ISO container files, with these extensions (eg MOV, MP4 and some others of similar type)
Function IsISOFileName(String s) {
s=RT_GetFileExtension(s) Return(s==".mov"||s==".mp4"||s==".m4v"||s==".3gp"||s==".3g2"||s==".mj2"||s==".dvb"||s==".dcf"||s==".m21")
}
The Other LSmash source filter would probably work ok, cant offhand remember what its called (I usually convert everything to AVI with ffmpeg, I find it less hassle).
EDIT: PDR gave name of other filter above.
the source looks better than the processed clip
You have to find the "Sweet Spot", settings.
Gotta get some sleep.
EDIT:
I usually convert everything to AVI with ffmpeg, I find it less hassle
REM We DO NOT LIKE SPACES IN FILE NAMES (REM == REMark ie comment)
setlocal
REM Where to Find ffmpeg
set FFMPEG="C:\BIN\ffmpeg.exe"
REM Where to get input file, No terminating Backslash, "." = current directory (ie same as dir .bat file)
set INDIR="."
REM Where to place output file, No terminating Backslash. "." would be same as .bat file
set OUTDIR="D:"
REM Below, can add extensionas as eg *.WMV (SPACE separated)
FOR %%A IN (*.mp4 *.vob *.mpg *.TS) DO (
REM ****** Un-REM ONLY one of below lines *******.
%FFMPEG% -i "%INDIR%\%%A" -vcodec copy -acodec copy "%OUTDIR%\%%~nxA.MKV"
REM %FFMPEG% -i "%INDIR%\%%A" -vcodec utvideo -acodec copy "%OUTDIR%\%%~nxA.MKV"
REM %FFMPEG% -i "%INDIR%\%%A" -vcodec utvideo -acodec pcm_s16le "%OUTDIR%\%%~nxA.AVI"
REM *********************************************.
)
REM ... Above UN-REM'ed lines :
REM (1) Remux, copy both video and audio (output MKV).
REM (2) UtVideo lossless video, copy audio (output MKV).
REM (3) UtVideo lossless video, PCM audio (output AVI).
Pause
EDIT: *.VOB & *.MPG usually exceptions, I nearly always use DGIndex/MPeg2Source for those.
stormy1777
26th November 2018, 20:59
yeah, confirmed: LWLibavVideoSource() worked directly on the MKV.. nice to have friends in high places :)
StainlessS
27th November 2018, 10:53
Added last edit in my prev post.
StainlessS
27th November 2018, 16:36
G2K2[EDIT:4], (and for any other that likes editing the Wiki),
Here is DavidHorman repository:- http://www.horman.net/avisynth/
Groucho2004
27th November 2018, 17:09
G2K2, (and for any other that likes editing the Wiki),
Here is DavidHorman repository:- http://www.horman.net/avisynth/Thanks.
hello_hello
27th November 2018, 17:25
stormy1777,
The idea of GradFun3 is to fix or prevent banding. If there's no banding in your source, then not seeing any difference is the ideal scenario.
Based on my single frame test, flash3kyuu_deband looks pretty good. I hadn't used it before. I tested with the default settings.
These screenshots are the output from the Avisynth script though, so I still have some "how does it look after it's encoded" testing to do, as well as some "how does it look after noise filtering" testing.
It's not too often I'd need to fix banding like this. For me, the idea is usually to prevent it when encoding, and GradFun3 has generally been doing the job. Still there have been times when I've struggled with it a bit, so I will be trying out flash3kyuu_deband. I tested with flash3kyuu_deband 1.5.1 as the links in the opening post of the doom9 thread weren't working.
I found sneaker_ger's link later though. There's newer versions there. https://forum.doom9.org/showthread.php?p=1841014#post1841014
I struggle to see the banding below on my PC monitor (I'm still using a CRT) but running full screen on my TV it's hard to miss.
Original
https://i.postimg.cc/ZWxWfrSq/original.png (https://postimg.cc/ZWxWfrSq)
GradFun3()
https://i.postimg.cc/fkYDjMZz/gradfun3.png (https://postimg.cc/fkYDjMZz)
f3kdb()
https://i.postimg.cc/QKZsGygZ/f3kdb.png (https://postimg.cc/QKZsGygZ)
To get to the full size version after clicking on the thumbnail you need to right click on the image and select "view image". Either that or download it.
hello_hello
27th November 2018, 17:44
flash3kyuu_deband did well again here (banding on the wall and on the filing cabinet in front of the guy), and doesn't seem to be blurring any detail where it shouldn't.
Original
https://i.postimg.cc/TyRBmWGm/original-2.png (https://postimg.cc/TyRBmWGm)
Gradfun3()
https://i.postimg.cc/7GL8vJWD/gradfun3-2.png (https://postimg.cc/7GL8vJWD)
f3kdb()
https://i.postimg.cc/t1Cm7QtN/f3kdb-2.png (https://postimg.cc/t1Cm7QtN)
Edit: Fixed the link for screenshot 3.
I'll be interested to see how this relates to compressibility when encoding. The file sizes for the screenshots in this post (I also saved them as jpg with 80% quality, just to see). When encoding, GradFun3 tends to increase compressibility a little, if anything.
Original: PNG 318.4 kB, JPG 46.6 kB
GradFun3: PNG 503.5 kB, JPG 45.9 kB
f3kdb: PNG 851.5 kB, JPG 47.0 kB
stormy1777
27th November 2018, 22:14
Hello!! second post first and 3rd url are the SAME url, but first post convinced me to try this deband, and it seems promising! have not tried it on my source (which most definitely has banding, but round ones, say if u were to video car's headlights headon in the dark :)
ok, so got it to work from a script, but question is it possible to somehow create a VD Filter and "import" it into VD2 ? when tried to LOAD the .dll it reported that no filter is there, probably expected:
---------------------------
VirtualDub Error
---------------------------
Module "C:\Program Files (x86)\AviSynth\plugins\flash3kyuu_deband.dll" does not contain VirtualDub filters.
---------------------------
OK
---------------------------
is there a way to create some ?text? file or wrapper that will allow it to be loaded directly from VD2?
Thanks.
Stormy.
hello_hello
28th November 2018, 01:40
I encoded the video I was using for my screenshots. After it's encoded, the version with flash3kyuu_deband still looked a bit better, but as I suspected, it does come at the cost of compressibility. Not that it matters too much to me. Unless the file size was totally out of control I'd rather it looked better.
The video was just under an hour and the resolution was 1280x640. I used something close to preset slower (and tune film) with CRF18 for x264. I used the defaults for both GradFun3 and flash3kyuu_deband.
The GradFun3 version came in at 559 MB and 1347 kb/s.
For flash3kyuu_deband it was 656MB and 1582 kb/s.
Hello!! second post first and 3rd url are the SAME url, but first post convinced me to try this deband, and it seems promising! have not tried it on my source (which most definitely has banding, but round ones, say if u were to video car's headlights headon in the dark :)
Thanks. I fixed the third link.
ok, so got it to work from a script, but question is it possible to somehow create a VD Filter and "import" it into VD2 ? when tried to LOAD the .dll it reported that no filter is there, probably expected:
is there a way to create some ?text? file or wrapper that will allow it to be loaded directly from VD2?
Not that I know of, but why not just create an Avisynth script and use it that way?
Groucho2004
28th November 2018, 01:44
I encoded the video I was using for my screenshots. After it's encoded, the version with flash3kyuu_deband still looked a bit better, but as I suspected, it does come at the cost of compressibility.You can control the amount of grain added with the grainY / grainC parameters. Default is 64 (dither_algo > 0). I found that 32 for both is sufficient for light banding.
hello_hello
28th November 2018, 09:00
You can control the amount of grain added with the grainY / grainC parameters. Default is 64 (dither_algo > 0). I found that 32 for both is sufficient for light banding.
I encoded it again with 32 for the grain arguments and it took the file size down to 577 MB and the bitrate to 1391 kb/s. Pretty close to the GradFun3 bitrate, although after encoding I thought the GradFun3 defaults did better.
Still, there's been times when I've had to get GradFun3 to blur more than I'd like to fix severe banding, so flash3kyuu_deband will still be something I'll try as an alternative.
The same frame I posted screenshots for earlier, only this time it's the encoded versions rather than the script output.
Source
https://i.postimg.cc/ZWxWfrSq/original.png (https://postimg.cc/ZWxWfrSq)
GradFun3()
https://i.postimg.cc/NKyNt1Nt/grafun3.png (https://postimg.cc/NKyNt1Nt)
f3kdb(grainY=32,grainC=32)
https://i.postimg.cc/dDtjv21f/f3kdb-grain32.png (https://postimg.cc/dDtjv21f)
f3kdb()
https://i.postimg.cc/18xFgwms/f3kdb.png (https://postimg.cc/18xFgwms)
Groucho2004
28th November 2018, 11:52
There's another knob you can try - "dynamic_grain". You may also do debanding in 16 bit stacked mode:
Dither_convert_8_to_16()
...other 16 bit stacked filters...
f3kdb(input_mode = 1, output_mode = 1, keep_tv_range = true, dynamic_grain = true, grainY = 32, grainC = 32)
DitherPost()
Or, with AVSPLUS you can do this:
ConvertBits(16)
...other 16 bit filters...
ConvertToStacked()
f3kdb(input_mode = 1, output_mode = 1, keep_tv_range = true, dynamic_grain = true, grainY = 32, grainC = 32)
ConvertFromStacked(bits = 16)
ConvertBits(8, dither = 0)
stormy1777
28th November 2018, 13:32
Not that I know of, but why not just create an Avisynth script and use it that way?
I'm trying to use the GUI as much as possible, if it was integrated, more likely i'd use it... not that i have an issue with scripts, it's just more time consuming :) as shown by the Xmax greeting set, scripting is a very POWERFUL tool, so no doubt will use it from time to time :)...
It sounds like one needs to compile some code to generate a .vdf file, i was naively thinking it is some xml/txt that points to some binary/dll :) :)
stormy1777
28th November 2018, 13:55
BTW, added a call to: f3kdb() (using a *2* line script, open and f3kdb()), it (greatly) reduced filesize, so to make things more "fair" (filesize, or kbps), reduced CRF (from 16 to 14) this should increase quality, I *think* resulting looks better, it came at same filesize/kbps compared to the non-f3kdb.. so I'll use this for a bit and see :) the only "annoyance" is that for each file need to write a new script, but that's fine :) Thanks thanks to all that helped get us thus far, I would not have believed what I'm doing now, not that I really know it all, but it feels good :) :)
Groucho2004
28th November 2018, 14:03
BTW, added a call to: f3kdb() (using a *2* line script, open and f3kdb()), it (greatly) reduced filesizeWhat? f3kdb adds grain which increases complexity and therefore required bitrate for a given CRF.
hello_hello
28th November 2018, 14:54
I'm trying to use the GUI as much as possible, if it was integrated, more likely i'd use it... not that i have an issue with scripts, it's just more time consuming :) as shown by the Xmax greeting set, scripting is a very POWERFUL tool, so no doubt will use it from time to time :)...
It sounds like one needs to compile some code to generate a .vdf file, i was naively thinking it is some xml/txt that points to some binary/dll :) :)
It works the other way around though. You can load VD plugins into Avisynth with LoadVirtualDubPlugin() :)
Edit: Originally all VD plugins were RGB only, but I know that slowly changed, and Avisynth+ has even more options compared to Avisynth 2.6 and also mentions VD2 support, but I only had a quick read and at the moment I don't understand most of it.
http://avisynth.nl/index.php/LoadPlugin#LoadVirtualDubPlugin
http://avisynth.nl/index.php/FAQ_using_virtualdub_plugins
Avisynth is a little integrated into VD2, although I used VD2's script editor for the first time about 30 seconds ago, however you can open VD2, open the script editor under the Tools menu, and type in a line to open the source video.
I typed LsmashVideoSource("D:\test.mp4") into the text editor, Gradfun3() on the second line, used the "File/Save and open as AVI" menu, and the Avisynth output opened in VD2.
One issue I found, was when saving a script for the first time, you must specify the file name with the avs file extension. The script editor appears not to add it automatically and it results in an "AVI Import Error" (which I recall you stumbling across in another thread). It also doesn't seem possible to resave a copy of a script with a new name after you've saved it the first time, which is a little annoying. The script editor has a few options I don't understand yet, but I had no problem editing the video with VD2 as if I'd opened the source directly.
You're obviously familiar with VD and prefer using it (nothing wrong with that), but I don't think it's hard to take advantage of both worlds.
One disadvantage of editing with VirtualDub is you have to encode the video or save it as a project and you can't open the unfinished project with a program other than VD (correct me if I'm wrong).
Sometimes it might be easier to do things via Avisynth. For example applying different filtering to different sections of a video. I do this sort of thing frequently:
A.Trim(0,2191).Crop(8,0,-8-0).Spline36Resize(640,480)\
++A.Trim(2192,2255).Spline36Resize(640,480).Tweak(Sat=0.9)\
++A.Trim(2256,3638)Spline36Resize(640,480).GreyScale()\
++A.Trim(3639,0).Crop(18,14,-8-0).Spline36Resize(640,480)
A totally fictional example, and you can probably do something similar with VD using it's own filters, but I've barely used VD for much more than basic cutting and remuxing myself, so I'm not sure how easy it is.
Anyway, whatever works for you....
hello_hello
28th November 2018, 15:03
BTW, added a call to: f3kdb() (using a *2* line script, open and f3kdb()), it (greatly) reduced filesize...
That seems a little odd given by default f3kdb() appears to add a fair amount of noise/grain, but I did notice for at least one encode (I haven't tested it scientifically) the file size did increase when I didn't use GradFun3, and it adds noise too.
Given I've re-encoded the video I was using for testing to compare bitrates, but I haven't re-encoded it without any debanding as a comparison, I'll do so shortly just to see how the bitrate compares.
hello_hello
28th November 2018, 16:16
Here's the file/size bitrate results again, encoded without any filtering included. The same x264 settings each time. Similar to preset slower, with tune film and CRF18.
Re-encoded without any filtering, 547 MB, 1318 kb/s
With GradFun3(), 559 MB, 1347 kb/s
With f3kdb(), 656MB, 1582 kb/s
With f3kdb(grainY=32,grainC=32), 577MB, 1391 kb/s
I'm not claiming that'd be typical. It's just how it worked out for one source.
I haven't tried Groucho2004's most recent suggestions for f3kdb yet. That'll probably happen another day after my motivation has replenished itself.
stormy1777
28th November 2018, 23:58
Hello!Hello!!
This suggestion:
A.Trim(0,2191).Crop(8,0,-8-0).Spline36Resize(640,480)\
++A.Trim(2192,2255).Spline36Resize(640,480....
should be outlawed... it's crazy... I'm doing 100 other things, this Video thing is really a SIDE deal, so cannot afford to dig too deep constantly...
As for file size, started to not trust myself, so re-did this re-encode 6 more times, each is about 24minutes :) the PC that does this is not my working desktop, so no worries it can run 100%cpu/gpu non-stop and it doesn't matter :)
using the Script Editor had 2 lines:
LSmashVideoSource("M:\temp\test.MP4")
f3kdb()
crf=14, film, slower, Press F7 (on script editor and main window), change to MP4 and let it run audio Copy Stream, Video full processing.
The f3kdb ran 3 times (not back to back, but alternating), and all 3 resulted in identical filesize and checksum/content is 100% identical - that is expected i suppose :)
size: 203.2MB Frames: 5269, kbps 7897 1920x1080 25fps
Then, the 3 runs withOUT f3kdb (just # the second line, and press F7 in Script Editor - video appears to RELOAD), then F7 in main window, and sizes did NOT come the same!!! each run resulted in different size file???? :)
sizes:
276.0MB frames 5269, 1920x1080, 25fps, 10795kbps
276.2MB frames 5269, 1920x1080, 25fps, 10804kbps
284.3MB frames 5269, 1920x1080, 25fps, 11125kbps
I have absolutely NO clue why:
1) files are not identical in the non-f3kdb case, that is very very strange, it should be a digital encoding, should be 100% same, unless there is some "randomness" to help compress??? but then file sizes have a pretty large delta (276-284)??
2) f3kdb vs. non-f3kdb results in SMALLER filesize, again, not sure, but I suspect it is HIGHLY dependent on source video, and so, maybe it ADDS "grain" or "pixels" which might add complexity, but it may "FLATTEN" certain areas (deband??), which would make them "compress better" so over-all, it adds, but after compression, it REDUCES, but that's just a theory, by all means it reduced size on my files thus far, which allowed to REDUCE CRF from 16 to 14 and retain roughly same filesize..
unless the f3kdb plugin is installed incorrectly, and somehow misses bits, that i would not know, video "seems ok", my eyes are just getting used to this level of attention :)
Thanks. Stormy.
hello_hello
29th November 2018, 02:14
I don't know what's going on there. I used VD2 to encode some of the video I'd been using for testing (I'd been encoding with MeGUI). I added Trim(0,5000) to the end of the script so as just to encode a section of it. The output format was MP4. No audio included.
Two encodes without f3kdb came out exactly the same. I used the File/SaveAs method and x264 was configured for Preset Slower, High Profile Level 4.1, Tune Film and CRF18. Even Properties in Explorer showed the same file size in number of bytes. (1426 kb/s & 35,712,281 bytes).
With f3kdb in the script, two encodes also came out exactly the same. I thought they might be a little different, but maybe the noise being added by f3kdb isn't so random (1823 kb/s & 45,639,536 bytes).
The script was this:
FFVideoSource("E:\0102.mkv")
f3kdb()
Trim(0,5000)
stormy1777
29th November 2018, 18:38
I don't want to waste everyone's time, this might be something specific with my "practices", which I'm not sure are even valid, my background is not really A/V related, I sort of learn as i go along :)
Was curious, did few more tests, it's pretty hard to say what's going on... this clip is ~30min long, trying to shorten it (time-lapse) to ~3min, so, bumped framerate to 165 (source is 25), then set "Convert to fps: 25", resulting file ends up 25fps.. all the tests were with this configuration.
the ones with the f3k always show up smaller than without it :)
in the GUI, did a selection of frames (0-6000) then F7 (which saves just that section), and sizes with f3k were constant and always lower without it (sizes without were also constant!)
then took the end of the clip, frames 6000-end, F7, again, sizes behaved same as above, so, no size differences....
went back to full clip, some came at 276MB, others at 284MB, for same settings, so on full clip there IS size difference :) :)
so it seems this size change happens with larger source?, not sure.. but at this point, I'm fine with what it is...
Saybe the "convert to 25" picks frames randomly each time, and thus the changes, not sure... the other "suspicion" was F5 vs F7 in the Script editor (causing it to load "incorrectly"?), and 'alternating' i.e. not doing same clip over and over, and finally, using the SAME UI interface all this time (not re-launching it anew for each encode) again, I have no conclusive proof, but there seems to be something there..
also, f3k is, as expected, highly dependent on input source, maybe if there IS banding in source, it reduces, if not so much, it might increase?
again, I'm fine with how it is, so don't worry about it too much, as more clips arrive in the coming days i may learn more....
Stormy.
hello_hello
30th November 2018, 11:50
I can't explain why the full clip should produce different results each time. Were you doing the frame rate stuff with VD?
I was only encoding 5001 frames from my original test clip, but I couldn't get VD to produce inconsistent results. File sizes were always the same with f3kdb() and always the same without it.
I tried duplicating what I think you're doing to the frame rate with Avisynth, and the result was identical, with the exception of there being an extra frame at the end, and the bitrate was higher with f3kdb than without it, but I suspect you're correct and it could be somewhat source dependant.
FFVideoSource("E:\0102.mkv")
f3kdb()
Trim(0,5000)
AssumeFPS(165)
ChangeFPS(25)
The file sizes being different for the full encode does seem a bit of a mystery. I checked my encodes with MPC-HC. The right arrow on the keyboard tells MPC-HC to jump from one keyframe to the next, and in each case they were always in the same place. I don't know why that'd change just because the encode was longer.
Unless LSmash isn't always outputting the requested frame correctly. Do the encodes appear to contain the same frames?
I'd be tempted to try again, just in case, using LWLibavVideoSource (it'll index the first time you open the source) or even FFVideoSource (http://avisynth.nl/index.php/FFmpegSource), but I'm a bit obsessive about discovering the "why" in situations like that.
Even though I didn't do it for the example above, for FFMS2 it's often better to decode in a single thread, or at least do so if you're experiencing problems.
FFVideoSource("E:\0102.mkv", threads=1)
stormy1777
30th November 2018, 14:20
Yes, I can sometimes spend days or weeks chasing such things, heck, if you're in, I'll stick around for a bit longer.. so far, server is holding up nicely despite the hours of almost continuous encoding :)
Attached is the screenshot of the FPS trickery (not sure if that is the right way, i think next time I'll get the source at higher FPS).
Also attached is File Info from VD once opened, see size is different, totaly number of frames is reported same as 5269, kbps is higher in one vs. the other, not sure why....
For completeness this is mediainfo of the two files (both are without f3k):
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 276 MiB
Duration : 3 min 30 s
Overall bit rate : 11.0 Mb/s
Writing application : Lavf57.78.100
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L5
Format settings : CABAC / 8 Ref Frames
Format settings, CABAC : Yes
Format settings, RefFrames : 8 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3 min 30 s
Bit rate : 10.8 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.208
Stream size : 271 MiB (98%)
Writing library : x264 core 152 r2851M ba24899
Encoding settings : cabac=1 / ref=8 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=9 / psy=1 / psy_rd=1.00:0.15 /
mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=6 /
lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 /
b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40
/ intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=14.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40
/ aq=1:1.00
Color range : Limited
Matrix coefficients : BT.470 System B/G
Codec configuration box : avcC
Audio
ID : 2
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Codec ID : mp4a-6B
Duration : 3 min 30 s
Duration_LastFrame : -20 ms
Bit rate mode : Constant
Bit rate : 192 kb/s
Channel(s) : 2 channels
Sampling rate : 44.1 kHz
Compression mode : Lossy
Stream size : 4.81 MiB (2%)
Default : Yes
Alternate group : 1
LARGER file:
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 284 MiB
Duration : 3 min 30 s
Overall bit rate : 11.3 Mb/s
Writing application : Lavf57.78.100
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L5
Format settings : CABAC / 8 Ref Frames
Format settings, CABAC : Yes
Format settings, RefFrames : 8 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3 min 30 s
Bit rate : 11.1 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.215
Stream size : 279 MiB (98%)
Writing library : x264 core 152 r2851M ba24899
Encoding settings : cabac=1 / ref=8 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=9 / psy=1 / psy_rd=1.00:0.15 /
mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=6 /
lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 /
b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40
/ intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=14.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40
/ aq=1:1.00
Color range : Limited
Matrix coefficients : BT.470 System B/G
Codec configuration box : avcC
Audio
ID : 2
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Codec ID : mp4a-6B
Duration : 3 min 30 s
Duration_LastFrame : -20 ms
Bit rate mode : Constant
Bit rate : 192 kb/s
Channel(s) : 2 channels
Sampling rate : 44.1 kHz
Compression mode : Lossy
Stream size : 4.81 MiB (2%)
Default : Yes
Alternate group : 1
Results with FFVideoSource as they become available...
stormy1777
1st December 2018, 09:40
Ok, so.. Tried FFVideoSource and it did NOT reproduce, tried saving 3 times alternate between with/out f3k function (2 lines in script), pressed F5 or F7 in Script Editor, then F7 in main UI, just changed file name to increment counter, and it did NOT reproduce. All sizes were identical.
For the record, on this source, with f3k@crf-14 198.2MB vs. withOUT f3k: 276.0MB... so it seems something related to the indexing done by LSmashVideoSource.
EDIT: Indeed FFVideoSource did take a bit of time to initially OPEN the file (creating index), but it was 100% reliable in final size.. reading on the lsmash open, the advantage is no-upfront index, so maybe that logic along with the FPS trickery is causing each run to fall on different frames, hence different final compressed size.. really NO clue, i would argue that is a bug, but do not have the resources or knowledge to prove it.. switched to FFVideoSource, it is a bit slower on the initial OPEN, but fine afterwards, and 100% predictable, at least on this specific source :)
Thanks for all the tips.. i think we can move on to other things :) :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.