MSP/VS/MF: Encode MPEG's from clips with fast motion

Tutorials using more than one Product

Moderator: sjj1805

Post Reply
User avatar
sjj1805
Site Admin
Posts: 1194
Joined: Fri Oct 27, 2006 12:45 am
operating_system: Windows 10 Pro
motherboard: Hewlett Packard 2AF7
system_drive: C
32bit or 64bit: 64 Bit
processor: 2-90 gigahertz Intel Core i5 4460S
ram: 8 GB
video card: NVIDIA GeForce GT 705
sound card: P40D100-4 NVIDIA High Definition Audio
Hard_Drive_Capacity: 8 TB
Location: Birmingham UK
Contact:

MSP/VS/MF: Encode MPEG's from clips with fast motion

Post by sjj1805 » Thu Nov 02, 2006 6:27 pm

Author: Terry Stetler
Flowing water, sunlit waves and fast sports action are among the toughest things to encode to MPEG or other temporal compressions (DivX, WMV etc.) without generating artifacts along the way. Setting a quality of 100 and a high CBR bitrate can improve things, but because of the complex lighting and motions in such content this is frequently where the "normal" settings are not enough and the Advanced MPEG menu comes into play.

Motion search parameters:

Once the bitrate, CBR and quality are set next click on the Advanced menu button in the Compression tab. Once the Advanced menu opens you'll quickly realize that there are a ton of MPEG settings you never knew were there. For now ignore 98% of them and just deal with the following settings that deal with motion.

MPEG deals with motion by using what are called "motion vectors" to calculate how much an object has moved between frames. As long as an objects motion is within the default search parameter set by the encoder all is well, but let the motion exceed this value and artifacting is a likely result. Unfortunately many, if not most, encoders define the motion search area as small a box a few pixels square. OK for talking heads or birthday parties, but not so good when you're dealing with waterfalls or race cars.

The fix: increase the area and accuracy of the motion search.

Start by browsing to the "Advanced Video Settings tab" as shown below;

Image

Once there check both the "Do half-pel search" box and the "Enable" box for "Auto set motion vectors". Half-pel (half pixel element) will enable subpixel searches, which are more accurate. Taking manual control over the horiz and vert motion vectors will help with pixelization due to fast object motion by searching for these changes over a larger area than the defaults would permit.

Now set a value of 16 or more in both the "Horz pel movement" and "Vert pel movement" spin boxes. Values can go much higher than this, so there's a lot of room for adjustment if the need arises. You can even define the search area as a rectangle to more closely tailor it to the situation at hand.

An example would be to set a wide rectangular motion search, say 32 horizontally by 8 vertically, when encoding car races. This would restrict the highest quality motion search to where it's most likely to be found; in the direction of the race cars motion. Turn this same rectangular search area vertical (8 horiz x 32 vert) and it's perfect for waterfalls. Keep the search pattern square for those situations where the motion is unpredictable (baseball, football, soccer, breaking waves etc.)

You might also want to increase the "Noise sensitivity" setting from its default value of 5 (3-7 is typical for DV clips) to a higher value more often used for analog captures (5-14 is typical for analog). I'd probably start with 10 or so. This could help with any pixelizations already in the camera footage due to the lighting, motion etc. Camera codecs are very good, but not perfect.

GOP adjustments:

MPEG GOP's (group of pictures) consist of mainly calculated frames (P and B frames) between widely spaced real bitmap data (I frames). More calculated frames, which are stored as motion vectors and not bitmaps, mean smaller file sizes.

MPEG's encoded for NTSC DVD generally use a GOP size of 15 while those for PAL DVD use a GOP size of 12, meaning each GOP equals about 1/2 second of video. In either case all but one of the pictures in each GOP will be calculated B and P frames and just one will be a real bitmap.

Because of this reducing the number of P & B frames and increasing the number of I frames can up the quality of high motion video by lessening the encoders dependence on motion vector calculations, but this comes at the cost of increased file size.

Yup....another tradeoff situation :)

If you want to try this technique browse to the MPEG Advanced/Video Settings menu and reduce the I frame value to 6 as shown in this image;

Image

As indicated in the above image (NTSC shown) this will reduce the number of P and B frames per I frame and therefore increase the number of I frames (real bitmaps) per second. Generally speaking more I frames per second = higher quality.

These settings will make for slower rendering, but should reduce pixelization due to objects moving rapidly between frames. If the pixelization is reduced but not gone up the motion vector settings by a few numbers and see what happens.

Needless to say I'd start by rendering a short preview range of a troublesome portion of the project until it looks good and only then render the whole project.
As for how large a GOP you can set for DVD: 18 is the limit for NTSC and 15 is the limit for PAL. These are known as "long GOP". A "short GOP" would be the 6 frame GOP I noted in my example.

Long duration stills are the perfect place for using VBR and "long GOP" because so little changes over time, which is exactly what both are best at. The "short GOP" trick I posted is for the opposite situation where you have lots of changes over a short time.

Different strokes for different situations and the modern decks I've used can handle it just fine. The only problem will likely be older decks, and IMO the Chinese decks are so cheap replacing these oldsters is probably long overdue.

ex: I now have $35 Norcent decks that'll play anything round with a hole in it while my $200-300 decks from just 3-4 years ago have trouble playing any recordable media beyond DVD-R.

Changing GOP's shouldn't affect transitions even if the sources are MPEG since MSPro8 transforms B and P frames into I frames on the timeline for editing.

With any source on export I, B & P would be encoded again and the motion calculations should be able to handle transitions as long as their duration isn't shorter than 1/2 second, the approximate length of a "long GOP".

Since a transiton this short in duration can be visually annoying IMO they should be avoided anyhow.
studiolynga wrote:How do You do it?
I cant get the advanced MPEG settings to show up in MSP8.
MSP7 works fine, I just did as You wrote in a message here
on the Forum, but with MSP8 I nothing happens.
This works in Win2K and XP;

Check the copy of MSP.INI in

C:\\documents and settings\\all users\\application data\\ulead systems\\ulead mediastudio pro\\8.0\\

Now look for this heading and entry;

[VIODRIVER]
Advance=1

If Advance=1 isn't there enter it and save MSP.INI back out to that location.

The Advanced button should appear on the export dialogs MPEG/Options/Compression tab.

Once set the Advanced option should appear when you restart MSPro8.

User avatar
sjj1805
Site Admin
Posts: 1194
Joined: Fri Oct 27, 2006 12:45 am
operating_system: Windows 10 Pro
motherboard: Hewlett Packard 2AF7
system_drive: C
32bit or 64bit: 64 Bit
processor: 2-90 gigahertz Intel Core i5 4460S
ram: 8 GB
video card: NVIDIA GeForce GT 705
sound card: P40D100-4 NVIDIA High Definition Audio
Hard_Drive_Capacity: 8 TB
Location: Birmingham UK
Contact:

Post by sjj1805 » Thu Nov 02, 2006 6:28 pm

Video Studio & Movie Factory Users can do this also.

Follow Terrys instructions in the post above but alter the following ini file
VideoStudio
C:\\Documents and Settings\\All Users\\Application Data\\Ulead Systems\\Ulead VideoStudio\\9.0\\uvs.ini
(Alter 9.0 above for your version of Video Studio)

MovieFactory
C:\\Documents and Settings\\All Users\\Application Data\\Ulead Systems\\Ulead DVD MovieFactory\\5.0\\DVDMF.ini
(Alter 5.0 above for your version of MovieFactory)

You now have the ability to alter the GOP structure in just the same way as Terry described.

Steve J

Disclaimer
This is not an official solution by Ulead. Editing a critical program file and any other changes to it can cause the program not to run properly. If you encounter problems with the software and ask for Technical support, the TS guys may not be able to give the exact solution because the program has been tampered. Tech Support can never know for sure what other values are changed so its better to be safe. Its like voiding the warranty of a certain electrical device by removing a jumper or modifying its circuit. Make sure you backup those files and revert it to the original one and then ask for TS assistance.

It is covered in the EULA under \"2. Use of Software: You may not: 4) reverse engineer, decompile, or disassemble or otherwise attempt to discover the source code of the software\"

Post Reply