1. Akiba-Online is sponsored by FileJoker.

    FileJoker is a required filehost for all new posts and content replies in the Direct Downloads subforums.

    Failure to include FileJoker links for Direct Download posts will result in deletion of your posts or worse.

    For more information see
    this thread.

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

Discussion in 'Tech Support' started by Rollyco, Jun 30, 2009.

  1. SamKook

    SamKook Akiba Citizen Uploader

    Windows tend to be tricky when modifying files through an open dialog window. Out of curiosity, which version of windows are you using? I'm on win7 x64 SP1.

    Those simple changes should indeed not cause any quality loss.

    For Fraunhofer AAC, I found a blog post with the process that seem well enough explained to compile it for windows so I'll try to compile it this weekend so I can give it a try. The link: http://taer-naguur.blogspot.ca/2013...with-fdk-aac-lib-on-64bit-windows-how-to.html

    For the processing done by MeguIVit, there's nothing more that would benefit from an upgrade I believe unless QTGMC itself had a newer version.

    To compare videos, I use a small software a guy made on doom9 where you load 2 video and you can click on the picture to switch between one and the other. I don't use it that often though since it's too old to support 10bit videos and those are what I encode the most in.
    If you want it, here's the thread: http://forum.doom9.org/showthread.php?t=138430

    There's also the SSIM metric for video quality, but it's not super reliable since it's data calculated by a machine and doesn't match our perception of picture quality perfectly. The thread about it on doom9: http://forum.doom9.org/showthread.php?p=370060#post370060

    Most of the time, I just make multiple samples with different settings, play them back one after the other and trust my eyes to tell me which is generally better or if I can't notice a difference. It's always best to compare video while it's playing since a single frame could look better when stopped and it could look horrible during playback if there's some moving artifacts or things like that.

    Edit:
    For your problem with fhgaacenc not taking AC3 as input, you can use a software to convert it to wav(or some other uncompressed format it can use) and pipe it to it.
    For nero, I use avs2pipemod(since I use an avisynth script as the input) in command line and pipe it like this:
    Code:
    "avs2pipemod.exe" -wav "input.avs" | "neroaacenc.exe" -ignorelength -q 0.42 -if - -of "output.m4a"
    The | means the result from the command on its left will be used for the command on its right. A - is used for the input on the command on the right(after the -if in this case).
    Last edited: Nov 21, 2014
    shank likes this.
  2. shank

    shank Member

    I have a separate pc that I use as an htpc and an encoding box. It runs Win7 SP1 (64bit). I assume since the clean setup worked, there may have been other changes I made within MeguIVit in the past that created a conflict.

    Yeah, that VideoCheck tool would be helpful. Or it would be nice to be a feature built into a good existing player like MPC-HD. I ended up coming to the same conclusion that manually comparing is currently the best way.

    I've done a bit more research on the state of audio codecs and understand the current situation and why there's confusion when asking which is better. When people ask "what's the better codec?" and you commonly hear the response "Apple or Fraunhofer", that is based on the ongoing development with low bitrates, such as 96 kb/s or lower. At those low bitrates, no codec can reach transparency or lack artifacts, so in that realm there are substantial differences between codecs. However, we don't want or use that low quality/bitrate in our movie encodes here.

    Here we are using no less than 128 kb/s, because when using 128 kb/s and a good encoder, several decent codecs have reached transparency with lack of perceivable artifacts. On a HydrogenAudio wiki, I found soundexpert.org referenced, and it looks to be a great resource. On this page, they show results of testing with the exact codec version and settings used. To simplify what that page is showing, anything with a bold 5 or above on the left of the graph lacks perceivable artifacts. And you can see Nero VBR at 128 kb/s hits 5.91, which is what MeguIVit is already using. You can click through each bitrate on the left of the page and see what I described above. At 128 and above, there are several codecs that hit 5+, but lower than 128 and there really aren't any.

    To compare filesizes, I converted that ac3 to wav, so I could run it through the current Fraunhofer (VBR, q4, ~128 kb/s) and compare it to MeguIVit's default Nero setup (VBR, q 4.2, ~130 kb/s). Both mashed the 37mb wav into a 3.3 mb m4a, with the Fraunhofer one being about 40 kb smaller, which I don't consider a difference worth anything substantial, especially since this is VBR and the Nero setting isn't an exact 128. And remember this is comparing the Nero codec from over 4 years ago to the current Fraunhofer. The improvements in codecs over recent years have been coming in at bitrates less than 128.

    So in conclusion, Vit knew what was up when he made the default audio Nero VBR ~128kb/s. The Nero encoder is easy to implement and creates the smallest possible filesize while maintaining a quality with no perceivable artifacts with its VBR 128 kb/s setting. For MeguIVit's audio, I will continue using the default Nero setup.

    I think my optimizations are pretty much done. All that's left to do is see if I can tell quality differences between the video presets themselves, because so far I'm having a hard time seeing a difference in my test encode between default and Q +3 with the new x264 and veryslow, which is making me want to just go back to default quality and have the smaller filesize (I don't think a 90 minute, 480p, 60fps encode should be around 1.5-3GB with current tech. I think they should be around 1GB give or take .2). Maybe I don't know what visual artifacts to look for yet when comparing. Thank you for all your assistance with this, SamKook.
  3. SamKook

    SamKook Akiba Citizen Uploader

    It's a good thing nero does the job well at 128kb/s because I compiled my own ffmpeg with libfdk enabled(did it sooner than I expected since it was pretty simple using the guide, only a couple of modification required) and took a look at if it was possible to create a preset for it inside Megui and I don't think it is(at least for the version used by MeguIVit) since you can only create/modify preset for existing encoders and ffmpeg aac isn't there. I would have thought you could enter your own command line as a preset, but it doesn't look like it.

    Glad I could help making a future with a greater number of smaller and better rip available.

    Edit:
    Also, it seems that ffmpeg doesn't support the vbr option very well for now. All my encodes are reported as CBR by mediainfo and I get the following:
    [libfdk_aac @ 00000000003986c0] Note, the VBR setting is unsupported and only works with some parameter combinations
    Last edited: Nov 22, 2014
    shank likes this.
  4. shank

    shank Member

    I tried that VideoCheck program. I can't believe it can't play vob files. That is the most important comparison to make; Your encode against the source material. That is far more important then comparing two encodes. It's also frustrating that you can't choose a section of video to evaluate (no seekbar). When comparing, you want to compare specific scenes that cause artifacts, but the only thing you can do with that utility is right click and it seems to go to some random part of the movie. Sometimes it even goes back to some key frame instead and doesn't advance at all. Sometimes I couldn't even get it to go back to a section it played before, even after reopening the files. Great start to this utility, but can't believe the author didn't realize these things, hasn't been realized after all these years, and that there still isn't anything out there that does. This is one of those situations that is so frustrating that almost makes me want to get deeper than my basic programming knowledge. This utility must be simple to create if you already know how to program, would be incredibly useful, and fill a gap that no other utility does (no competition. Instant fame). Or better yet, a player like MPC-HC has the foundation to play nearly any file well and would simply need to add a feature to play two files at once, but display only one, with a hotkey or button to switch between the two. But enough ranting. :D

    For anyone following along our back and forth on my simple optimizations to MeguIVit, the summary is:
    1. Update x264:
    Download the latest binary here: http://download.videolan.org/pub/videolan/x264/binaries/win32/ , rename it "x264.exe", and replace the one in MeguIVit in "\Sandbox\meguIV\1.0.1.1\Virtual\MODIFIED\@SYSDRIVE@\meguIV\MeGUI\tools\x264".

    2. Change video preset to Very Slow.
    Under Encoder Config tab, Video Settings, click the Config button next to the preset and slide the Preset to Very Slow.
    The only drawback to this is the encode takes more time. However, this makes no difference to me, because you encode once and the result is watch many times after, (even moreso if the file is shared). Also, this encodes in the background at low priority and doesn't affect the system much, and if you do this on another pc, well there's obviously no affect at all. Just expect to let it do its thing for several hours.

    There is no reason to change the audio setup. The default setup "Nero AAC: [Vit] LC VBR Q0.42 (~130kbps)" is perfect and the codec is already the latest version. These two little changes resulted in (at least) the same quality with ~30% smaller filesize.
  5. shank

    shank Member

    I'm noticing the chapter file information is not properly imported sometimes.

    The issue doesn't happen all the time (rough estimate, it seems to work properly 75% of my rips) and I have not noticed what triggers it yet. It has just gotten to a point where it's starting to annoy me when it happens.
    In this case, the "VTS_01 - Chapter Information - OGG.txt" file exists, opens properly in Notepad, and is readable:
    CHAPTER01=00:00:00.000
    CHAPTER01NAME=Chapter 1
    CHAPTER02=00:01:08.000
    CHAPTER02NAME=Chapter 2
    CHAPTER03=00:09:52.500
    CHAPTER03NAME=Chapter 3
    CHAPTER04=00:20:48.000
    CHAPTER04NAME=Chapter 4
    CHAPTER05=00:31:44.500
    CHAPTER05NAME=Chapter 5
    CHAPTER06=00:40:25.000
    CHAPTER06NAME=Chapter 6
    CHAPTER07=00:51:45.500
    CHAPTER07NAME=Chapter 7
    CHAPTER08=01:05:04.000
    CHAPTER08NAME=Chapter 8
    CHAPTER09=01:18:36.000
    CHAPTER09NAME=Chapter 9
    CHAPTER10=01:32:05.500
    CHAPTER10NAME=Chapter 10
    CHAPTER11=01:43:58.233
    CHAPTER11NAME=Chapter 11
    CHAPTER12=01:44:05.233
    CHAPTER12NAME=Chapter 12
    However, this is the chapter data in the mp4 output by MeguIV when it was done:
    00:00:00.000 : Chapter 01
    00:00:06.641 : Chapter 02
    If I download mp4box from their website, then use it manually to add the same chapter file to the same mp4 MeguIV created, the chapter information is added properly.
    If I manually use the mp4box version that comes with MeguIV to add the same chapter file to the same mp4 MeguIV created, the chapter information is also added properly.
    Not sure what's going on here. It doesn't seem to be the version of mp4box. Must be some way MeguIV is using mp4box.

    Has anyone noticed the chapter file info isn't added correctly for some rips?
    Last edited: Jan 24, 2015
  6. Performant

    Performant Member

    If anyone's been pulling out his hair like I have for the past few hours due to MeguiVit refusing to run on Win 7 and spewing the Xenocode error that says "The application was unable to load a required virtual machine component", uninstalling KB3045999 will fix the issue.

    Go through Control Panel - Programs and Features - View installed updates, and zap the little bugger.
    dwnldingDaikaiju likes this.
  7. isityours

    isityours People don't dance no mo'

    a bit of a late reply but i had the same problem when ripping to mp4 (not mkv) but i think that was only with MeguIV. it was resolved (for me anyway) in MeguIVit.
  8. shank

    shank Member

    If you are referring to the chapter information issue, I also rip to mp4, since I don't do any advanced subtitle stuff.

    But I have more accurate info now that I have been paying attention to it. I've done a few encodes sessions recently where I've encoded two movies and MeguIVit imported the chapter information of the first encode job into the second one also, instead of using the second encode job's own chapter file info. I think what is happening is that when you queue up several encodes, MeguIVit is using the first chapter information file from the first encode for all encodes queued up after it. I'll have to test queuing up several small jobs (at least more than two) to see how accurate that assessment is.

    And about that VideoCheck program I vented about in Nov: I discovered that you can go to specific parts of the movie. When you right click, it behaves as if there is an invisible horizontal seek bar across the whole video display and goes to that point. You can't see a time stamp to know exactly where you are beginning playback, but at least you can look for a certain trouble scene to compare artifacts.
  9. youmeus

    youmeus Active Member

  10. SamKook

    SamKook Akiba Citizen Uploader

    I don't think I've ever seen artifacts like those. My best guess would be that the encoder didn't have enough bitrate left to properly encode the picture and it produced weird artifacts as a result.

    The artifacts are really soft, like the picture, so I don't think a noise remover would work well for this, but you could always try a few and see what it does.
    youmeus likes this.
  11. dwnldingDaikaiju

    dwnldingDaikaiju Well-Known Member

    I guess that worked back then, but Windows keeps doing it. I found this youtube video :https://www.youtube.com/watch?v=qjaov_pai7Y
    which lists three updates KB3022345, KB3045999, and KB3068708, I uninstalled the one I had, restarted, and I still get "The application was unable to load a required virtual machine component. Please contact the publisher of this application".

    If anyone figures out what the new update is that's causing this (windows 7 for me) I'd love to know.

    ps: Microsoft really annoys the hell out me from time to time.
    Performant likes this.
  12. Menauer

    Menauer Member

    List of Windows 7 updates that break MeguIVit:
    Security Updarte for Windows 7 (KB3045999) "elevation of privilege if an attacker logs on to the system and runs a specially crafted application"
    Security Updarte for Windows 7 (KB3071756) "elevation of privilege if an attacker inserts a malicious USB device"
    Security Updarte for Windows 7 (KB3060716) "elevation of privilege if an attacker logs on to an affected system and runs a specially crafted application or convinces..."
    Security Updarte for Windows 7 (KB3088195) "elevation of privilege if an attacker logs on to an affected system and runs a specially crafted application."
    Security Updarte for Windows 7 (KB3101746) "remote code execution if an attacker convinces a user to open a specially crafted document or to go to an untrusted webpage that contains embedded fonts."
    :(
    Performant and dwnldingDaikaiju like this.
  13. Performant

    Performant Member

    Here's a currently comprehensive list of the culprits, including a new one, KB3080149:
    KB3022345
    KB3045999
    KB3060716
    KB3068708
    KB3071756
    KB3080149
    KB3088195
    KB3101746

    A much more troubling, long-term issue is that MeguIVit won't run on later versions of Windows such as 8.1 and 10 no matter what we do.

    That's unless, of course, Vitreous the Mighty kindly does something about it using a recent version of Spoon. :D
    Last edited: Dec 2, 2015
    dwnldingDaikaiju likes this.
  14. SamKook

    SamKook Akiba Citizen Uploader

    Neither Rollyco nor Vitreous have been around for the past 2 years so I'd say it's unlikely. Vitreous also hasn't updated QTGMC(the core of his mod) in years in other places.

    If I can get my hands on a copy of Turbo Studio(formerly known as Spoon Studio) which shouldn't be hard, I'll try to check if it can be fairly easily ported from the current version or not when I have some time to do so.

    Edit:
    I did a quick try and it doesn't seem that it would be too problematic.

    Extracting and re-packaging the files went fine and it starts up so that's a very good sign.
    The only problem is that I can't extract the registry part of it so I'll have to try and capture it from the installations that require them, but there's a good chance that's only required for avisynth(fingers crossed) so it should be fairly simple.
    Last edited: Dec 3, 2015
    Performant likes this.
  15. SamKook

    SamKook Akiba Citizen Uploader

    It was easier than expected so here's the repack of MeguIVit beta4 with a recent version of the virtualization software: http://www.mediafire.com/download/57irzr1pr72n1bx/MeguIVit_beta4_Repacked_2015-12-02.rar
    The only difference with MeguIVit beta 4 is that I updated x264 to version 2638 from last mid-October, everything else should be the same.

    All you need is the exe to use Vitreous version beta4. It will create a new sandbox folder using his stuff so it doesn't need to be replaced anymore.

    I only tested it on a minimal Win7 x64 installation so if you're using something else, please let me know if it works with it or not, it would be much appreciated.
    The only test I ran was a 10 sec encode with the default settings so it's possible I forgot to add a system file that will break other settings. If it doesn't work for you, please let me know which settings you used and what the error message is saying.

    If this is actually working properly with the updates mentioned above and with win8.1 and above, I'll try updating a few more things(avisynth and a few filters could use an update) and release a newer version, but that will only happen if I have feedback for the current version(I don't use it anymore so I can't do a lot of testing).

    Edit: Forgot to mention this should also fix the missing system dlls. I think it was an x86 vs x64 problem so it may be fixed for x64(which most people have nowadays), but not for x86(or it may also work, depends on how smart the new version is).
    Last edited: Dec 3, 2015
    Menauer, shank and eshwaa like this.
  16. eshwaa

    eshwaa Well-Known Member

    Thanks for working on this SamKook, it's finally working for me. I guess I still didn't have things in the right places the last time you were helping me with this.

    It's working on win8.1. The only problem is on my end with antivirus blocking some items, but everything worked after disabling the AV and unzipping the program again.
  17. shank

    shank Member

    I was recently attempting to recreate this setup manually using latest of everything and figure out what Vit was using and how to use it, because I am getting rips with strange aspect ratios (I'm not sure if that had to do with me updating individual components like x264), and it is looking like AviSynth project is becoming active again. It looks to be a massive undertaking (for me), because I am not familiar with using all these individual tools and scripts. I had a very basic setup that worked, but didn't have everything setup right and rips didn't look as good. I got stuck trying to figure out how Vit was resize/cropping and with what. There was a lot of script to go through. I'm so glad you are taking the time to get this working. MeguIVit is years old now and doesn't work on a current win7, 8, or 10 setup, so it really doesn't run at all without someone doing quite a bit of research and extra setup.

    I will be testing this. Thank you.
  18. SamKook

    SamKook Akiba Citizen Uploader

    Good to know it's working on win 8.1, thanks.
    Can you get a list of the blocked items from your antivirus? I could check if I can do something about it since there are unnecessary stuff bundled with it.

    Looking forward to your feedback.

    As general information about the individual components and the process:
    Avisynth, ffdshow(used only as a codec for the pre-rendering job), MeGUI and Nero AAC encoder are the main 4 software used. I think MeGUI actually has all of them already included, but I haven't used it in a while. I list those because they are the 4 in the main MeguIVit folder.

    Avisynth needs the source plugin to load the DVD files(DGmpgDec1.58), a source plugin for the audio(not sure what MeguIVit use, I use NicAudio) and a deinterlacer which is the most important part to get great quality(QTGMC, made by Vitreous himself). You probably also want to change the dll from the install to the MT(multithreaded) version which is what MeguIVit has.
    You also need libfftw3f-3.dll, fftw3.dll and msvcr71.dll in your syswow64 folder.

    QTGMC requires a bunch of extra plugins to work properly, but there's a bundle for them if you get it from a proper source. The only issue is that if you're using avisynth 2.6, you need to update at least one of those required plugins(mvtools2). I can't remember if there are more that absolutely need an update since I did a lot of test trying to use more recent version of as many as possible.

    As for the script itself, it's not very complicated. The one inside MeguIVit is very complicated only because it needs to make choices automatically.
    Here's one of mine for a JAV DVD(I wouldn't use those QTGMC settings for IV), anything starting at the arrow isn't part of it, it's just to explain what it does:
    Code:
    SetMTMode(5, 4) <-- Used to set the number of thread for the multithreaded version, in this case 4
    Vid = DGDecode_mpeg2source("D:\_1enc_\_ISO\RBD-711\RBD-711.d2v") <-- loads the video processed by DGmpgDec
    Aud = NicAC3Source("D:\_1enc_\_ISO\RBD-711\RBD-711 T80 2_0ch 192Kbps DELAY 0ms.ac3") <-- loads the audio
    AudioDub(Vid, Aud) <-- merges the video and audio together
    SetMTMode(2) <-- Changes the MT states from 5 to 2 for the processing part since it's faster. It's not recommended to load the source files using a state below 3.
    
    QTGMC(Preset="Placebo", TR2=2, EZKeepGrain=0.4, Sharpness=0.3) <-- The deinterlacer and main part of MeguIVit, the tricky part is to find the right settings for it.
    
    Crop(6, 0, -6, -0, true) <-- Crops the border of the video, in this case 6 pixels from the left and right.
    
    Trim(4478,515962) <-- Trims part of the video to remove unwanted stuff at the beginning and end of the video
    If I wanted to resize after cropping(I personally prefer to keep the original aspect ratio intact), I would have added the following line after the Crop one:
    BlackmanResize(854,480) <-- A very good resizer that works well in most situation.

    What I skipped is that you need to process the dvd files with DGmpgdec, then you encode the script using x264 either directly or with any software that supports avisynth and x264, encode the audio using nero aac either directly or... and then merge the two together in your favorite container(mkvtoolnix for mkv or mp4box, likely using one of his many GUI options, for mp4).

    Note: DGmpgDec is only for DVD, you'd use something else for BluRay.
    Last edited: Dec 6, 2015
    shank likes this.
  19. eshwaa

    eshwaa Well-Known Member

    Here's a list from Avast, it looks like it's blocking most components. I'm not sure what's causing the problem, since I also have some of these (mkvmerge, x264, neroaacenc) already installed on this computer.

    Everything on the list can be restored and white-listed, so it ends up working.

    Meguivit.JPG
    SamKook likes this.
  20. SamKook

    SamKook Akiba Citizen Uploader

    Thanks, according to the description of the virus, it's just a generic detection of a software that has the potential of installing other potentially unwanted software.

    Since that's the whole point of this(an exe file that "installs" other exe file when creating the sandbox folder), it's perfectly normal as well as safe and there's sadly nothing I can do to prevent this.
    eshwaa likes this.