digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   KVCD: Encode with constant bitrate, load .avs file, change resolution? (http://www.digitalfaq.com/archives/encode/5587-kvcd-encode-constant.html)

Edlund 09-14-2003 03:45 PM

KVCD: Encode with constant bitrate, load .avs file, change resolution?
 
This is a posting that I think will be either "Another newbie post" or "Something we should think about".

Here is basically the discovery:
I did a few tests and the results were - When you encode with constant bitrate you can load a .avs file and change the resolution to whatever you want. The filesize remains the same. It doesn't depend on the resolution or the filters you are using. These settings affect only the encoding time.
My conclusion : For me personally the prediction times are over. I can now easily get a file with the desired filesize and great quality that can fit on one cd. What prevented me from posting this some time before was the fear that maybe you will not trust me or that you really must use constant quality. I know that the KVCD matrix is not the "rate control mode" that you are using but the quantize matrix. And this matrix can be used for templates using constant bitrate. I can't hold such big secret anymore and think that it will be for the good of all of us if what I found out is of any use.

P.S. Of course I am absolutely aware that maybe you have found this before and I'm not saying anything new and basically I am writing bullshit :lol:

Jellygoose 09-14-2003 03:57 PM

Hi Edlund...

Don't be afraid to write any discoveries you made, we're all thankful for new techniques that have to be tested and nobody will make fun of you here. :wink:
Of course constant bitrate is "constant" so that it will not change whatever resolution you pick. however higher resolutions also need a higher bitrate to look good. A clip with high action will probably look good with standard VCD resoluton 352x240/288 and a CBR of 1150kb/sec. However I doubt that the very same clip will look as good at 704x480/576 at 1150kb/sec since the higher resolution will require a higher bitrate too. Anyway I gotta admit I haven't tried it yet. 8)

jorel 09-14-2003 03:58 PM

Re: Something that I found out and looks revolutionary to me
 
Quote:

Originally Posted by Edlund
"Something we should think about".

Here is basically the discovery:
I did a few tests and the results were - When you encode with constant bitrate you can load a .avs file and change the resolution to whatever you want. The filesize remains the same. It doesn't depend on the resolution or the filters you are using. These settings affect only the encoding time.

8O
The filesize remains the same???

seems (is) impossible :!:
:?

Edlund 09-14-2003 04:05 PM

Yes, the filesize remains the same. The filters from avisynth don't affect it. Try yourself.

Edlund 09-14-2003 04:09 PM

Quote:

Originally Posted by Jellygoose
A clip with high action will probably look good with standard VCD resoluton 352x240/288 and a CBR of 1150kb/sec. However I doubt that the very same clip will look as good at 704x480/576 at 1150kb/sec since the higher resolution will require a higher bitrate too. Anyway I gotta admit I haven't tried it yet. 8)

Hmm, yes, you're right. That's why I wonder if there's a filter for this that canbe used and if more "sharpness" in the script will help solving this problem.

Dialhot 09-14-2003 04:12 PM

Re: Something that I found out and looks revolutionary to me
 
Quote:

Originally Posted by jorel
The filesize remains the same???

seems (is) impossible :!:
:?

That's the definition of Constant Bitrate Jorel !

With a CBR of 1150 Kb/s every second of you movie will take you EXACTLY 1150 bytes. Whatever you encode (big noisy image of 720*480 or small blurry image of 352*288) , you will use the same space. This is not a scoop :-).

The problem that Edlund didn't see yet, is that for it will use the same bitrate for a very slow motion scene (even a static picture !) or for a heavy action sequence. And then the problems will happen : while you lost A LOT of space in static part of the movie, you don't have enought for action ones. The last become blocky and pixelized in order to stay in the constant bitrate you have fixed.

That is why we use VBR : to adapt the amount of space used following the actoin of the scene.

Edlund, what you found is what it's used in VCD since a long time. And we all know the "quality" of VCD :-). SVCD drop the CBR encoding mode to have a better quality. And KVCD follow this path.

Don't be sad Edlund but the last part of you first post is unfortunally all true :-)

Edlund 09-14-2003 04:17 PM

I know that this is nothing new but the avisynth filters are changing the situation. With them you use the "lost space in static part of the movie" for increasing the quality.

Dialhot 09-14-2003 04:19 PM

Quote:

Originally Posted by Edlund
Hmm, yes, you're right. That's why I wonder if there's a filter for this that canbe used and if more "sharpness" in the script will help solving this problem.

Nothing you can do will avoid the problem appearing with short of birate : blocks.

The more you sharpen, the more birate you need (and you don't have as you are in CBR mode -> birate is constant), and the bigger the blocks are.

jorel 09-14-2003 04:22 PM

" (big noisy image of 720*480 or small blurry image of 352*288) "

ok Phil,now i "see"!
means...horrible?!?!?
:roll:

Edlund 09-14-2003 04:22 PM

Re: Something that I found out and looks revolutionary to me
 
Quote:

Originally Posted by Dialhot
Don't be sad Edlund but the last part of you first post is unfortunally all true :-)

Yes, I know that I'm not the first to think about this but the facts are : I put 90 minutes movie on one cd with super quality, used your avi script at 704x480. The only defects are the high motion scenes, their imperfection can be seen when you look at the TV from 50cm. (or if you have a very big screen:)

Dialhot 09-14-2003 04:24 PM

Quote:

Originally Posted by Edlund
I know that this is nothing new but the avisynth filters are changing the situation. With them you use the "lost space in static part of the movie" for increasing the quality.

Yes, you do that in VBR mode, not in CBR mode : the space you save in static scene, you will use it latter in moving ones.
Ibn CBR you can save anything : each second of movie eats the same piece of the cake. You can save a nuts to use it with the next piece. You have to eat all the piece even if you do not need it before to go to the next one.

Just try this : encode a movie in 480*480 using CQMatic and Calcumatic, as always. Let say that Calcumatic give you an average of 1000 Kb/s.
After the encoding, do the same test with a constant bitrate of 1000 Kbs.
Both mpg will be the exact same lenght but look at them... you will see immediatly why we use VBR and not CBR.

Dialhot 09-14-2003 04:30 PM

Re: Something that I found out and looks revolutionary to me
 
Quote:

Originally Posted by Edlund
The only defects are the high motion scenes, their imperfection can be seen when you look at the TV from 50cm. (or if you have a very big screen:)

No need of a bif screen, you can eve see them on your PC screen. It seems that you just not very sensitive to the blocks default and you are lucky in one way :-).

I wish to be so "blind" to these defaults. Unfortunally I'm not ;-) (perhaps you don't know but I used to be part of the quality tests of MPEG2 algorythm when it was still in the labs. So my eye is well trained to all its artifacts).

Dialhot 09-14-2003 04:34 PM

Quote:

Originally Posted by jorel
ok Phil,now i "see"!
means...horrible?!?!?
:roll:

Horrible, perhaps not (it depend on the movie. Can be everything from horrible to not so bad).

But as Edlund told, he does a movie in "super quality". Let say that with KVCD we are looking for "excellent" quality. ;-)

Edlund 09-14-2003 04:37 PM

Quote:

Originally Posted by Dialhot
Just try this : encode a movie in 480*480 using CQMatic and Calcumatic, as always. Let say that Calcumatic give you an average of 1000 Kb/s.
After the encoding, do the same test with a constant bitrate of 1000 Kbs.
Both mpg will be the exact same lenght but look at them... you will see immediatly why we use VBR and not CBR.

Yes, but I can encode in 720x576 with my method and only once. I don't need to care about the prediction methods and encode the movie once and it gets too big, or it gets too little and not so good quality. Not to mention all this hanging around this and other forums until my eyes get hurt. This drove me mad sometimes and I often thought "Why all this efforts when I can just sit on the not so comfortable chair in front of my pc for an hour or two and watch".

jorel 09-14-2003 04:39 PM

"Can be everything from horrible to not so bad"

:hihi: :rotf: :lol:

"not so bad" is a girl with wonderful body and ugly face!
"horrible" is a girl.....horrible..."everything"!


:lol:

totonho03 09-14-2003 04:46 PM

Quote:

"not so bad" is a girl with wonderful body and ugly face!
"horrible" is a girl.....horrible..."everything"!
:D

Trubufu? :mrgreen:

jorel 09-14-2003 04:50 PM

Quote:

Originally Posted by totonho03
Quote:

"not so bad" is a girl with wonderful body and ugly face!
"horrible" is a girl.....horrible..."everything"!
:D

Trubufu? :mrgreen:

yeah!
:lol: :lol: :rotf:

Dialhot 09-14-2003 04:50 PM

Quote:

Originally Posted by Edlund
Yes, but I can encode in 720x576 with my method and only once. I don't need to care about the prediction methods and encode the movie once and it gets too big, or it gets too little and not so good quality.

But what I want tell to you is that your "one shot 720*576" encoding has a quality far below the one you would obtain by making all the "file size prediction" process.

Time is not a priority there. Quality is. That is the difference between your point and the one I try to (friendly) stand for.

But the goal of all of this is to be happy with the result we have. If you are with a CBR encoded movie, just do it. And enjoy :-)

jorel 09-14-2003 04:53 PM

yes Edlund,
but try the kvcd way...you never back to standards!
:wink:

Edlund 09-14-2003 04:54 PM

Quote:

Originally Posted by Dialhot
Nothing you can do will avoid the problem appearing with short of birate : blocks.

The more you sharpen, the more birate you need (and you don't have as you are in CBR mode -> birate is constant), and the bigger the blocks are.

So I will have to do a test with a 2 hours movie and maybe I'll have to stick with CQ for bigger movies but use my method for movies up to 90 minutes.

Dialhot 09-14-2003 05:02 PM

Quote:

Originally Posted by Edlund
So I will have to do a test with a 2 hours movie and maybe I'll have to stick with CQ for bigger movies but use my method for movies up to 90 minutes.

For instance, yes.

kwag 09-14-2003 06:10 PM

Quote:

Originally Posted by jorel
"not so bad" is a girl with wonderful body and ugly face!
"horrible" is a girl.....horrible..."everything"!

:mrgreen: :rotf:
Ever heard of a WOW :D / Damm :x girl :?:
When you see them from behind, you say WOW :D :!:
When they turn their face towards you, you say DAMN :x

:hihi:

Edlund 09-15-2003 07:04 AM

Kwag, can you tell me what should I change to the original KVCD templates (for example KVCDx3 ntsc) if I use constant bitrate? I changed the GOP to 18 but I'm not sure that this is everything.

kwag 09-15-2003 11:03 AM

Quote:

Originally Posted by Edlund
Kwag, can you tell me what should I change to the original KVCD templates (for example KVCDx3 ntsc) if I use constant bitrate? I changed the GOP to 18 but I'm not sure that this is everything.

You should use the standard MPEG matrix if you are using constant bitrate.
The matrix ("Notch") is designed to work with variable bitrate, and take compression to it's advantage. So you'll get better results setting the standard matrix. Also, the GOP shouldn't be too long, and a value of 18 should be about the largest value for a CBR encode.
If you insist on using CBR, because you don't want to do prediction, then may I suggest something?
Instead of using 1,150Kbps, use 1,450Kbps MAX and 300Kbps MIN and use MVBR mode.
This will give you better quality that ANY CBR VCD, and still, I'm alost 100% sure that it will give you 80+ minutes on one CD-R. The trick is the low bitrate on MIN, which is way below the MAX.
So for 1 hour TV series, you can almost be sure that you'll always fit it on one CD, probably with a lot of space left. This way, you can use KVDC's "Notch" matrix, and a GOP of 24.
This settings are excelent for 352x240. If you are going to encode at higher resolutions, then the MAX bitrate of 1,450Kbps will not help you, and you'll get blocks on high action scenes.

Edit: For KVCDx3, you'll need AT LEAST 2,000Kbps MAX bitrate for a descent picture (Using the MA script ), and don't expect more than ~45 minutes per CD-R.


-kwag

Edlund 09-15-2003 11:15 AM

Thank you very much, Kwag

Dano 09-15-2003 02:38 PM

I use mpeg-1 CBR of ~2400kbps on my captures of TV episodes. Running prediction on a file that is always going to end up wih an average bitrate that is about 100kbps less than my max doesn't make sense. I know I could raise my max bitrate to say 3000 or 3500 so as to help in high acion scenes but, the MA script already takes care of this, it sort of does in filtering what an encoder does with vbr.

Jellygoose 09-15-2003 03:03 PM

Quote:

Originally Posted by Dano
[...] but, the MA script already takes care of this, it sort of does in filtering what an encoder does with vbr.

Sorry, but that is just not right.
MA filtering in our case only allows the encoder to use a lower bitrate for high action scenes, without a visible degredation in quality by blurring the picture. That's the purpose of the MA script, so it would make absolutely no sense to use a high CBR together with the MA script, as it will only degrade quality of high action scenes, and will not lead to a better compression for that scene! :roll:

Dano 09-15-2003 04:55 PM

The types of scifi tv shows that I capture have lots of action, explosions, and stroboscobic effects that come out looking terrible at less than DVD bitrates. The MA script helps a lot since I usually encode at 704x480. Perhaps I should analyze the captures individually and adjust my scripts accordingly, any tips would be welcome. My sources are hardware encoded mpeg-2 captures at between 8 to 10 Mbps CBR and each episode is encoded to one CD at about 42 to 44 minutes per disc. Thanks in advance.

Jellygoose 09-16-2003 10:44 AM

Well that's exactly what I said, if your play-time per media is at only 45 minutes, of course you're able to have a great quality EVEN in CBR encodes at 704x480.
Well now try the same captured clip in CQ mode, with prediction and everything and the MA routine, and you'll be amazed by the quality.
It's just logical thinking that it has to be better, because the high bitrates are used in those parts of the movie where they're needed... :wink:
That's my tip! 8)

Edlund 09-17-2003 04:28 AM

Quote:

Originally Posted by Jellygoose
MA filtering in our case only allows the encoder to use a lower bitrate for high action scenes, without a visible degredation in quality by blurring the picture.

This sounds good. 8)


All times are GMT -5. The time now is 05:38 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.