dvd-hq.info Forum Index dvd-hq.info
DVD & video forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

I, P and B frames
Goto page 1, 2  Next
 
Post new topic   Reply to topic    dvd-hq.info Forum Index -> Compression
View previous topic :: View next topic  
Author Message
royalbox



Joined: 12 May 2003
Posts: 39

PostPosted: Mon 12 May 2003, 21:00    Post subject: I, P and B frames Reply with quote

In the TMPGEnc guide, it talks about I, P, and B frames. It suggests that if you encode at a high bitrate of, say, 8000, then you can leave out the B frames. Now, if doing this, is it best to increase the number of P frames to compensate or leave it at the suggested 4? I increased them to 14 so there were a total of 15 frames in a GOP. Is this alright to do and which is better? Many thanks.
Back to top
View user's profile Send private message
RMN
Site Admin


Joined: 04 Feb 2003
Posts: 587
Location: Lisboa, Portugal

PostPosted: Tue 13 May 2003, 3:46    Post subject: Reply with quote

Depends on whether you enable scene detection or not. If you enable scene detection, increase the number of P-pictures (TMPGEnc will automatically insert I-pictures when it feels they are necessary). If you don't enable scene detection, then you need more frequent I-pictures to avoid visible "blocks" when the scene changes.

Generally, there's no reason not to enable scene detection. It makes encoding slightly slower, but the difference is small.

The only situation where you shouldn't enable scene detection is if you're creating a multi-angle DVD (where every stream needs to have exactly the same same GOP structure).

RMN
~~~
Back to top
View user's profile Send private message Send e-mail Visit poster's website
royalbox



Joined: 12 May 2003
Posts: 39

PostPosted: Tue 13 May 2003, 14:46    Post subject: Reply with quote

RMN, I do leave scene detection on so I'm pleased about that.
Thank you for helping me.
Back to top
View user's profile Send private message
a



Joined: 03 Jun 2003
Posts: 8

PostPosted: Tue 3 Jun 2003, 11:35    Post subject: Reply with quote

Hi guys

Is it possible to have only 4 frames in a GOP? like IPPP?
or do I make a non compatable if I do it like that?

I don't care about the size of the file, I'm putting 5 minutes of footage on a DVD...

thanks
/a
Back to top
View user's profile Send private message
RMN
Site Admin


Joined: 04 Feb 2003
Posts: 587
Location: Lisboa, Portugal

PostPosted: Tue 3 Jun 2003, 16:29    Post subject: Reply with quote

It is possible, but beyond a certain point you get diminishing returns. In other words, if I-pictures are too frequent, the bitrate won't be enough to produce good-quality images, and the encoder will be forced to increase quantisation. This is why you should never use I-picture only MPEG at low bitrates (to get good quality using only I-pictures you need about 20 Mb/s). I-pictures can give you the best quality but only if they have unlimited bitrate. Which is not the case in DVD.

To use that GOP (IPPP\), I would recommend using more than 8 Mb/s (preferably 9 Mb/s or even 9.5 Mb/s). Generally, unless you have a very good reason to want consistent GOPs (ex., making a multi-angle DVD), it's best to use medium / long GOPs and let TMPGEnc introduce I-pictures in scene changes (ex., use IPPPPPPPPPP\ and turn on "Detect scene change"). If two frames are similar, a P-picture will give you the same quality and use only half the bits of an I-picture. The bits saved on that frame will then be used by the encoder to improve the other frames.

RMN
~~~
Back to top
View user's profile Send private message Send e-mail Visit poster's website
a



Joined: 03 Jun 2003
Posts: 8

PostPosted: Wed 4 Jun 2003, 1:07    Post subject: Reply with quote

Hi rmn

OK... So there is a balance between GOP length and Bit rate. I can understand that...

I also understand the good point of using "Detect Scene changes" but what about Zoom and Pans.
The picture will change wery much from frame to frame (even field by field) during a Pan or Zoom which means that I should basically need a I frame for every frame in a Zoom or a Pan..
Please comment on this issue...

Also. Isn’t there a maximum bit rate for DVD's?

by
/a
Back to top
View user's profile Send private message
RMN
Site Admin


Joined: 04 Feb 2003
Posts: 587
Location: Lisboa, Portugal

PostPosted: Wed 4 Jun 2003, 5:57    Post subject: Reply with quote

The maximum bitrate for DVD is 9.8 Mb/s (including video, audio, etc.). That's why you shouldn't use I-pictures only (because to get good quality using I-pictures only you need much more than 9.8 Mb/s).

MPEG uses temporal compression with motion search. This means that even if two images don't match perfectly, as long as one part of the image is similar to another part of the other image, it will be able to re-use some of the other image's data. Basically what this means is that pans with little or no parallax will compress almost as much as stills.

Zooms are another matter. They don't compress quite as well, but if they're slow they'll also be well handled by the motion search.

The hardest things to compress are images where the camera or the subject have very irregular movement (ex, camera travelling through bushes).

But MPEG compression doesn't rely just on motion vectors, that would be insane.

After the image has been approximated as far as possible with motion vectors (and TMPGEnc is very good at doing this in the "highest quality" mode), it is subtracted from the real frame, and this "difference" between the frames is compressed using DCT (similar to JPEG). To rebuild each frame, the decoder takes the relevant pieces from previous frames, applies the motion vectors, and then adds this "difference mask". This can reconstruct the original frame even if the frames are completely different and motion search didn't find any matches. But of course, if the images are too different, then the motion vectors are just wasting space, and you're better off using an I-picture, which doesn't have any motion vectors.

The option to "detect scene change" doesn't actually detect scene changes. It simply compares each frame with the previous frame and, if the differences are too big to be well handled by a P-picture, inserts an I-picture instead. It's called "detect scene change" because those are usually the most critical frames, and the ones more likely to need an I-picture to avoid nasty artifacts.

So if for some reason TMPGEnc thinks it needs a couple of I-pictures during a pan or a zoom, it will add them automatically (as long as that option is enabled).

RMN
~~~
Back to top
View user's profile Send private message Send e-mail Visit poster's website
a



Joined: 03 Jun 2003
Posts: 8

PostPosted: Wed 4 Jun 2003, 8:43    Post subject: Reply with quote

Thanks rme
a lot of good info..

Today I did a test... I have a short clip with some pans and I have had problem with it before, jerky pans...
This only happens on PC's using PowerDVD or WinDVD, on a set top box it always looked fine, therefor I thought it was a Interleaced/Progressive problem... anyway.

I encoded the clip (from interleaced Uncompressed AVI) using TMPGEnc, I set the GOP to IPPP, 8500bitrate, I also enabled "detect scene change" and after that I went in to the force type settings and added I pictures for every fram during the pan...

Suddenly the jerky pans where gone!!! Both in PowerDVD and also in Windows Media Player... I could not se any degradation of the overall picture quality so this is the way I will do my Mpeg2 files from now on...

I'm using AC-3 stereo sound files so if I stay under a bitrate of 8500 I should be OK??? right???

Many thanks
/a
Back to top
View user's profile Send private message
RMN
Site Admin


Joined: 04 Feb 2003
Posts: 587
Location: Lisboa, Portugal

PostPosted: Wed 4 Jun 2003, 14:28    Post subject: Reply with quote

Don't add several I-pictures in a row Confused; you don't need them and it will make the image worse (less accurate colours, noticeable jumps in gradients, and some pixelation). Give the people who invented MPEG some credit... Rolling Eyes Pans are a rather common thing in movies, and MPEG deals with them very well.

Also, don't use such a short GOP. With a GOP like IPPP\, if TMPGEnc decides to add even more I-pictures (ex., making it IPIPPIPP...), it will only reduce the bits available to P-pictures, making the whole thing worse. If you're going to use automatic I-picture insertion ("scene change detection"), use a long enough GOP to let TMPGEnc distrbute the bits in a smart way (ex., I=1, P=12, B=0) .

Most commercial DVDs use GOPs with 12 frames or more, and almost never use 2 (or more) I-pictures in a row. The only place where consecutive I-pictures are useful is when there's a single-frame cut or flash.

Short GOPs and lots of I-frames are a great thing with unlimited bandwidth, but in DVD (where the bandwidth is limited to 9.8 Mb/s) they do more harm than good.

The only reason I can see for your system having problems with longer GOPs is if you have a very slow CPU (P-pictures and B-pictures are harder to decompress than I-pictures). The fact that the disc played well on set-top players indicates there was nothing wrong with the file.

Interlaced video will never look perfect on a PC screen, regardless of bitrate, etc., because PC players deinterlace the image by blending both fields. This makes the image look slighty jerky and slightly blurred. It shouldn't look terrible, but it won't look as good as on a TV. DVDs made from film, on the other hand, will usually look good on PC screens because they're not interlaced.

To ensure compatibility with older set-top players stick with a bitrate of 8 Mb/s or less. If you're sure your players can handle video bitrates above that, feel free to increase it (just make sure that audio + video don't go beyond 9.8 Mb/s).

RMN
~~~
Back to top
View user's profile Send private message Send e-mail Visit poster's website
a



Joined: 03 Jun 2003
Posts: 8

PostPosted: Thu 5 Jun 2003, 2:58    Post subject: Reply with quote

Hi rmn

Perhaps it's a problem with the software DVD players? I went to PowerDVD's homepage to see if they got any updates but there was nothing newer than the version I have...

I'm using a Dell Precision 50 Mobile workstation P4 1.8Ghz and a Custom built P4 2.8 Ghz, 1G ram PC, also a 1.25 Dual G4 Mac so there is no lack of power Very Happy

I also checked my tested files again and the one with many I-pictures "are" smoother in the pan but only on my PC, on my TV set using a Pioneer Player there is no difference. The difference is not wery big so pehaps I would go for a moore compatible Mpeg file, bigger GOP and lower bitrate..

Anyway... I think this is a problem with poorly made software players, When I look at movies on my mobile Dell there is never any problem but perhaps they deal badly with material originated from interleaced video..

It sucks... I now a lot of people who use there laptop for viewing DVD's so this is a real problem....

I also tried to de-interleace my video files in After Effect using RE Vision De-Interleaser before encoding, but that only resulted in even moore jerky pans...

Well I guess I have to start shooting with film
Very Happy
Back to top
View user's profile Send private message
RMN
Site Admin


Joined: 04 Feb 2003
Posts: 587
Location: Lisboa, Portugal

PostPosted: Thu 5 Jun 2003, 4:07    Post subject: Reply with quote

Film is even jerkier than deinterlaced video (24 fps instead of 25/29.97). The difference is better definition and less image noise (which in turn leads to better compression).

When you de-interlace video you are basically throwing away half the resolution, which is not good. You also don't get the proper motion blur (which you do get in film), so you notice the jumps between the frames more.

Go to PowerDVD's configuration and look for an option marked "hardware acceleration" (it's in a sub-menu). Turn it off. If it's on, it will try to use you graphics card's decompressor, which is usually a lot worse than PowerDVD's built-in decompressor.

RMN
~~~
Back to top
View user's profile Send private message Send e-mail Visit poster's website
royalbox



Joined: 12 May 2003
Posts: 39

PostPosted: Mon 14 Jul 2003, 12:37    Post subject: Reply with quote

@rmm
I've been using one 'I' frame and 14 'P' frames to make up 15 frames -- the maximum for pal -- with scene detection. I have noticed you give examples where you suggest between 10 and 12 'P' frames (I think). Would you say I should use slightly less 'P' pictures than I am?

Also, I notice on your very handy bitrate calculator, that the default 60 minute length with cbr suggests one 'I' frame, four 'P' frames and no 'B' frames which you say in this thread would not really be enough 'P' frames. I'm a bit confused by that. Is it because of some of the other settings?
Back to top
View user's profile Send private message
RMN
Site Admin


Joined: 04 Feb 2003
Posts: 587
Location: Lisboa, Portugal

PostPosted: Wed 16 Jul 2003, 18:26    Post subject: Reply with quote

royalbox wrote:

I've been using one 'I' frame and 14 'P' frames to make up 15 frames -- the maximum for pal -- with scene detection. I have noticed you give examples where you suggest between 10 and 12 'P' frames (I think). Would you say I should use slightly less 'P' pictures than I am?


Not really. There isn't a big difference in quality between using 11 or 15 frames per GOP. TMPGEnc does a pretty good job at scene detection, so it will break down the GOP when necessary. The only advantage of using less P-pictures (i.e., using shorter GOPs) is that, later, you have more chances of being able to start your chapters exactly where you want them (assuming you want to make a chapter mark in the middle of a scene).

Of course, the best way to ensure you have a GOP starting at the point where you want to set your chapter mark is to open the "Force picture type setting" window and mark the GOP starts manually.

royalbox wrote:

Also, I notice on your very handy bitrate calculator, that the default 60 minute length with cbr suggests one 'I' frame, four 'P' frames and no 'B' frames which you say in this thread would not really be enough 'P' frames. I'm a bit confused by that. Is it because of some of the other settings?


If you read the text after the calculator you'll see that the calculator assumes you are not using scene change detection. Not all encoders have that option and, even in TMPGEnc, you may sometimes want to have it off (ex., if you're making a multi-angle DVD). If you enable scene detection, you can (should) use longer GOPs (as described in the GOP Structure section of the calculator results).

RMN
~~~
Back to top
View user's profile Send private message Send e-mail Visit poster's website
royalbox



Joined: 12 May 2003
Posts: 39

PostPosted: Thu 17 Jul 2003, 12:00    Post subject: Reply with quote

@rmn
Ok, thanks very much for clearing that up for me. It seems I may have skipped reading the text on the calculator page. Embarassed
Back to top
View user's profile Send private message
Alban



Joined: 21 Jun 2003
Posts: 23

PostPosted: Thu 2 Oct 2003, 21:56    Post subject: Gop -- pictures and frames Reply with quote

Hello,

thanks for bringing that up. When I calculate a 114 min AVI with 2 audio streams (256 kb/s) I get a suggestion to have a GOP with 1 I-, 6 P- and 1 B-Pictures. Maximum number of frames is 15. Now, can I play with the P-Pictures or does picture mean frame so that I can not use more than 15 pictures? If I would use 1 I-, 8 P- and 1 B-picture I would get a GOP with 18 frames. I think mor P-pictures would be good, but I think it will be too much. I just want to be sure.



Smile
Thanks,
Alban
_________________
There is nothing to fear.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    dvd-hq.info Forum Index -> Compression All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group