Log in

View Full Version : How to process mkv files in TMPGEnc Xpress?


pequickit
9th February 2011, 12:30
I'm not a total newb at video processing, but I 've been having a hard time figuring out how to get TMPGEnc Xpress to load and edit Matroska mkv files in a Windows 7 x64 system I just set up.

So here's a few questions if anyone can help me out:

* It appears I need 3 components to accomplish this. Is this correct?:

1. Avisynth x64 to frameserve the mkv files into TMPGEnc Xpress
2. A media splitter like Haali for separating audio from video.
3. An mkv/h.264 video decoder, usually by installing ffdshow

* Is installing the ffdshow video decoders necessary if I already have MPC-HC and VLC player installed in Windows 7 x64 and playing mkv files correctly?

* Since I'm using Windows 7 x64, I have to install a 64 bit version of Avisynth compiled by JoshyD from this Doom9 page. (http://forum.doom9.org/showthread.php?t=152800) No other choices there, right?

* Or... are there any other/better alternatives for frameserving mkv files to TMPGEnc Xpress?

I have tried a couple approaches of getting this working. But neither was successful.

The 1st was to install Avisynth x64, Haali, and ffdshow. Then I created an avs file:

DirectShowSource("[videofilename].mkv")

... and opened it with TMPGEnc Xpress. But the video would hardly load when trying to edit it. It took several minutes to load, and several more minutes to jump to a different spot on the timeline. Trying to play the video took 5 to 10 minutes for it to eventually play. Don't know if it may be a problem with Avisynth x64.

Then I tried what I read in this post where jimcgr (http://forum.videohelp.com/threads/309626-need-help-importing-MKV-files-into-Tmpgenc-Xpress-4-under-Win7-x64-please?p=1970727&viewfull=1#post1970727) said he had better luck uninstalling ffdshow and Haali, and installing Shark007.

I launched Shark's application settings using "right-click" and "run as admin". Under the h.264 tab, on the right part, I changed "use Ms Codec" to "Use FFDshow's codec".
But as I recall (my memory's fuzzy here) that didn't work at all. Again maybe a problem with how I've set up Avisynth x64.

I haven't tried the approach osgZach suggested in this forum post, (http://forum.doom9.org/showthread.php?t=150339) for using CCCP (Combined Community Codec Pack) (http://www.cccp-project.net/wiki/index.php?title=Main_Page) that includes both ffdshow and Haali, but I'm not fond of installing huge codec packs, esp just for this one task.

I've been searching the net for days trying to find more posts about getting TMPGEnc Xpress to load and process mkv files, but haven't come up with much.

Thanks for any feedback on this.

PQ

osgZach
9th February 2011, 16:57
If you have MPC-HC and can play MKV files correctly, then you should already have FFdshow installed, AFAIK. In either case, CCCP should be all you need as it comes with FFDshow, Haali, MPC, etc.

However I always try and demux MKVs before I do any work, so I have access to the source video stream in its native format. TMPGenc might just let you import an H264 (I haven't used in forever). However keep in mind, if this is a Variable Framerate file, and your source stream was decimated to a non-standard frame rate, TMPGenc is might be a bad idea; I don't think it will let you output non-standard frame rates even if your source input is like that already (could be wrong).

I really like some of TMPGenc's filters, but I just can't use it anymore because it feels like more trouble than its worth in these cases (plus I work with mostly VFR Anime). Avisynth is more than equipped to do the job in that respect, since there are so many filters out there to deal with this stuff.

If I -were- to use TMPGenc today, I would always start with a DVD source. Initially I would index it with DGIndex, then load that into Avisynth with mpeg2source, and use TFM to match the fields, with Tdeint to catch any combing, and save it to a lossless file like HuffYUV (FFdshow has a hacked version that supports saving in YV12, good for working with DVD sources).

At that point you would have a 30FPS progressive video, which you could load into TMPGenc and filter to your hearts content, since you won't be running deinterlace/IVTC filters on it and messing with the frame rate, as that was done in the previous step.. You can color correct, noise reduce, sharping, blur, etc... whatever you need to do. Save THAT output as a 30p Lossless, and then run it back through Avisynth a final time with TDecimate to get either a proper IVTC, or VFR Decimation (whichever is called for).. Although not outlined, the steps for VFR are slightly different then what I have posted, but you didn't really specify what the source is or if you know whether it is VFR/CFR.

This is not really a thurough write-up though, and some things would need to be clarified. I guess the first question is, do you have a DVD source? If not I probably can't help you further (forum rules and all that).. unless its non-copyrighted material.. In which case, we'll need to find out if its Variable Framerate or not.. However the only real advice I have would be for VFR DVD sources (Like Anime).

Otherwise just demux it, get the H264 opened (either Natively in Tmpgenc, or with Avisynth using DGAVC source (I think) ) and run it through to your hearts content.. Should come out the same way it went in, except for image filters applied.


Also... Unless there is some particular reason you need 64 bit support, just use standard Avisynth x32. x64 is still very sketchy for non-special case work.. At least IMHO. With x32 you have a larger filter library and long standing, stable code, for the most part. Your are not forced to use x64 stuff on x64 Windows, because its backwards compatible for the most part.. So you shouldn't need FFDshow x64, Avisynth x64, etc.

As for CCCP, it is practically the gold standard in codec packs these days. It installs whats needed, and it just -works-. So your first step here is to uninstall all that x64 stuff, Avisynth, FFDshow, Haali, whatever it may be.

Once all that is cleaned out, install good old Avisynth 2.5.8 x32, then install CCCP and pay attention during setup, run the config afterwards, etc.. Its pretty easy and requires minimal fuss to use.

Doing that it stands a good chance TMPGenc might play better with your MKV file (it may not).. But the Avisynth DirectShowSource should definitely work at that point.. Although I have heard that DirectShowSource is not frame accurate, or something to that degree, so I'm not sure how well things will turn out.. I actuall avoid DSS these days unless I absolutely have to use it

setarip_old
9th February 2011, 19:23
@pequickit

Hi!

The following link may provide the information you need:

http://forum.videohelp.com/threads/309626-need-help-importing-MKV-files-into-Tmpgenc-Xpress-4-under-Win7-x64-please

pequickit
11th February 2011, 13:56
Once all that is cleaned out, install good old Avisynth 2.5.8 x32, then install CCCP and pay attention during setup, run the config afterwards, etc.. Its pretty easy and requires minimal fuss to use
Thank you so very much for this advise osgZach. That's exactly were I'm going to start at getting TMPGEnc Xpress frameserving Matroska files.

Demuxing the mkv files first is a good approach. I found I can demux the mkv I'm working on with mkvtoolnix into raw video and audio files, and then remux them with MP4Mux into an MP4 that I can process in TMPGEnc Xpress.

Most of the terms you used to describe work with Avisynth are new to me. The whole process of using Avisynth scripts to process video files more directly is something I've only toyed around the edges with. I haven't found a singe good guide online yet to start learning what all is involved in going that route, but I definitely want to look into it.

I have done some work with VirtualDub saving files to separate lossless video and audio files, and then using TMPGEnc Xpress to encode them. In the process I found the Lagarith codec which seems to be a great replacement for Huffyuv.

Your are not forced to use x64 stuff on x64 Windows, because its backwards compatible for the most part.. So you shouldn't need FFDshow x64, Avisynth x64, etc.

I' glad you pointed that out osgZach. I thought I had to have all x64 drivers to do all this work in Windows 7 x64. I'll go ahead and uninstall the ones I've loaded and go with CCCP as you've recommended. I see CCCP recommends running an older version 1st which is able to detect whether or not there are any pre-existing codec packs on your system, and clean thing out before upgrading to te newer version of CCCP


The following link may provide the information you need:

http://forum.videohelp.com/threads/3...in7-x64-please

Yes... I did find that post. Thanks for pointing it out though.

PQ

setarip_old
11th February 2011, 16:49
Yes... I did find that post. Thanks for pointing it out though. But you've not said whether it helped resolve your problem...

osgZach
11th February 2011, 17:13
You should be careful about demuxing and remuxing video into another container like that, especially if you don't know if the video is Variable Frame Rate.

If its standard CFR (Constant Frame Rate), then you don't have much to worry about, and remuxing won't harm it. But if its VFR and you don't also demux the timecodes file for the video track, then you have just screwed yourself. Another note on VFR, is I believe MP4 requires a bit of trickery to actually get a VFR video source muxed into it properly. I think it has to do with timecodes support or the way it does them versus Matroska (MKV)

I actually don't use MP4 containers so I don't know the specific details, other than there is a tool floating around here somewhere intended to help with that process.

Be that as it may, try opening the demuxed video stream in TMPGenc Xpress first and see if it will even read it / show up in the file list. Don't bother with remuxing into another container unless you absolutely need to. But you shouldn't, if you intend to frame serve into TMPGenc, or work on Avisynth manually from within Vdub.

I don't personally use Logarith because I had issues with it in the past, I don't really remember what but I had fussy issues with playback I think.. Also it is important to note that when using a Lossless codec, unless you intend to do a parmanent colorspace conversion, you should always use a codec that supports the native colorspace of your source file.

Loading your source in Vdub with an avisynth script, you can get the color space information, with the Info command.


xxxSource("somefile.xx")
Info()


You'll see something like RGB, YUY2, or YV12, etcs..
I don't know about Blu-Rays, but most DVDs come in the YV12 colorspace, for instance. Also important to note that, I don't think x264 (a popular H264 encoder) outputs anything but YV12 - maybe someone will correct me or confirm this?

Colorspace conversions are troublesome because each time you convert, you can loose a little bit of information about the color - not bad if done once, or maybe twice. But over and over and your video will start to look crappy (or so I've been told).

After you've installed CCCP and got it all up to date, etc. You should take a look in its encoder/decoder options. On it's start menu entry, there is another sub-menu for "Filters" and you'll see some stuff like... FFDshow Audio, DXVA, VFW, Video Decoder, Haali, VSFilter, etc..

There's lot of stuff in there to look at. But you shouldn't really need to touch it, unless you get some very odd playback problems from a specific video or audio file format (I've had trouble with OGG Vorbis in the past).

For YV12 I usually use the HuffYUV codec included with FFDshow, as it differs from the stand-alone original HuffYUV in that it supports YV12 colorspace. I usually just keep my DVD work files in lossless AVI's made with this codec, until I am ready to make a final encode. You can access it in Vdub from the compression menu where you select your usual codecs, you want to select "ffdshow" or however it shows up, then double click it to open the window and make sure in the encoder Tab that you have HuffYUV selected. It's much the same painless steps for TMPGEnc Xpress as well.

osgZach
11th February 2011, 17:14
But you've not said whether it helped resolve your problem...

Given that it contained mostly what he had mentioned trying in his first post, I would take a gander and say, no.