PDA

View Full Version : Max bitrate problem


Juhan
16th March 2002, 19:15
There is a problem with CCE and max bitrate. CCE doesn't obey the max bitrate limit. It is sometimes much higher than it should. Even if I set max bitrate to 2300 kbit then it pops up to 3200 kbit kbit in some frames. It is most of the time 2300 and suddenly pops up to 3200 and then goes down to 2300 kbit again.

The problem is that my dvd player locks up if bitrate goes over 2600 kbit/s (Philips 752). It locks up so badly that I have to unplug it.

Is there a solution to force CCE encoder to obey maximum bitrate and not to go higher than specified ?

Does anyone else have this kind of bitrate problem ? Philips owners ?

Juhan
17th March 2002, 19:18
Even if I encoded 1600 kbit/s CBR with CCE, the peak bitrate was 2452 kbit/s. That's 2452-1600=852 kbits more than it should be. I view bitrates with 'Bitrate Viewer'.

Kedirekin
18th March 2002, 01:00
Personally I've always been suspicious of bitrate viewer. How does it calculate the bitrate at any given moment?

Does it do it frame by frame? The bitrate for an I-frame will be much higher than the bitrate for a B=frame.

Does it do it second by second? The bitrate for any given second can be drastically different just by moving one frame later or earlier (again, depending on if that frame is an I-frame).

I believe bitrate viewer even reports wildly variable figures on CBR encodes.

My advice, don't get too caught up in what bitrate viewer is telling you - I'd trust CCE and TMpg before I'd trust it.

Anyone have a disenting opinion?

RoopeT
18th March 2002, 12:06
I was also wondering about the bitrates that Bitrate viewer showed for my encodes. I also have an crappy Philips DVD player (622) and have been experiencing problems with it.

Lately, I've been struggling to make an SVCD with SVCD style subtitles that will play on my player, but with limited luck. I have been using the Simpsons DVD as a test encode, and managed to encode 1 episode with subs that also plays all the way on my player. I used DVD2SVCD with TMPGEnc (max 2300, avr. 2250, min 1400, CQ ~80 + audio 160). This gave me a subbed mpg with a peak bitrate of 2680 kbps (with audio + subs), but the next episode I tried had a peak bitrate of 2850 kbps (according to Bitrate viewer). The episode with a peak bitrate of 2680 worked ~OK, the next episode didn't (hanged the player). I also tried encoding CBR 2500 with CCE, but got a peak bitrate over 3000 kbps. Tried 352x576 @ CBR 2300 (CCE), which gave a peak bitrate slightly over 2700 kbps (didn't work).

I have had huge problems making SVCDs that play on my player already before I started experimenting with subs. With subs the player is even more sensitive about the peak bitrates. Now I really think that bitrate viewer is right about the bitrates and no encoder stays within the given bitrate limits all the time. Most of the DVD players just aren't that sensitive for a short bitrate peak, mine is.

Does anyone know how to use TMPGEnc's Manual VBR mode, and does that method respect the bitrate limits given?

Juhan
19th March 2002, 15:50
The solution in CCE is to set GOP structure to M=3 and N/M=5 (it is the default setting in CCE). DVD2SVCD sets GOP structure to M=3, N/M=4. If GOP is set to 3/5 then encoder respects given bitrate limits (with accuracy of 100 kbit). Eg. If you set max bitrate to 2300 then the peak bitrate is between 2350-2400. But if GOP is set to 3/4 then the peak bitrate goes over 3000 kbit/s.

For now I let dvd2svcd to prepare avs file and CCE project file for me and then I start CCE manually and do the encoding (GOP 3/5).

@dvd2svcd author:
Maybe you can add an option to your program to configure GOP structure manually in CCE. GOP 3/5 option also fixes low bitrate problems some people are having.

Mozart
19th March 2002, 16:01
Thank you for the info. I didn't know that. It is good to learn something new after so many weeks of lazy misconcepted requests/reports. I will make a test to confirm your statement and, if it is reproductable, I will add my support to your request.

Fireball29
19th March 2002, 16:59
@Juhan

Hmm, interesting aspect on the bitare problem. Could this also be the reason for some jitter in many SVCDs with PowerDVD and on my Cyberhome but not for WinDVD?

Where do u get this information? Just from trying yourself?

Cheers, Fireball

Slick
19th March 2002, 17:45
Originally posted by Mozart
It is good to learn something new after so many weeks of lazy misconcepted requests/reports.

Hey Mozart.
Do you have to work hard at being derogatory or does it just come natural?

unless I am mistaken it is a forum for people who want help & dont really need slapping down.

Geez I wish I knew everything without having to ask!

Juhan
19th March 2002, 18:38
@Fireball29:

I have been testing CCE for a month from now. The goal was to find CCE settings which prevent my standalone dvd player from crashing. I suspect that there is a bitrate calculation bug in all versions of CCE. The bitrate is calculated correctly for the default GOP setting.

BTW! With GOP 3/5 the overall bitrate is very stable (within given limits). And the good news is that my dvd player does not crash anymore.

With a 2 hour movie only one frame (!) was 2500 kbit (given max=2300, 4-pass encoding). The other frames were within limits (peak bitrate for the other frames was 2386).

Mozart
19th March 2002, 23:50
@Juhan

I cannot reproduce your result. Those spike values are almost the same for 3/4 or 3/5. Actually, using 3/4, the bitrate viewer's plot is much more smoother than it is for 3/5. What kind of movie you are enconding? I did my test with a hybrid NTSC, and CCE settings are default values. The bitrate setting is min=0, avg=1800 and max=2400. The highest spike is 2370 (for 3/4) and 2373 (for 3/5). Using min=0, you will let CCE do an automatic choice of its best minimum value.

edit: BTW: in my system, DVD2SVCD sets GOP structure to M=3, N/M=5. Are you sure that D2S is setting 3/4 for you?


@slick

:rolleyes:

gerti67
20th March 2002, 01:25
Hi there,

I just can confirm what Mozart said, I did a little testing for PAL and tested it with my usual test chapters I always use and those peaks are nearly the same with a M=3 and N/M=4 or 5 and I had the impression like Mozart that with the 3/4 setting the line in BitRate Viewer was slightly smoother or more linear than with the 3/5 setting over a variety of a lot of different scenes from smooth and dark to bright with heavy action and anime and so on.

In my system DVD2SVCD sets a GOP structure of 3/4 for CCE's M and N/M as the default value that is the only thing I can confirm.

Greetings,
Gerti

Mozart
20th March 2002, 07:35
hummmm... now I know what is happening:D

Almost 5 months ago, a guy had argued that a GOP structure should be 12 frames per GOP for PAL output, and 15 for NTSC output. DVD2SVCD where using 15 for both, and after some harm discussion with that guy he - the author - had changed the setting for PAL encoders (have a look at dvd2svcd´s readme file).

These M and N/M values are, actually, the GOP structure, so that M*N/M=number_of_frames_per_gop. 3/5 should be written 3*5=15, and 3/4 should be 3*4=12. It is because of this that our values of N/M are different:D

This GOP structure can also explain why bitrate viewer's plot is more smooth when using 3/4. With 12 frames/GOP, a second has almost 2 full GOPs for PAL (25 fps), for NTSC film (~24 fps) and for decombed hybrid NTSC (~24 fps). Then, BV can calculate the bitrate more accurately when using 3/4. If the GOP structure has 15 frames/GOP, whe will have, for example, for a PAL movie, the following structure

second #1 IBBPBBPBBPBBPBBIBBPBBPBBP
second #2 BBPBBIBBPBBPBBPBBPBBIBBPB
second #3 BPBBPBBPBBIBBPBBPBBPBBPBB

note that the second #3 will have only one I frame. Remember that the I frame is the frame where, ever, more bits are allocated. This pattern will make BitrateViewer to miscalculate the bitrate. It cannot calculate the GOP bitrate, which is actually the bitrate controled by the encoder.

Now... clap your hands :D

Sekatom
20th March 2002, 09:25
I have also noticed, that CCE does not respect bitrate low/high limits that are set. My problems are with low bitrate. When bitrate below 600-900 kbps last longer that 3 sec, standalone player (Pioneer) stops playing smoothly. I have been working on this problem, and I have found:
CCE CBR does not give us real contstant bitrate, but constant filling of VBV buffer.
Playing problem occuring on standalone players do not depend on real bitrate itself, but on VBV buffer. When low bitrate lasts for some time and then increases 2-3 times, VBV fuffer does not contain enough data and problems occur.

Setting 3/5 GOP in CCE is a new information for me - I'm gonna check if this really make CCE encoder respect set bitrate limitations.

RoopeT
20th March 2002, 10:26
This pattern will make BitrateViewer to miscalculate the bitrate. It cannot calculate the GOP bitrate, which is actually the bitrate controled by the encoder.

Regardless of how bitrate viewer calculates the bitrate and is it calculated right or wrong, if bitrate viewer claims I have a peak bitrate over 2800 kpbs (program stream with audio + video + subs) it won't play on my player. I checked some of my SVCDs, and the ones I know to play OK all had a bitrate peak less than 2700 kpbs.

So I have created working SVCDs with DVD2SVCD default GOP settings. All NTSC discs I've created are OK, and some of my PAL encedes are OK too, but the very same settings have also created a lot not working discs. I'll check if changing the GOP settings helps anything with a source I know to create too high bitrate peaks with the default DVD2SVCD settings tonight. By the way: source is Simpsons Season 1 DVD (interlaced 4:3 PAL). I've encoded about 10 episodes this far with quite a lot different settings, with very limited luck.

Mozart
20th March 2002, 13:10
@ RoopeT

pay attention that my last post was talking about my results and gerti's tests results. In both of them, as we had reported, the bitrate spikes have the same values for 3/5 and for 3/4. The only difference was the "smoothness" of the bitrate ploted by BV. I didn't said that BV was showing wrong spikes values, because these values are almost the same for both gop structures.

Anyway... I do support Juhan request for manual GOP configuration. Once this optional setting may help some people, why not to let it be done?;)

Juhan
20th March 2002, 13:21
My main test movie was "World is not enough" PAL version (2 h 3 min = 1 hour per disc, total 2 discs 800 Mb).

Settings:
1) Using CCE 2.50, min = 1000, max = 2300, avg ca 1600.
GOP 3/5/15 (15=gop header).
Image Quality Priority = 17, Anti Noise Filter = 2
Linear Quantizer = ON
Zigzag scanning = ON
Progressive Frame = ON
Upper Field First = ON
4-pass VBR encoding
2) Bicubic Resize 0.00, 0.75
3) NO deinterlacing

DVD2SVCD version is 1.0.7 build 4.

With these settings the whole movie was encoded perfectly. The quality was great and my player didn't crash. With GOP 3/4/12 the bitrate was out of control and my player crashed all the time.

Maybe GOP 3/5 only helps PAL encoding. Since with NTSC it is already set to 3/5.


@Mozart:

CCE has automatic I-frame insertion and not all GOPs are full closed GOPs. Launch ReMPEG 1.5.2 and open CCE encoded .MPV file. There you can see that some GOPs are shorter than the others.

Here is a little example from my test movie:

...
GOP 140: IBBPBBPBBPBBPBB
GOP 141: IBBPBBPBBPBBPBB
GOP 142: IBBPBBPBBPBBPBB
GOP 143: IBBPBBPBBPBB
GOP 144: IBBPBBPB
GOP 145: IBBPBBPBBPBBPBB
GOP 146: IBBPBBPBBPBBPBB
GOP 147: IBBPBBPBBPBBPBB
GOP 148: IBBPBBPBBPBBPBB
GOP 149: IBBPBBPBBPBB
GOP 150: IBBPBBPBBPBBPBB
GOP 151: IBBPBBPBBPBBPBB
...

As you can see not all GOPs are 15 frames long, some are shorter. And every GOP starts with I-frame. That is GOP's nature. It cannot start with P or B frame. Each time CCE inserts an I-frame, it starts a new GOP.

Now, clap your hands :)

Can you test GOP 3/5 with PAL movie ?

Sekatom
20th March 2002, 13:40
I've tried both PAL/25 and NTSC with pulldown and I cannot confirm, that setting 3/5 GOP versus 3/4 fixes CCE bitrate problems.
Of course, using 15 pictures/GOP you obtain "more smooth" bitrate plotting, but CCE 2.5 still does not respect bitrate limitations that are set.
I have used as a test first 2-3 chapters from "Aliens" which begins with some title screens on blackness. I have set mean 1708 in the range 900-2520, 300-2520 and 0-2520.
I each case the minimum bitrate was 280 kbps, max 2800.
These results were indicated both in CCE "Advanced settings" bitrate plot and BV. Of course exact values differ, but generally CCE does not respect bitrate limitations, thus it respects mean bitrate precisely.
Until now I use TMPGEnc to encode films, that make bitrate problems in CCE (generally films withs large parts of blackness on the screen). TMPGEnc has got "padding the low bitrate" switch, which works. TMPGEnc does not respect high bitrate limitation, but there is no problem for me. By the way, I have noticed better results using TMPGEnc CQ setting in comparison to 2-pass VBR.

Mozart
20th March 2002, 13:41
And every GOP starts with I-frame. That is GOP's nature. It cannot start with P or B frame. Each time CCE inserts an I-frame, it starts a new GOP.

he he... It seems that you have had misinterpreted my example ;)

If you see it carefully, you will see that each group of 15 frames starts with an I frame, and each group of 15 frames has only one I frame. Then, the GOP structute of my example is completely right. However, each second can have only 25 frames, for PAL movies. Since 25 is not a multiple of 15, for a static GOP structure of 15 frames, we will have some seconds with only one I frame. Did you got it?;)

maybe the following graphic is easier to understand:

|----- second #1 ---------|----- second #2 ---------|----- second #3 ---------|
IBBPBBPBBPBBPBB IBBPBBPBBPBBPBB IBBPBBPBBPBBPBB IBBPBBPBBPBBPBB IBBPBBPBBPBBPBB

And, of course, this is just an aproximation of the average behaviour. Since each I frame has the main information about a scene, each change of scene will be done by (mandatory) the creation of a new I frame, which is the creation of a new GOP also. If this change of scene occurrs at a given X frame, and this frame is not a multiple of 15, the last GOP before this chance of scene will be "truncated" (meanning that it will be less than 15 frames). Did you got it?

Now... clap your hands again :cool:

Juhan
20th March 2002, 13:52
@Mozart

Sorry, my fault. You typed "second #" but I automatically assumed "GOP".

I have to test it more. Why GOP 3/5 helps me but not the others ?

The best way is to try another movies but it takes days :( to get results.

Mozart
20th March 2002, 15:11
Originally posted by Juhan
Why GOP 3/5 helps me but not the others ?

hummm... lets think together...

lets suppose that you have a hipothetical movie of 75 frames, with scene changes at frame 52 and 66. With N/M=5, the second #3 will have only 2 I-frames (frames #52 and #66). With N/M=4, the same second will have 3 I-frames (#52, #64 and #66). The net bitrate of this second may be not so high, but you will have a fraction of second with a pretty high bitrate, because of the small gap between these I-frames. This may be the source of problems for your player.

The conclusion of this "gedankenexperiment": the probability of that we will have a high number of I frames into a given interval of time when using 3/4 is higher than when using 3/5. This will result in some sort of "too much I frames to decode into a small interval of time" problem. It may be impossible for some player to handle this issue.

Juhan
20th March 2002, 15:30
@Mozart

Yes, I agree with you! It seems that my player likes 3/5 more than 3/4.

Anyway adding GOP configuration option to DVD2SVCD helps people like me (Philips owners and maybe others too).

Sekatom
21st March 2002, 11:36
After reading this forum subjects I have decided yesterday to perform another test. I have encoded the first hour of "Lord of the Rings" with CCE 2.50 without patch (with logo on the screen) with settings: mean 1708, max 2520, min 300, GOP 3/5, VBR 2 passes. The results were: minimum bitrate 300, maximum 2520, mean 1710.
Thus, in the above example CCE encoder respected deadline values properly. Today I will repeat this test with patched 2.50 version. Maybe after patching CCE stops respecting max and min bitrate values??

Juhan
25th March 2002, 11:00
I did more tests and it seems that there is no bitrate problem after all with CCE. I used CCE's internal bitrate viewer to be sure about that. 'Bitrate Viewer' cannot be trusted. I have seen different graphs with a same file (after demuxing and muxing with different programs) :)

GOP 3/5 solved all my problems. Now my player plays all clips perfectly even if video bitrate=max 2520 kbits/s and audio=224 kbit/s (total max 2744 kbit/s).

HINT (how to produce better looking clips):
1) At first encode clip with CCE using for example 'One-Pass VBR + Create VAF file'.
2) Select 'Multi-Pass VBR' and click 'Advanced' button.
3) There you can make sure that the best quality result is created. Read the manual about settings. You can see the quality if you select Q graph (red areas are low quality, green is perfect, gray is standard). Lowering 'BIAS' value increases quality in complex parts by increasing bitrate (if bitrate is not max in that area). The main trick is to find 'bias' value which produces more green areas. If you lower it too much then the quality gets worse.
4) Now encode the clip with 'Multi-Pass VBR' using new settings. Note that you do not loose any time because VAF-file already exists and this pass is skipped now.

RoopeT
25th March 2002, 11:30
I did quite a lot more testing: Using 3/5 GOP didn't make CCE to respect maximum bitrate (according to bitrate viewer) in my case either. TMPGEnc CQ 70 (2400 - 1500 kpbs) and 2-pass VBR (2400-1500 kpbs) gave even higher peak bitrates (in the last GOP even over 10000 kpbs according to BV!). TMPGEnc CQ 60 finally gave me a file without any bitrate peaks, but it didn't play on my standalone!

OK, I then tried the default DVD2SVCD settings (max 2520, min 300, avgr 2250) and encoded one Simpsons episode with 3 subtitle streams. The peak bitrate was ~2800 kpbs (multiplexed program stream with audio @ 160 kpbs + 3 subs). However, BV gives the same bitrates for the stream without subtitles. This file also freezed the player when subs were on, but played ok when subtitles were turned off. So I ran submux again to add just one subtitle stream and it worked too!

Is there any other tool than bitrate viewer to check the encoded stream's bitrate? (preferably also reading the subtitle streams).
How much bitrate the subtitle streams actually take?

Zoltan
25th March 2002, 12:21
Hmmm. I was testing this issue using CCE all weekend and I found the following:

1., No freezes happen at any (well, I used max=2450) bitrate when no subs were ripped.

2., With svcd subs Philips player freezes even if encoding is cbr 2000 bps + subs + audio 160 = not more than 2200. By the way, anyone know if CCE max bitrate includes the bandwidth reserved for subs as well? Subs size is usually below 10 MB per CD so I do not think the bitrate cannot be above 30 kpbs so in my case 2000+30+160=2190, well below 2600 and that's CBR so not varying.

3., At the point of the freeze Bitrate Viewer shows that my bitrate is not too high (1800-1900). There are high peaks well above the given max, but not at that point. This is quite hard to find out, since the player displays wrong time code so you have to play the file with mplyer2.exe, since that's the only one that displays correct times... WinDVD displays longer, Philips displays shorter times.

4., GOPs sized 12 or 15 did not help either to me.

And now the interesting part:

5., Burning the same cue/bin onto CD-RW, CD-R or twice onto the same CD-RW media caused freezes at different points! So again, it is not a bitrate problem.

6., Freezing point have no 100% possibility. Playing from the beginning causes almost sure freeze, but playing from the predecessor chapter can result of a successful play.

7., Once a CD can freeze, it does not matter if subs are displayed or not. I think this is because tha mpeg-2 stream contains the subs muxed so the player needs the bitrate even if they're not displayed.

This above things mean to me that
1., The problem is not a bitrate/encoding/muxing issue since the same cd image can be OK or not depending on the media/burning, etc. phase.

2., The problem may be associated with the player's firmware (which is 7.22 so the latest stable for my model), the player's DVD drive's error handling capabilities, the media itself or the burning sw used.

So far I used the suggested method for burning (mount with Daemon tools and then CD copy with Nero). I will test cdrdao today.

I will further test other (gold) media. So far I only used blue ones.

Any comments?
Z

Zoltan
25th March 2002, 20:22
Further investigation:

- Burning with cdrdao did not help.
- Discovered that CCE project (CCE_Project_file.ecl) does not specify Closed GOPs. I thought that should be set for SVCDs. Will start a new thread for this.

Z