Smooth Deinterlacing

akiballion

Member
Mar 18, 2018
22
40
Since this site has a lot of uploaders and encoders, I thought it couldn't hurt to ask here.

So, I use Handbrake for encoding. Settings are somewhat limited, there's only 3 options for deinterlacing. I've generally used Yadif for its speed, and it sometimes does the job okay, but it leaves a lot of artifacts like dotted lines, and also seems to destroy details.

The other presets (EEDI2 & EEDI2 Bob) are much slower. They do produce somewhat better results, but still have undesirable artifacts (especially visible in shots with a lot of movement), and don't properly deinterlace some frames.

I'm on OSX, so I'm limited in regards to software. I've heard QTGMC is the best deinterlacer, but unfortunately have no idea how to use it. Akiba's own encoder is also Windows-only.

Most of what I want to encode is true interlaced, 30i shot-on-digital video. Ideally, I'd want to convert them to x264, MKV or MP4 files with proper 60fps, but I would also be fine with regular 30fps video, as long as the quality is good.

Hope someone could help me out on this matter.
 

SamKook

Grand Wizard
Staff member
Super Moderator
Uploader
May 10, 2009
3,536
4,897
Being on mac limits your options quite a bit. As far as I know, your only 2 possible options would be to either use wine(or similar software) to run a windows app which I don't know if it would actually work or look into vapoursynth and how that works since it has qtgmc support and is cross platform but it's as complicated as avisynth meaning no easy interface and I don't know if all the plugins are converted yet so you may be missing a few options with it.
 
  • Like
Reactions: akiballion

akiballion

Member
Mar 18, 2018
22
40
Thanks for the suggestions. For Wine, stability is an issue. Not all programs are supported, and some of them will randomly crash at times, so it's undesirable for multi-hour encodes.

Vapoursynth was actually previously recommended to me. My problem is that, like Avisynth, it is script-based and I'd much rather work with a GUI. Using QTGMC in Vapoursynth also requires a whole list of external plugins and components. I can hardly find any (decent) tutorials for it, so it seems very difficult to get into.

By the way, it doesn't necessarily need to be QTGMC, just a high-quality deinterlacer in general. I work exclusively with ISOs, so I'm really trying to get the best quality out of them.

Here's some test encodes I did with one of Handbrake's more advanced deinterlacing algorithms:
http://www.mediafire.com/file/5i8bpv5aujy389p/Sample.zip/file
 

SamKook

Grand Wizard
Staff member
Super Moderator
Uploader
May 10, 2009
3,536
4,897
With encoding, you'll never have a perfect picture, it's pretty much all about minimizing the undesirable effects so don't expect a perfect deinterlacer. QTGMC is basically just an avisynth script(quicker version of TGMC) that does just that, it uses other deinterlacer like yadif(on the lowest setting) ,NNEDI2, NNEDI, EEDI3, EEDI2, TDeint and bob and applies extra processing to try and limit the damage as much as possible.

If you're looking for the highest quality, you'll pretty much have to learn the script based stuff since the GUI always have limited options and even more so on MAC. I don't own a MAC so I'm not very familiar with what's available on it, everyone I know who uses one is using handbrake and since most people don't use interlaced stuff anymore except for the japanese adult industry, there's not new stuff developed for that and not many reasons to include top class ones in applications.

With that said, the script stuff isn't that hard, you just add lines to a text file to tell it what to do. Most script only contain a handful of lines since you just need 1 or 2 for loading the video and audio and one for every filter you're using(if you only deinterlace, that's only 1 line) so a script can be as simple as just 2 line and it's ready to be used.

I never actually used vapoursynth since it was still in early development last I was very active in encoding but the doom9 forum is by far the best ressource to learn about encoding and is where the most developers release the plugins and filters so you'll find info there for sure.
This seem like the thread to read to at least learn how to install it https://forum.doom9.org/showthread.php?t=173453
 
  • Like
Reactions: akiballion

akiballion

Member
Mar 18, 2018
22
40
Thanks for the link. Until I find the time to look more closely into Vapoursynth, I've found kind of a workaround for it, which is using a VM with Windows and then running MeguIVit on it (this was also recommended in the thread). I'll leave it running over night and then check the results.

Anyway, this is not related to deinterlacing, but it looks like the example I posted that was done in Handbrake is actually VFR. In the 60fps video, the shot at 0:18 seems less smooth than the rest of the video. Might just be my own perception, but since it's an FX shot, it might be possible that it was done at a slower frame rate.

Encoding it at 60fps vs. VFR gives different file sizes, the VFR file is slightly bigger. I've read encoding it that way can lead to playback/sync issues, so how should it best be handled?

1.) Convert it down to have the whole video running at constant 30fps
2.) Set it to constant 60fps
3.) Just encode it as VFR

Thanks for the help so far, it's very appreciated.
 

SamKook

Grand Wizard
Staff member
Super Moderator
Uploader
May 10, 2009
3,536
4,897
Yeah, meguIVit is a Megui mod that was made specifically to make encoding IV and JAV for people who know next to nothing of encoding so it's an easy solution with great quality.

Yep, that gun shot doesn't have the full 60fps motion, every 2nd frame is just a blurrier version of the first. They destroyed the motion when they added the special effect.
If you want to check if the 60 fps has been properly done and not just duplicated the same frame twice, you can playback the video frame by frame and check if there's motion in every frame. With MPCHC, I just hold ctrl and press the arrow keys. I'm sure a mac player has a similar function.

VRF indeed can result in playback issues since it makes it harder to properly sync the playback with the monitor refresh rate and you won't benefit from using it with JAV as you may have noticed with the increased size. The only time you would maybe want to use it is with a video that has a lot of frames that repeat themselves and even then, I'm not even sure if you'd gain much with modern compression.

I'd set it to constant 60fps, as long as the video actually has the motion in every interlaced frames. Some video you'll set to 60 fps and you realize it just doubles the frames but that doesn't happen too often. The so called professionals that encode some of these video to DVD sometimes do really dumb things(like not properly editing interlaced video when they add special effects) so some part or the whole thing can be weird sometimes.
 
  • Like
Reactions: akiballion

akiballion

Member
Mar 18, 2018
22
40
Alright, so I just looked over the MeguIVit encode. The standard profile was set to "slow", which already produced pretty satisfying results, but I'll try and figure out what I can get using an even slower preset.

The deinterlacing itself looks absolutely beautiful, and is probably the best it can get at this point. This was my main issue. I consider that solved now, and I'm very glad this tool exists. It really made the whole process a lot easier.

I have very few remaining questions regarding the software;

1.) Does it support 10-bit?
2.) When using a 4:3 source, should 720x480 be resized to non-anamorphic 640x480?
3.) How can I leave out certain chapters? For example, I'd like to cut out ~15min of ads at the end of the movie to save space.

Again, much thanks for your help.
 

SamKook

Grand Wizard
Staff member
Super Moderator
Uploader
May 10, 2009
3,536
4,897
It can support 10 bit since all you need to do is use a 10bit version of x264 but for it to work you'd have to replace the existing exe inside the meguivit sandbox. I mentioned a couple of ways on how to do this near the end of the meguivit thread on the forum so you can check there to figure out how to do it.

You should always resize 720x480 since all DVD are encoded to that resolution and no content actually displays that way. Ideally you want to resize the video directly and not just set the aspect ratio in the container so the video player resize it but both option work.

There's a trim option in meguivit that lets you select what part you want to use or you can just get rid of the VTS DVD file that contains the ads before loading the video since they are often separate. vitreous explained how to do this in more details somewhere in the thread, probably around the middle but it's not too hard to figure out how it works if you play with it a little.
 
  • Like
Reactions: akiballion