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

youmeus

Active Member
May 5, 2009
346
89
Your suggestion of putting the SubTitle right before Distibutor() worked perfectly! Now I just need to figure out how to downscale the .SUP to 720p.

There was something that puzzled me though. I used the progressive post-precessing preset and also resized the image from 1080p to 720p. But the output that came out was only about 900 kbit/s bitrate for 720p and when I chose not to resize the 1080p came out with roughly 2200 kbit/s bitrate. It was only a small segment of the original Blu-ray movie, about 4mins, no audio. I used your 720p 25fps Quality+1 preset both times in the One-Click encoder in MeguiVit. I am puzzled because when I encode 1080i Blu-ray content with QTGMC in the One-Click encoder in MeguiVit, for instance IV content, I get bitrates hovering around 10-11 mbit/s on the output 1080p file. The 720p and 1080p that I got out this time was of good quality, but not quite what I expected after being used to encode 1080i IV content. I was hoping for around 5 mbit/s for 720p and maybe 10 mbit/s for 1080p. Is this because of the progressive post-processing preset? Or perhaps because I only encoded a small chunk of the actual movie? Or is encoding progressive content different from 1080i in relation to bitrate?

That being said I did also try adjusting the crf for the 720p 25fps Quality+1 preset from 18 to 10 instead. This considerably improved quality and raised the bitrate to about 5000 kbit/s for the 720p output.
But I am wondering is tampering with the crf the wrong way to go about this?
I was aiming for good 720p output at roughly 5 mbit/s nitrate as my playback system isn't too fond of 1080p content...
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
If you want a fixed bitrate then switch from CRF mode to Automated 2-pass in the x264 settings. Or you could set a particular filesize on the "General" tab of the One-Click process. Either way you will get one extra processing pass.

Progressive - Post Processing does nothing special in it's encoding compared to normal deinterlacing. Likely it was the nature of your source. CRF mode will not output consistent bitrate between sources, it's not supposed to do that. Instead the bitrate will depend on the complexity of your source. Simplifying the idea, CRF mode tries to get to within a certain precision of the source, if it can do that with fewer bits then it will. A plain color wall can be compressed with precision with very few bits, a waving camera running through a windy forest in the rain will need a huge amount more bits to encode to the same precision. For that reason it's not really very sensible to aim for the same bitrate for every source, some sources need more, some less, and that's why CRF mode exists.

According to the x264 docs CRF=16 should be almost perfect, but recently the CRF values seem to have changed and lower values seem to be needed to match previous settings. CRF=10 is supposed to be overkill insane quality, especially for a higher resolution (lower resolutions need lower CRFs). Practically I need to spend more time with the 720p settings - as I have encoded little at this resolution. I should add Quality+2,3 settings too. You could make your own preset with a lower CRF - that would be perfectly sensible. Though you should try a couple of other CRFs on that source, you may reach sufficient quality at less bitrate. When comparing different CRFs don't change any other setting, and make sure you are seeing qualitative differences, it is easy to be fooled by the placebo effect and assume any change you see in the lower CRF is an improvement, even if it is just a change in pixels with no real quality impact.
 

youmeus

Active Member
May 5, 2009
346
89
If you want a fixed bitrate then switch from CRF mode to Automated 2-pass in the x264 settings. Or you could set a particular filesize on the "General" tab of the One-Click process. Either way you will get one extra processing pass.

Progressive - Post Processing does nothing special in it's encoding compared to normal deinterlacing. Likely it was the nature of your source. CRF mode will not output consistent bitrate between sources, it's not supposed to do that. Instead the bitrate will depend on the complexity of your source. Simplifying the idea, CRF mode tries to get to within a certain precision of the source, if it can do that with fewer bits then it will. A plain color wall can be compressed with precision with very few bits, a waving camera running through a windy forest in the rain will need a huge amount more bits to encode to the same precision. For that reason it's not really very sensible to aim for the same bitrate for every source, some sources need more, some less, and that's why CRF mode exists.

According to the x264 docs CRF=16 should be almost perfect, but recently the CRF values seem to have changed and lower values seem to be needed to match previous settings. CRF=10 is supposed to be overkill insane quality, especially for a higher resolution (lower resolutions need higher CRFs). Practically I need to spend more time with the 720p settings - as I have encoded little at this resolution. I should add Quality+2,3 settings too. You could make your own preset with a lower CRF - that would be perfectly sensible. Though you should try a couple of other CRFs on that source, you may reach sufficient quality at less bitrate. When comparing different CRFs don't change any other setting, and make sure you are seeing qualitative differences, it is easy to be fooled by the placebo effect and assume any change you see in the lower CRF is an improvement, even if it is just a change in pixels with no real quality impact.


Thanks for clarifying this for me. It makes a lot more sense now.
I'll try experimenting with various crf values to see which fit best.
Thanks
 

no__One

Active Member
May 27, 2007
947
175
Hello M.Vitreous,

Do you have any ETA for a meguIVit 1.0.0 beta-3 (x64) ?

Regards.
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
Do you have any ETA for a meguIVit 1.0.0 beta-3 (x64) ?
About 10 minutes after the sun goes supernova.

x64 version would be unstable since there is no stable x64 avisynth. It is possible to get it to work, but rather a matter of luck. Wouldn't want all the support queries.
But I have something equivalent that I have been using recently: running multiple processes, each running multiple threads. Each process is 32-bit, but the multiple processes allows you to use all your RAM (which matches the main advantage of 64-bit given there isn't much x64 optimized code in the MeguIVit pipeline). I've been using the system for all my recent blu-ray rips, gets 1080p 60fps processing down to a matter of hours.

The ETA would still be 10 minutes after Armageddon though - very, very busy. (well, Christmas at least)...
 

no__One

Active Member
May 27, 2007
947
175
After Armageddon... U_U' well why not :sadomaso:

If it's Christmas for your something equivalent, It will be a very nice present. I have so many trouble with my HD content...

As M.Youmeus, I can't get meguIVit running with pre-rendering, no matter what...

And without it, it's nearly impossible to encode HD.

Then, I don't disturb you and I will wait patiently
 

SamKook

Grand Wizard
Staff member
Super Moderator
Uploader
May 10, 2009
3,778
5,351
I was wondering, is there a way to know which parameters are passed to QTGMC when we choose a certain preset(for example Quality+3)? The .avs only has a bunch of variables and I can't know their values as far as I know.

I'd prefer using it outside of MeguIV and I haven't started messing with QTMGC settings yet so I was hoping to have somewhere to start.
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
Settings like Quality+3 are for the x264 encoding only. You can see the x264 settings chosen by pressing the "Config" button next to the "Video Profile" on the One-Click "Encoder Config" tab.

QTGMC quality/speed settings are mainly controlled by "Preset" on the One-Click "Custom Processing" tab. This is the same as the "Preset" setting you would use in an AVS script:
QTGMC( Preset="Slow" )

Other QTGMC settings should be set depending on your source material (e.g. only denoise if you have a noisy source). Documentation for QTGMC settings is in the standalone download.
Source match is a good precision increase for quality sources. And EZKeepGrain is also a possibility where the source is good. My favorite settings are variants on this:
QTGMC( Preset="Slower", SourceMatch=2, Lossless=2, EZKeepGrain=0.6, Sharpness=0.3 )
However, this is very slow and really only for the pedantic...
 

SamKook

Grand Wizard
Staff member
Super Moderator
Uploader
May 10, 2009
3,778
5,351
Thanks, so as long as I set the preset, I'll get the same result if I understood correctly(I already got the x264 settings, I just wasn't sure if this preset affected QTGMC somehow).

I haven't had time to read the documentation(only went quickly through it), but it's on my todo list. And now that I think about it, I'll have plenty of time next wednesday if I print it.

Thanks for the tips, slowness has never been a factor when I encode so I'll look into those and experiment.
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
Yes you should get the same result. Just note that One-click auto-crops any black borders it finds and does very minor resizing that may be necessary as a result.
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
@IcemanZ: Looking at your recent rips, a couple of suggestions if you're going for absolute best quality (post belongs here with us tech-heads)

- Contrast is poor in many DVDISOs. Brightness range for DVD is supposed to be 16-235, but it is often more like 24-255: not enough darks, and saturated whites. Before making a rip, replace your QuickTGMC() with DoubleWeave(), remove any MT lines and add Histogram(mode="Levels") at the end of your script. Will now show the brightness in a graph at the top-right. Don't want to see the graph values enter the brown areas (too bright or too dark), but do want to see it fill the valid range over the whole vid. Go to the darkest scene and the brightest scene and see the used range.
Then correct for any errors, I use the SmoothAdjust plugin (get it at d9). E.g. for your Sara Onodera vid I would go for:
SmoothCurve(Ycurve="0-0;22-16;128-124;235-222;255-235")
That maps 255 to 235 (as the white level is way out of range as with many vids), and 22 to 16 darkens the darks somewhat. The other two settings are personal preference, the 124 value operates like gamma, the 222 value tweaks the bright values. You can add more values - read the docs. Experiment. It's personal preference, but this is one area where the source can definitely be improved on in many cases.
You can also "warm" the colors of a cold looking video with UCurve and VCurve, but be subtle:
SmoothCurve(Ycurve="0-0;24-16;128-124;235-222;255-235",UCurve="0-0;128-127;255-255",VCurve="0-0;128-129;255-255")
Absolutely make sure your monitor is well calibrated and your video player is treating input-output ranges properly before doing any of this though.

- If you use "Placebo" setting, then I suggest you set TR2=1 or 2. The default TR2=3 for placebo smooths too much in my opinion.
 

no__One

Active Member
May 27, 2007
947
175
Thanks a lot Mr.Vitreous for these infos.
This is definitely a way, difficult course, I should take.
I have to generate some free time for testing. And more tests to understand the intricacies of these new parameters.
Again, thank you for your advices that have always led to progress and get a quality unknown to me and totally out of reach.
Regards.
 

anandneemish

Member
Apr 25, 2008
97
29
Dear Vitreous,
Is there a way to un-check "Add pre-rendering job" by default? I would like to NOT pre-render by default.

I played around with exporting presets and modifying the XML. But since I did not know what I am doing, I decided to quick messing around and ask.

Thanks.
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
Is there a way to un-check "Add pre-rendering job" by default?
No, I'm afraid not. At least not until I finish the version I'm halfway through that supports One-Click presets. But I have no time for development until December at least.
 

youmeus

Active Member
May 5, 2009
346
89
With the File Indexer in the latest version of MeguiVit how do you handle 25fps content that consistently has 2 progressive followed by 3 interlaced? With NTSC content that plays 3 progressive followed by 2 interlaced I know that I could just do a TIVTC. But File Indexer just reports my PAL content as interlaced, top, and then suggests Yadif. It seems that whatever I do it comes out jerky.
 

SamKook

Grand Wizard
Staff member
Super Moderator
Uploader
May 10, 2009
3,778
5,351
I've encountered a source that is giving me trouble. I think the fact that it has a halo around everything in some scenes is messing up with QTGMC process and I was wondering if you(or anyone here) would have any tips for a way to fix it.

Here's my original script(used the same as my last encode hoping it would fit, but it's probably too sharp):
Code:
SetMTMode(3, 7)
Vid = DGDecode_mpeg2source("D:\_AkiDVD\LPDD-1037\LPDD-1037.d2v")
Aud = NicAC3Source("D:\_AkiDVD\LPDD-1037\LPDD-1037 T80 2_0ch 448Kbps DELAY 0ms.ac3")
AudioDub(Vid, Aud)
SetMTMode(2)

QTGMC( Preset="Placebo", EdiThreads=4, TR2=2, SourceMatch=2, Lossless=2, EZKeepGrain=0.6, Sharpness=0.3 )

crop( 2, 4, -2, 0)
Lanczos4Resize(720,480)

SmoothCurve(Ycurve="0-2;255-235")

#Test
Trim(178295,178945)
#Trim(89147,89472)

I also tried it with only placebo set and through MeguIVit(default settings at placebo) to see what it looked like and it's a little bit better if I stay less faithful to the source, but it still not that good.

Here's the source(I cut it with dgindex) [7.15MB]: http://www.megaupload.com/?d=48JW3PRP
and the tests I mentioned [4.13MB]: http://www.megaupload.com/?d=QO31HWCI

And here's 2 ss to give you an idea of what the problem is(turns out it's harder to see than in the video since the ss doesn't have the right DAR). Look mainly on the shoulders and the red circle on the sign.
Original script test:
View attachment 527007

MeguIVit test:
View attachment 527008
 

Vitreous

°
Former Staff
Sep 13, 2009
2,033
591
I've encountered a source that is giving me trouble.
Problem is in the source. Just using NNEDI3(field=-2) shows up the same issue.
This kind of effect is caused when the video is resized while it is still interlaced or something equally bad.
This source video looks like it is 360p rather than 480p (that's just a guess from some quick experimenting, could be another size close by).
So try adding this between your source filter and QTGMC. Suggest you don't use source match as that will tend to (accurately) reproduce the source problems.
Code:
SeparateFields()
Spline36Resize(720,180)
Weave()
This won't be perfect, damage is already done. Result will be 720x360...
 

SamKook

Grand Wizard
Staff member
Super Moderator
Uploader
May 10, 2009
3,778
5,351
Thanks, I finally had time to try it and it does look better.

I guess they used a different resolution for the indoor scenes where she presents herself and they screwed up the footage to make it fit with the outdoor ones.

It seems I'll have a lot of trimming to do and I hope it won't look too bad if I resize it to 480p to make it fit with the other footage(since the outdoor scenes are the most important ones and letterboxing part of it would look weird).