video encoding&cleaning

Tsunami MPEG encoder (TMPGenc)


Progressive 50/60 Hz encoding
Encoding other (AVI-) formats with TMPGenc

Recompressing MPEG2

I hardly use TMPGenc any more since CCE Basic has appeared, and there are other alternatives meaanwhile, such as HC encoder. The following text is left here for reference and some specials. For the latest on MPEG2 encoding, see the new MPEG2 page.

This encoder of Japanese origin (freeware by Mr. Hiroyuki Hori) is one of the best MPEG2 encoders out there and second only to CinemaCraft encoder (which is significantly faster and slightly better). It's also the one of the best MPEG1 encoders available, so this is the one I used for Video CD. The main reason for its quality might be that even at it's lowest quality setting, it has a very good motion estimation.

At MPEG2 and bitrates over 2500kbps it beats all available implementations MPEG4 (except maybe for DivX4) and WindowsMedia8, and can work at 1/3 the bitrate of a DVD and fit over 30 minutes on a CD.

Versions until beta12a were released in Japanese but English language patches are available.

Since beta 12, TMPGenc could make SVCD compliant files. Beta 12a however was the last unlimited version to support MPEG2. Due to some licensing problems, MPEG2 was removed from beta 12b.
Then followed beta 12g...12i again with MPEG2 but every 30 days a new one and each time limited to 30 days ('trial version').

Non beta versions 2.0 and up are payware. Still worth it, but since CinemaCraft released their CCE Basic for just $58, TMPGenc is too expensive in comparison.
My advice: Keep any older versions you have. The author also takes the freedom to eliminate features in newer versions. The latest versions cannot encode 50 fps any more, for example.
Newer versions also now require periodic "online validation" to work. While this activation stuff is already an Imposition with an operating system like Windows, it is totally unacceptable with single applications, and even more so if periodically repeated at haphazard. Imagine the web is down, the app wants to call home and you have to finish an important project. Imagine all your most probably several dozen legally registered applications act like this. So don't expect any more words about newer TMPGenc products here.

The website is at

Here is a good review of TMPGenc, here are some guides (in German), here is a discussion board.
Templates for
PAL DVD, mini DVD, XSVCD, progressive MPEG2 here.


MPEG2 Example in 720x576, would fit >30 min on one CD. This is amateur camcorder footage. Hi8 tape played with a Digital8 Camcorder and captured via IEEE1394 interface. Filters: VirtualDub Smart Smoother R3 interlaced, then Smart Deinterlacer (settings here) to have complete comparability with the DivX4 example. Encoding done w. TMPGenc 2.0, DVD template, bitrate lowered to 2400 kbps average. 6 seconds, file size 2 MB.
BTW, the little stairs at the edges of some bright white objects are an effect of the camera. I could also have used a cleaner source but such average amateur material is more difficult to deinterlace and to ancode so it's a better test for the process.

The fast moving shot at the end would tend to stagger heavily with Microsoft MPEG4 as well as bbMPEG. Here it is clean.
TMPGenc cheats a little by blurring the picture. To avoid this, you could use the edge sharpening filter, typically OK at its maximum setting (127).

Note: Media Player cannot play MPEG2 without an additional decoder. You will need to install a DVD player that contains such a decoder, for example Cinemaster (bundled w. Elsa and Matrox graphics cards and also separately obtainable from Elsa, see Links). Cinemaster is the fatstest decoding engine available.
Hint: Cinemaster deinterlaces by default, which is not good if you use a TV output. Set deinterlacing to 'Force Weave', this disables it. You may have the option to install the codec only. The player itself is so terrible (much degraded from the old Cinemaster that only works in Windows 9.x) that I prefer the Windows DVD player with it (search for dvdplay.exe on your harddisk).

Another very good (but not quite as fast) alternative it the Elecard player (see links). It's also very easy to obtain and harmless to install.

I think the example shows that Temporal Cleaner and Smart Deinterlacer have reached a very mature state. Temporal Cleaner removes the noise from the analog tape without blurring anything. For DV footage it wouldn't be necessary. Deinterlacing also would not be necessary for MPEG2, however then it would look bad on the computer screen, and I tried to use the same settings as I used for the example on the MPEG4 page.

You may also omit any Filters in VirtualDub and use Tsunami's:

The deinterlacing settings settings that work best for videos here are Field order B, Deinterlace (double click on checkbox) Even Field, Adaptive. However as mentioned, deinterlacing is not necessary for MPEG2 if your main target is viewing on TV.
You can check the effect of all filters in their preview windows.
There are some powerful enhancement filters, too.
For noisy sources, try Denoiser, temporal only, 100%.
For blurry sources, use the edge enhancer. It is excellent.

To check your results frame by frame, you can open 2 instances of Tsunami and use the Preview mode. This works very slow however, so don't try this with large files.
For testing, you may use the 'interlaced' MPEG4 test video from this site (MPEG4 page).
This is no high quality source but it works. Recoding this to MPEG2 with Tsunami is no problem

The main advantage of MPEG2 over MS MPEG4 is lower CPU load at playback, at the cost of 3x longer encoding times. Also interlaced video is allowed (MPEG4 can also deal w. interlaced stuff directly if you do it the right way - see MJPEG/MPEG4 page).
The file size however cannot be reduced as far as with MPEG4.

TMPGenc is the first encoder I've seen that can handle jumpy old camcorder videos without any problems. A properly done MS MPEG4 still looks better at the same bitrate, but this can stutter and produce skipped frames especially at high bit rates and full resolution, due to insufficient CPU power, so this MPEG2 encoder is surely good for camcorder footage.
DivX4 now offers an alternative, since it not only handles the said problem videos well but is also ISO compliant MPEG4. I encoded some full PAL videos at 3000 kbps, interlaced, with only the Smart Smoother filter at lowest setting. Excellent crispness and fluent playback on my Matrox DualHead TV output, even at very critical scenes.

The bbMPEG encoder could also do the MPEG2 job quite well, but it's half as fast, not quite as good at high compression ratios, and the resulting MPEGs may turn into a slide show if very heavy movement is involved. I can't explain why this happens, but it's a playback problem that I could verify it with several players with completely different decoding engines.

SVCD is a new format that fits on CD but plays on newer DVD players.
See the SVCD overview for more information.

Because SVCD templates are now supplied with Tsunami, I've removed the experimental ones from this site. I have however added a PAL DVD template.
These templates use CQ-VBR. The bitrate calibration of this mode has been corrected and it delivers very good quality and speed, but apparently it is still a bit generous with the upper bitrate limit, which could lead to compatibility problems.
Get a free bitrate viewer to check for this yourself,
Here .
For the best possible results, I would suggest to use the templates that come with Tsunami and change the setting to 2-pass VBR, (for SVCD: max. bitrate 2520, avg. 2200 or lower).
2-pass takes between 50% and 100% longer to encode but delivers even better quality and obeys the upper bitrate limit better, as long as the 'normal' quality setting is selected.

Most of TMPGenc's predefined templates have locked settings. In order to modify them, Load the template you want to start from and then load the 'Unlock' template from the \Templates\Extra folder.
You could also open the template file with Notepad, change all occurrences of "ReadOnly = True" to "ReadOnly = False" and save it (preferably under a new name).
If you want to have a different data rate for VCD or SVCD, you also have to change all occurences of the normal bitrate to your desire. This will not produce a standard conforming disk but it may work on many DVD players.

If you want to squeeze it to the max, Tsunami has a scene detection function (GOP Structure - Force Frame Types - Configure - Auto Set, then right click on the displayed frames to set details) that lets you specify different settings for every scene. Very professional.

My opinion:

SVCD seems to get very popular but isn't yet as portable as people say. Many players don't understand the format, and while the .dat files on a VCD can be played just with Media Player on any thing from a Pentium 133 or so, SVCD needs a DVD player program that understands the anamorphic format, and a PII class CPU.

The format will allow for approx. 45 min of video on one CD.

If 30 min per CD are acceptable, Tsunami is also capable of encoding full frame size (704 x 576 or 480) in a decent quality, and even very difficult footage plays back smoothly on a 500 MHz Celeron, something not so reliably achievable with an MPEG4 of this quality. The quality of the Tsunami encoder makes it possible. For Cinemascope movies, even more (e.g. 50..60 minutes) could fit on one CD due to the smaller frame size. Here are some new settings files for low bitrate modes. Copy them to the Template subdirectory. Be sure to load settings again after opening an input file, Tsunami will go to default for every new file. Also be sure to check interlacing manually if you encode from an interlaced MJPEG file taken in one field mode.


You may also try an extended SVCD format (XSVCD):
704x576 or 720x576 (x480 for NTSC) at average 3000/ max 5000 kbps, interlaced (encoded from DV camcorder footage).
The 704 horizontal resolution is already part of the SVCD standard, while 720 are a little better for recoding DVD or DV because it's their native resolution. 704 at 2520 max. bitrate would therefore still be a standard SVCD, however this bitrate is usually too low for the resolution, so the little 'X'tra is a must.
I started from the SVCD template (open it in an editor and change all 'ReadOnly=True' to 'ReadOnly=False', otherwise some settings are locked), changed all occurrences of 2520000 to 8000000 (otherwise TMPGenc locks bit rates), then loaded the template in TMPGenc and changed resolution to 704, encoding bit rates to 5000 max. and quality to about 40% for CQ. (in order to get defined bit rates, use 2-pass VBR at 5000/3000/0. The one-pass is set to 4700 max. because this tends to overshoot a little).
A larger maximum can be tried but CD drives may be much slower than advertised when playing video files, so I chose 5000 for safety (8000 should also work and it should increase quality in some fast motion scenes).
I've added some
settings files ("XSVCD...") for this mode.
Some people say that some stand alone players may not be able to read average bitrates above about 3000 from a CD. Short maxima above it may be OK but that's kind of a lottery in this case.

Some XSVCD videos I test burned with Nero played very well on a stand alone DVD player. Field order was right without changes (at least appeared so, nothing's for sure if there's only a damn plasma TV available for viewing).

This means you can make a pseudo DVD just with your CD burner.
One major advantage is that SVCD, like VCD, stores data with much less error correction overhead than a data cd, so actually larger files will fit on the medium.
Over 30 minutes fit on one CD, enough for holiday videos.
For 16:9 movie stuff, 45 min should also be no problem.
You have to test however if a particular desktop player can deal with the format. Also only a very few PC software DVD players can deal with SVCD of any kind.

Usability of XSVCD is of course questionable as there are only some desktop models and even fewer computer programs playing it. For PC playback, burning the plain mpg file on a data CD would be better. Also in this case it would be better to deinterlace (use one of TMPGenc's adaptive modes) or use progressive encoding (see below).

There's still the question if one could create a genuine DVD structure on the CD. If you succeed with this, please send me an e-mail.

Progressive 50/60 fps encoding

Playing interlaced material on a computer monitor looks bad, as anyone knows. Deinterlacing works, but camcorder footage may still look bad with it because fast pans look rattling and blurry. Only way around it is to make a full frame out of each field, e.g. converting to 50 or 60 Hz (actually 59.97 Hz) progressive. This can retain the full crispness and motion resolution of DV material.

There are already DVDs available that are encoded ths way. I guess it will be the future standard, because LCD displays and projectors also can't play interlaced.

As MPEG uses frame similarities for bitrate reduction, this does not really need many more bits to encode, but it definitely needs more CPU power. At 800 MHz or above, 50 fps PAL for example plays fluently with the Cinemaster engine. The Ligos filters will need 1 GHz or more.
The results I got so far were excellent. I've added an experimental settings file for PAL 50 fps to my TMPGenc
templates. It has a GOP adjustment to free some bits and to ensure that there will be a timeline at playback. I also added some sharpening (horizontal at maximum, vertical none) against TMPGenc's typical light blurrines. The bitrate is set at the practical minimum, increase average if you have a lot of motion in your footage.

The template will not work on the latest TMPGenc versions because they removed the ability do do "high level" encoding. Sorry. Keep or try to get older versions.

The 50 fps video even plays perfectly on my Matrox TV output. The card obviously sends the video stream to TV as 25 fps interlaced. It doesn't even matter that the Cinemaster engine I use can't play interlaced video, since the software only 'sees' the progressive 50 fps.

As TMPGenc doesn't save filter settings and the whole 'advanced' tab, make sure you use deinterlacing "Even-Odd field, adaptation" (this does the fps doubling) and if you like, Edge enhancement 127 horizontal only.
Here are the other settings (for PAL):

Field order may vary because of PAL/NTSC and TMPGenc version. Check it with the preview of the deinterlacer filter.
The typical 'field ordering problem' for DV does not appear here, probably because of the deinterlacing involved with frame rate doubling.

I've lately added some NTSC versions of templates, however I can't really test them so be sure you try before you invest lots of time with them.

Encoding AVI with TMPGenc

It's hardly known that TMPGenc can also encode AVI files with any VFW codec.Use 'File', 'Save as...', 'AVIfile', then select codecs and their settings, and off you go. All of TMPG's excellent filters will still be in charge.

So you can also produce a progressive DivX4 with the 50/60 Hz templates, for example. DivX encodes faster than MPEG2, playing this back will however take far more than 1 GHz.

I have to add that VirtualDub can also be used for progressive encoding, with Donald Graft's Smart Bob filter. It's more complicated to use however. Read his description for details.


Recompressing MPEG2

TMPGenc may be used to recompress DVD format MPEG2 to lower bitrates. This way, up to 4 instead of 2 hrs can be fit onto a DVD-RW or DVD+RW that has only 4.7 GB.
Essential for this is to make TMPGenc read MPEG2.

There are 3 methods for this:

After this, you only have to use one of the 30/35 min-bitrate templates.


Copyright (C) 1998-2012; all rights reserved. All materials in these pages are presented for scientific evaluation of video technologies only. They may not be copied from here and used for entertainment or commercial activities of any kind.
We do not have any relation to and do not take any responsibility for any software and links mentioned on this site. This website does not contain any illegal software for download. If we, at all, take up any 3rd party software here, it's with the explicit permission of the author(s) and regarding all possible licensing and copyright issues, as to our best knowledge. All external download links go to the legal providers of the software concerned, as to our best knowledge.
Any trademarks mentioned here are the property of their owners. To our knowledge no trademark or patent infringement exists in these documents; any such infringement would be purely unintentional.
If you have any questions or objections about materials posted here, please
e-mail us immediately.
You may use the information presented herein at your own risk and responsibility only. We do also not guarantee the correctness of any information on this site or others and do not encourage or recommend any use of it.
One further remark: These pages are covering only some aspects of PC video and are not intended to be a complete overview or an introduction for beginners.