DV Info Net

DV Info Net (https://www.dvinfo.net/forum/)
-   What Happens in Vegas... (https://www.dvinfo.net/forum/what-happens-vegas/)
-   -   2 Pass Encoding.... Why? (https://www.dvinfo.net/forum/what-happens-vegas/64309-2-pass-encoding-why.html)

Jason Robinson April 4th, 2006 01:23 AM

2 Pass Encoding.... Why?
 
This is a rendering question for all the gurus out there (Ed, Doug, etc... :-)

Logic would tell me that if I do something twice (taxes, math problem) I might find errors and thus obtain a corrected result. But I am not a perfect computing engine that always does the same operation the exact same way two times in a row. A computer is. But when dealing with rendering why is there a 2 pass encoding option? How can the same render algorithm applied to the same source footage possibly increase the quality of the footage? What is a single pass render leaving out that a 2-pass render puts in?

Jason

Giroud Francois April 4th, 2006 01:35 AM

several pass encoding allows the encoder to apply different rules according the content to be encoded.
in fact the first pass is not really an encoding pass. it generates only a profile of the bandwith/quality necessary for the 2nd (and eventually more) pass.
this way you can give bandwith at the right place, while sparing it on the other places.
You have to know that mpeg encoding is pure math, but contains a lot of parameters that allow to process the signal a thousand of different way.
So you can hardly expect two people encoding the same file to obtain the same result.
Several pass encoding is not supposed to give better quality, but only better quality versus size of file (smaller).

Douglas Spotted Eagle April 4th, 2006 07:14 AM

Francois explained it well. My general "simple" explanation is that if you're planning on a trip somewhere, and have never been there before, perhaps doing a virtual tour first gives you an idea of the landmarks and places you can move through quickly vs places you want to spend time hanging out. Two pass is like that. It goes through "virtually" rendering nothing, just mapping out what's where and how much information is in what areas, and then makes intelligent decisions about how to best compress those sections. It's like a "preview" of the project. If you don't have a lot of detail or movement, two pass is generally not highly valuable. It can add significantly to your render time. We're just finishing out our normal work for a broadcaster here, and during the edit, I noticed some noise in the frames in the "after sundown" shots. So, I applied Median to some of those areas, and decided to two--pass encode it because it's motorcycle wheels flying thru the air. What is normally about a 16 hour render is now on its third day. Of course, Median has a lot to do with that too.... but two pass can provide better quality in those high motion/high detail shots.

Jason Robinson January 31st, 2007 06:58 PM

Thanks again Giroud & Douglas
 
Just rereading some of my older questions. Thanks again Giroud & Douglas for those answer. I rendered a recent photo package (ken burns effect all over) using 2 pass just to see what would happen. I might try finding some motion heavy scenes and rendering just a short test segment both ways to see any improvements.

jason

Dave Stern February 6th, 2007 11:04 AM

Quote:

Originally Posted by Jason Robinson
Just rereading some of my older questions. Thanks again Giroud & Douglas for those answer. I rendered a recent photo package (ken burns effect all over) using 2 pass just to see what would happen. I might try finding some motion heavy scenes and rendering just a short test segment both ways to see any improvements.

jason

to see improvements, if there are any to be had with the encoding, you'd need scenes with both low motion and high motion. the multi-pass encoding takes bits from the low motion scenes and applies them in the high motion scenes..that's how you get better quality for the same (approx.) file size (whereas a CBR would use the same bits in all scenes, perhaps using more than are needed in low motion scenes that could have been better used in the high motion scenes).

if you encode only a high motion scene, it won't matter whether it was CBR or 2 pass VBR, because the bits would be distributed probably the same throughout. the biggest differences will come from a tape where you have a lot of low motion scenes (or other easy to encode scenes) and some that really benefit from more bits, either motion, complex backgrounds, etc.

also, if it's a photo slideshow, I'd be surprised if you see any benefit from multipass encoding. The reason is that you probably don't have enough motion in the show to justify the multipass encoding (or if you do, those photos are moving quite quickly!!!). If you had a montage of video + slide show, what you might find is that some of the bits from the slide show end up being used on the video instead.

If you are not happy with the encoding on a photo slide show, I'd recommend to look at deflicker options in your package if there are any. also, if you can render your slide show as an AVI, then you can encode it with your favorite encoder and really play with it that way to see what's really going to give you the best results.

Richard Iredale February 12th, 2007 12:35 PM

By the way, one shouldn't confuse VBR (Variable Bit Rate) encoding with the need for multiple passes.

As you recall, most MPEG2 encoders offer CBR and VBR encoding options. In the first instance, the bits needed for any particular video frame is the same as for any other frame. While this offers the advantage of simplicity, it wastes efficiency because clearly some frames are more visually complex (and thus require more data to represent them) than other frames. So VBR offers the promise of a better allocation of bit resources. The complex frames get extra bits and their quality gets better, while the simple frames get by just fine on the fewer bits assigned to them.

Keep in mind that VBR doesn't NEED multiple passes to work. After all, the MPEG2 encoder has the smarts to watch the frames as they come in and allocate more bits for complex ones.

What multiple passes do for you is give file size certainty. Say you want to put two hours of MPEG2 on a single-layer DVD. The resulting bitrate is going to be pretty low, so you decide to use VBR in order to maximize the quality of that low bitrate. Okay, you tell the encoder you want a file no larger than, say, 4GB. How is the poor encoder going to know how many bits to allocate to a given complex frame? It has no way of knowing if all succeeding frames are going to be equally complex, or if they are going to be black or static. All an encoder can do with a single-pass philosophy is say to the user, "Just tell me the Quality Level you want, and I'll encode both simple and complex frames to that level. I won't, of course, be able to guarantee a specific file size, because that all depends on the complexity of the images." So what you get from a single-pass system is an MPEG2 file that is VBR, all right, but may or may not fit on your DVD space.

That's where multi-pass comes in. On the first pass, the encoder looks over the whole project and gets a general fix on scene complexity. Then, on the second pass, the encoder can precisely allocate bits to simple and complex scenes such that the finished file is exactly the size you wanted.

Some encoders such as CinemaCraft can make up to 10 passes (though 3 or 4 is about as good as things are going to get). The additional passes allow the encoder to refine its bit allocations more accurately in order to get the best overall image quality for the size.

Greg Boston February 12th, 2007 12:55 PM

Richard,

That is one of THE BEST EXPLANATIONS I've seen on this subject. Although I already understand the concept, you did a magnificent job of putting it into layman's terms.

If we had a 'post of the month' club here, I'd certainly nominate yours. ;-)

regards,

-gb-

Bill Slammon February 12th, 2007 09:06 PM

Basic question: how do you initiate a multi-pass/2 pass encoding? Can't find it in Vegas.

Thanks,

Bill

Edward Troxel February 12th, 2007 10:09 PM

Quote:

Originally Posted by Bill Slammon
Basic question: how do you initiate a multi-pass/2 pass encoding?

After choosing File - Render As and picking the MPEG2 format, select the desired preset and then click on "Custom". From there you can turn on 2-pass VBR encoding.

Dave Stern February 13th, 2007 03:56 AM

Richard - excellent point. not sure if I can tweek my post or may just leave it with your comments following..I'll give it some thought.

Bill Slammon February 13th, 2007 05:58 PM

Thank you, Edward. I tried doing that and found the VBR but nothing that said 2-pass. Is VBR automatically 2-pass?

Sorry for the newbie questions.

Bill

Mike Kujbida February 13th, 2007 07:13 PM

Bill, assuming you're on the Custom - Video tab, to the right of the Variable Bit Rate option is the box to select Two-pass if selected.

Bill Slammon February 13th, 2007 08:55 PM

Mike,

Got it. Sometimes, you look so hard, you don't see what's right in front of you. Thank you.

Mike Kujbida February 13th, 2007 09:05 PM

No problem Bill. My wife accuses me of that (not seeing what's in front of me) all the time :-)


All times are GMT -6. The time now is 11:32 AM.

DV Info Net -- Real Names, Real People, Real Info!
1998-2024 The Digital Video Information Network