meguIV: The Official Akiba-Online DVD Encoder (v1.0.1.1)

no__One

Active Member
May 27, 2007
947
175
43
My mistake is unforgivable. I took you to apologize.

This is with the new QuickTGMC 3.0.

A
QuickTGMC (preset = "Placebo", NoiseBypass = 1, NoiseRestore = 0.5, Lossless = 1, Sharpness = 1.2)

OR

B
QuickTGMC( Preset="Very Slow", MatchPreset="Medium", SourceMatch=3, Lossless=2, MatchEnhance=0.6, Sharpness=0.25, NoiseBypass=2, NoiseRemove=1.0, DetailRestore=0.5, NoiseRestore=0.1, Sigma=3, NoiseDeint="Generate" )

I rephrase my question slightly:
- Are these settings sufficiently general to be appropriate / applied to most JI Videos like using Light EdgeClean without fear of artefacts
or other type of problem ?
- And The difference with B is really noticeable and as such will bring a real gain in terms of detail / accuracy ?

Ps: Like Mr Snakeboy, I am open and available for any beta testing.
I am aware that my contribution will be more modest in light of yours Crasiest Rigs, I was trolling a snail ... Finally, better late than never.

Regards.
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
0
They are both high quality settings, they will work in the majority of cases. However, A might be rather sharp and B could be affected by noisy sources.

That example B is taken from the script comments - it's only an example - it's not supposed to be the best way. Better to start with this:
Code:
QuickTGMC( Preset="A", TR2=B, SourceMatch=3, Lossless=2, Sharpness=C, \
           NoiseBypass=2, NoiseDeint="Generate", EdiThreads=D )
Set A to "Slow", "Slower" or "Very Slow"
Set B to 1 for a clean source, 2 or 3 for noisier sources (or if you like a smoother result)
Set C = 0.2 to 0.5 depending on preference (try a small clip and see)
Vary D until you find the best speed on your machine - start with the number of cores in your system

Once you have this template, you only need to tweak B for each source (and maybe C). You won't need EdgeClean except for sources with major halos (e.g. some Imouto from about a year ago). You can speed it up by dropping the NoiseDeint setting first, then maybe the NoiseBypass setting.

This will certainly capture more detail than your Placebo setting, but it's just as certain that some people won't notice the difference. It depends on how much you are upscaling and how big your screen is (resolution and size of monitor/TV).
 

no__One

Active Member
May 27, 2007
947
175
43
Mr Vitreous, Thank you for your concern and your time.

Each time, I am impressed and in awe of your ability to make complex things accessible and understandable to the mortal world.

Without your generosity, your skills and time devoted to demystifying the Rip / Encoding world, I never would have dared venture into it.

With my limited skills and my English level to level with the daisies, I hope I can make you understand how I am stoneware for all the help you have given me.

Again, just thank you.

I know I repeat myself. Unfortunately, my English and the translation of Google does me no great help.

Regards.

:bow-pray:
 

youmeus

Active Member
May 5, 2009
348
89
28
I am getting this error when attempting to open a trimmed m2ts file.

Avisynth script error:
mt_makediff : unsupported colorspace. masktools only support planar YUV colorspaces (YV12, YV16, YV24)
(QuickTGMC.avsi, line 581)
(QuickTGMC.avsi, line 399)
....

Is there an update possible for this?
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
0
What are you are trying to open the m2ts file with? MeguIV(it) is set up for "One-Click" usage and One-Click doesn't support m2ts files. So I guess you are using the QuickTGMC script manually or something?

Anyway, QuickTGMC only supports YV12 at the moment. There will be a revision to support YUY2 in the future. Edit your avs script and add "ConvertToYV12()", like so:
Code:
WhateverSource( YourFile )[B].ConvertToYV12()[/B]
 

youmeus

Active Member
May 5, 2009
348
89
28
What are you are trying to open the m2ts file with? MeguIV(it) is set up for "One-Click" usage and One-Click doesn't support m2ts files. So I guess you are using the QuickTGMC script manually or something?

Anyway, QuickTGMC only supports YV12 at the moment. There will be a revision to support YUY2 in the future. Edit your avs script and add "ConvertToYV12()", like so:
Code:
WhateverSource( YourFile )[B].ConvertToYV12()[/B]

That's pretty neat stuff :) thanks

Yes I was indeed trying to open it with MeguIVit. I just wanted to do a testdrive on a Blu-ray sample I had trimmed for the purpose.
I just installed MeguIVit on my MacBook Pro running Windows 7 64bit and have been boxing now for 8 hours with the C++ error messages of mencoder.exe, "unable to load avisynth.dll" and more... I tried switching between the various provided C++ redistributables but to no avail.

However I downloaded and tested the MeguIVit alternate version B and did a one-click encode with this Sandbox and it ran perfectly through without any trouble. On an 8 second clip mind you. However in this Sandbox all the tweaked profiles you made such as 60fps encodes are not showing. I also noted of course that the extracted zip file for MeguIVit v0.2.1 was considerably larger than the alternate versions 0.1.4 A&B.
I take it I will need to add these manually as described in your encoding tips for MeguIVit. All I need is basically the 60fps encodes, because I like you think it's like the difference between night and day.

I wouldn't mind being able to do 1080p rips at 60fps from my Blu-rays but I have not the space for the pre-rendering files so I might aswell just write that off. Was just a little testdrive :)

I'll play around with your MeguIVit tips and see if I can manually add a successfull 60fps encode :)


EDIT:

I am sorry, I got confused by swapping Sandboxes in and out - the tweaked MeguIVit profiles ARE ALL THERE! I just did a "C: 60fps Slower" and an "A: 60fps Placebo" and both ran through smoothly at at respectively 6.2fps and ~3.0fps on Intel Core 2 Duo 2.6Ghz.
 

youmeus

Active Member
May 5, 2009
348
89
28
Regarding the output mkv/mp4 in the one-click mode of MeguIVit, is there a permanent way to crank up the bitrate of the final mp4 that MeguIVit outputs?
I have a confession to make - I am on a Mac ;) and I am basically using MeguIVit for doing 60fps encodes, then running the output mp4 through a Mac based encoder of mine to achieve good playback and skimming in iTunes/Quicktime. So that's why I'm wondering if it's possible to adjust the output mp4's bitrate manually for an even sharper output to put into my encoder.

I have tried the placebo profile but I must admit that I am having trouble seeing much difference between that and the C: 60fps Slower profile, they both look breathtaking! And the Slower profile is alot faster!
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
0
Increasing the bitrate doesn't make things sharper. The bitrate is used to make an accurate capture of your input - at whatever sharpness your input originally is. If your input isn't sharp enough... well, you have to sharpen it...!

You can configure the avisynth profile in the one-click process (check the "Advanced options" checkbox, then it's in the "Advanced Config" tab). You will see the script that actually processes your video. Change the QuickTGMC line to something like this (don't touch any other lines):
Code:
QuickTGMC( Preset="Slow", Sharpness=1.3 )
Obviously tweak the sharpness setting as you wish. If you can't get enough sharpness that way try this:
Code:
QuickTGMC( Preset="Slow", Sharpness=1.2, SLMode=1 )
or this (very strong):
Code:
QuickTGMC( Preset="Slow", Sharpness=1.0, SLMode=0 )

When you're done, "Update" the preset or create a "New" one.

I'm glad you can't tell the difference between Slower and Placebo. Placebo settings are so-named because they barely do anything but they make you feel better [law of diminishing returns]. There is a difference between the settings, but only the most pedantic (or people with huge screens) can tell. I usually use the Slower setting.
 

no__One

Active Member
May 27, 2007
947
175
43
I'm glad you can't tell the difference between Slower and Placebo. Placebo settings are so-named because they barely do anything but they make you feel better [law of diminishing returns]. There is a difference between the settings, but only the most pedantic (or people with huge screens) can tell. I usually use the Slower setting.

I do not know why but I feel like a woodpecker. :puzzled:
Will I feel slightly under attack...
Certainly. :pandalaugh:

Ps: To my defense, I would say I am very prefectioniste ... a little too much maybe ... :sadomaso:

:rofl:
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
0
Sorry, the comment wasn't directed at you IceManZ. Placebo settings are most certainly the best, but the differences from the "Very Slow" settings are very, very minor. The placebo settings are really there to test everything at the maximum. And for perfectionists. ;)
 

no__One

Active Member
May 27, 2007
947
175
43
I was Joking Mr.Vitreous :joker:

Following your advices, A sling, the response is prepared. A new Placebo Attack is about to emerge... :narcissist:

Thank you again for your wonderful tool. I get results that satisfy me fully.
I hope my fellows will appreciate as much time and energy than I would have spent.
I am a bit hated by my friends for the time spent as a recluse in my den.
Unfortunately, intensive testing, detailed and many must be done to get the true essence so jealously kept in interlaced mode ...

I admit, I really must take a break. Take a little air, and come back recharged back to block!

:relax-bath:
 

youmeus

Active Member
May 5, 2009
348
89
28
Concerning MeguIVit, is it possible to use it to motion interpolate 30fps progressive material to 60fps? In your experience, is it worth it?:puzzled:
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
0
Concerning MeguIVit, is it possible to use it to motion interpolate 30fps progressive material to 60fps? In your experience, is it worth it?

Here's the script I use to do that. Easy to use, just put InterpolateFPSx2() in your script. It will create odd effects on fast or complex motion where the motion analysis fails. But it can be OK, especially on slow moving idol vids. I've used it in a few rips.

Edit: Save this text as InterpolateFPSx2.avsi and put it in your avisynth plugins folder (which is deep in the sandbox folder on MeguIV(it))
Code:
#------------------#
# InterpolateFPSx2 #
#------------------#
#
# Double framerate using a combination of MVTools and simple frame blending / blurring
# Uses MVTools SAD mask to determine where to blend/blur instead of interpolate
#
# Parameters:
# 	BlendThresh (>=0)  : Threshold above which blending/blurring is used. Decrease to blend more, increase to interpolate more. Default = 36
#	AltMethod   (0,1)  : Method to use instead of interpolation when motion predition is poor: 0 = blend neighbor frames, 1 = gauss-blur then interpolate

function InterpolateFPSx2( clip Input, int "BlendThresh", int "AltMethod" )
{
	BlendThresh = default( BlendThresh, 36 )
	AltMethod   = default( AltMethod, 1 )
	
	_blocksize = 16
	_search = 4
	_searchParam = 2

	w = Input.Width()
	h = Input.Height() 
	epsilon = 0.0001
	
	filter = Input.GaussResize( w,h, 0,0, w+epsilon,h+epsilon, p=2 )
	superFilter = filter.MSuper( pel=2 )
	bVec = MAnalyse( superFilter, isb=true, blksize=_blocksize, overlap=_blocksize/2, search=_search, searchparam=_searchParam )
	fVec = MAnalyse( superFilter, isb=false, blksize=_blocksize, overlap=_blocksize/2, search=_search, searchparam=_searchParam )

	super = Input.MSuper( pel=2 )
	interpolated = Input.MFlowFps( super, bVec, fVec, num=0 ).SelectOdd()
	
	backupPlan = (AltMethod == 0) ? mt_average( Input, Input.trim( 1,0 ) + Input.trim( Input.Framecount()-1,0 ), U=3,V=3 ) : \
	                                interpolated.GaussResize( w,h, 0,0, w+epsilon,h+epsilon, p=5 )

	badMask = MMask( Input, bVec, kind=1, ml=BlendThresh, gamma=2.5 )
	newFrames = mt_merge( interpolated, backupPlan, badMask, luma=true ) 

	return Interleave( Input, newFrames )
}
 

no__One

Active Member
May 27, 2007
947
175
43
Hello everyone,

During the renaissance of AO, I had a little too much time devoted to my work now Favorite: Laboratory tests ...
And I stumbled upon a discovery oh so strange. :surprised:
It is common knowledge, at least if I fully grasped the basics of encoding, an AVS script always leads to the same result.
Of course (the settings, the source file, no PC reboot between different phases of encoding ...)

Well, think again. I managed to get 5 different tests video files with the same AVS file ...:attention:
I attach the archive with the AVS script used and the 5 files obtained.

The tests were performed on the video: [IMOE-010] Kana Yuuki 1 Disc 1. http://www.akiba-online.com/forum/showpost.php?p=1032008&postcount=2299
A charitable soul could explain how and what to do to remedy the situation?:puzzled:

Apps used : meguIVit_0.2.1 + QuickTGMC3.0

Mr.Vitreous...?

http://hotfile.com/dl/106355434/9a7cebf/AO_in_Chaos.7z.html

PW:
Code:
For_AO_Forc3_(^_^)_Thanks_A_Lot_To_Vitreous_For_is_WonferFul_Rip!
 

youmeus

Active Member
May 5, 2009
348
89
28
Thanks Vit :) I'll have some fun playing around with that.
Btw MeguIVit and regular MeguIV are tweaked for 30fps content only isn't that right? You can't throw 25fps (50i) material at it without changing it right?
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
0
I've updated QuickTGMC to v3.11. It improves memory efficiency, fixes some bugs from 3.0 and adds motion blur. Changelog:
Code:
# v3.11: Exposed ThSAD1, ThSAD2, ThSCD1 and ThSCD2 to allow tweaks to temporal smoothing and scene change detection
#        Fixed bug introduced in v3.05, which skipped part of core algorithm(!)
# v3.10: Explicit conditions to ensure unused filters are not constructed to reduce memory use
#        FPSDivisor works even if not using motion blur
# v3.05: Motion blur support, added settings FPSDivisor, MotionBlur, ShutterAngleSrc, ShutterAngleOut, MBlurLimit
#        Bug fixes: Some Sbb modes with source match, MatchEdi setting (again)
# v3.01: Support for lossless modes on InputType=2,3 - improves detail retention
#        Enabling ShowNoise automatically switches on NoiseBypass
#        Bug fixes: "Draft" mode, noise extraction with InputType=1, MatchEdi setting

See if this solves your weird issue IceManZ.

The most interesting addition is the motion blur - most idol vids I work with use a fast shutter. If you output to 30fps it gives that nasty juddering look because there isn't enough blur in the source for that frame rate. The motion blur settings allow you to simulate a different shutter speed for your required output fps. It works with the concept of shutter angle not shutter speed though. Shutter angle ranges from 0 to 360 with 0 being a very fast shutter speed (think sports footage), 180 being film-like shutter speed, and 360 being a little over softened/blurred. Example:
Code:
QuickTGMC(Preset="Slow", MotionBlur=1, ShutterAngleSrc=45,ShutterAngleOut=180, FPSDivisor=2)
You estimate the shutter angle of the source (here estimating 45, fairly high speed). You can do that by looking how much motion blur is in the source on a still of a movement, less blur means lower angle. Then specify the output shutter angle. 180 is usually what you want. FPSDivisor=2 means half the rate - i.e. 30fps output (don't use SelectEven() if you set this). You can add more blur to 60fps output but it's not usually visible unless you start with some very high shutter speed input.

30fps vids made with the line above look rather nicer. But the encoding is slower and it's motion interpolation so it can introduce artefacts where there is fast or complex motion.
______

youmeus: You only need to tweak the x264 "Quality" setting for 50/25fps. Suggest you take it down a few stops from the 30/60fps equivalents. Down means more quality - lower framerate means each frame needs higher quality.
 

youmeus

Active Member
May 5, 2009
348
89
28
youmeus: You only need to tweak the x264 "Quality" setting for 50/25fps. Suggest you take it down a few stops from the 30/60fps equivalents. Down means more quality - lower framerate means each frame needs higher quality.

Oh I see. So MeguIVit will do a 50fps encode from 50i material if I select one of the 60fps profiles? I'm not sure I understand how come I need more quality each frame than with 30fps. What does the slider do? Does it increase the bitrate? If so I can understand why image quality would drop if left unchanged.
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
0
Yup, select a 60fps profile for 50fps output and a 30fps profile for 25fps output. Knock the CRF down by about 0.3 or 0.4 for an equivalent quality.

The slider is a kinda measure of "quality" or rather how accurately the input is encoded. It is related to bitrate, but not in such a direct way. But the point is more fundamental than bitrate, it's a psycho-visual effect. The more frames per second your eyes receive, the better able your brain is to resolve the original signal. You're getting more temporal resolution. So if you get less frames per second, they will need to be higher quality images to allow your brain to resolve a signal of equal quality. So you need slightly more quality for 25fps output than 30fps output to get the same perceived quality (similarly more quality needed for 50fps than 60fps). I have seen a formula for this somewhere out there (lost it now...)

But don't worry about it - it's not really important to match your setting to the MeguIVit defaults - just put the setting where you like. I personally use higher quality settings than the MeguIV(it) now. Others use lower.
 

youmeus

Active Member
May 5, 2009
348
89
28
Cool :)

But taking the CRF all the way down would increase the quality even futher? But then perhaps take absurdly longer to encode?

In relation to h264 encoding, what determines the skimming and fast forward/rewind of the video?
As I mentioned earlier I reencode the MeguIVit 60fps encodes to a more iTunes friendly format using an App called Pavtube iMedia Converter for Mac. While it produces quality that is laughable compared to Megui and Avisynth it produces h264 content that skims, fast forward/rewinds phenomenally in QuickTime/iTunes. The App uses the lavf52.2.0 writing application and libx264 which I believe is associated with FFMPEG.
When playing back MeguIV 30 or 60fps content in iTunes and using the fast forward/rewind it takes iTunes a long time to think before snapping to the new position which makes it basically impossible to jump in the movie. However when I play back h264 content generated using the Pavtube App the movie snaps instantly to the new position when using fast forward/rewind.
Is it because Megui generates far higher quality and thus gives iTunes a heavier time to decode the content? Or is it because the content encoded by Pavtube App is particularly compatible for playback with iTunes? I know that iTunes suck badly at playing back most content, but is it only related to that fact or does it also depend on how you encode the video?

It's been puzzling me for years now, since I started using Akiba-Online not least.

Perhaps you can shed some light on this bro?
:puzzled:
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
0
...fast forward/rewind...Perhaps you can shed some light on this bro?
May not be to do with quality - this is probably the "Maximum GOP Size". Again go to the x264 settings, make sure "Advanced Settings" is checked. Then go the "Frame-Type" tab. Maximum GOP Size is probably 250 or something. Reduce this value, maybe to 100, maybe less (I'm not really sure for your device, just experiment). That will probably help with the seeking at the expense of a slightly larger file.