digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   HCenc: Average bitrate (http://www.digitalfaq.com/archives/encode/13509-hcenc-average-bitrate.html)

maurus 05-15-2005 08:14 PM

Average bitrate
 
Quote:

Originally Posted by kwag
Code:

      Select GetGadgetText(#AudioBitrate)
        Case "16" : audio = 16
        Case "24" : audio = 24
        Case "32" : audio = 32
        Case "56" : audio = 56
        Case "64" : audio = 64
        Case "96" : audio = 96
        Case "112" : audio = 112
        Case "128" : audio = 128
        Case "160" : audio = 160
        Case "192" : audio = 192
        Case "224" : audio = 224
        Case "256" : audio = 256
        Case "320" : audio = 320
        Case "384" : audio = 384
        Case "448" : audio = 448
      EndSelect
     
      audio = audio * Val(GetGadgetText(#Streams))
     

      Select GetGadgetText(#Media)
        Case  "24 Min. CD" : media = 245760
        Case  "74 Min. CD" : media = 757760
        Case  "80 Min. CD" : media = 819200
        Case  "90 Min. CD" : media = 921600
        Case  "99 Min. CD" : media = 1013760
        Case  " 4.70GB DVD-5"  : media = 4508876
        Case  " 8.50GB DVD-9"  : media = 8912896
        Case  " 9.40GB DVD-10" : media = 9856614
        Case  "12.24GB DVD-14" : media = 12834570
        Case  "17.00GB DVD-18" : media = 17825792
        Case  " 2.58GB DVD-RAM" : media = 2705326
        Case  " 4.80GB DVD-RAM" : media = 5033164
        Case  "Custom"
          media = Val(GetGadgetText(#Custom))
          media = media * 1024
        EndSelect

      If GetGadgetText(#Overhead) = "VCD/SVCD Mux Overhead"
        media = media - (10 * 1024)
      ElseIf GetGadgetText(#Overhead) = "DVD Mux Overhead"
        media = media - ((25 * Val(GetGadgetText(#VStreams))) * 1024)
      EndIf



And then:



Code:

      audio_size.f = ((audio / 8)  * totaltime )
      video_size.f = (media * quantity) - audio_size.f
      avg.f = (video_size.f / totaltime) * 8

-kwag

It's good this method for calculate the average bitrate for use in HC Enc in -b command line (HCBatch)?

I'm go for 2 movies KDVD (audio 192 kbps) in a DVD-5 4.7 GB.


Thanks.

-Maurus

kwag 05-15-2005 09:48 PM

Hi Maurus,

Actually, the latest code is now this:

Some code is not shown (like audio channels 2, 3 and 4 )
Code:

Select GetGadgetText(#AudioBitrate)
        Case "16" : audio = 16
        Case "24" : audio = 24
        Case "32" : audio = 32
        Case "56" : audio = 56
        Case "64" : audio = 64
        Case "96" : audio = 96
        Case "112" : audio = 112
        Case "128" : audio = 128
        Case "160" : audio = 160
        Case "192" : audio = 192
        Case "224" : audio = 224
        Case "256" : audio = 256
        Case "320" : audio = 320
        Case "384" : audio = 384
        Case "448" : audio = 448
        Case "Custom" : audio = Val(GetGadgetText(#ACustom) )
EndSelect

        audio = audio * Val(GetGadgetText(#Streams))
        audio2 = audio2 * Val(GetGadgetText(#Streams2))
        audio3 = audio3 * Val(GetGadgetText(#Streams3))
        audio4 = audio4 * Val(GetGadgetText(#Streams4))

        taudio = audio + audio2 + audio3 + audio4

Select GetGadgetText(#Media)
        Case  "24 Min. CD" : media = 245760
        Case  "74 Min. CD" : media = 757760
        Case  "80 Min. CD" : media = 819200
        Case  "90 Min. CD" : media = 921600
        Case  "99 Min. CD" : media = 1013760
        Case  " 4.70GB DVD-5"  : media = 4508876
        Case  " 8.50GB DVD-9"  : media = 8336179
        Case  " 9.40GB DVD-10" : media = 9856614
        Case  "12.24GB DVD-14" : media = 12834570
        Case  "17.00GB DVD-18" : media = 17825792
        Case  " 2.58GB DVD-RAM" : media = 2705326
        Case  " 4.80GB DVD-RAM" : media = 5033164
        Case  " 1.47GB Mini DVD-R" : media = 1541406
        Case  " 2.92GB Mini DVD-RAM" : media = 3061841
             
        Case  "Custom"
          media = Val(GetGadgetText(#Custom))
          media = media * 1024
EndSelect


So then:
Code:


      audio_size.f = ( ((taudio / 8) / 1.024)  * totaltime )
      video_size.f = (media * quantity) - audio_size.f
      avg.f = ((video_size.f / totaltime) * 8) * 1.024

Those are some code snips from the latest version of CalcuMatic.
If you use it, try it with any good 2-pass encoder, and you'll see that the encoded file size will match exactly the size calculated by CalcuMatic ;)

-kwag

maurus 05-16-2005 02:35 AM

Thanks, friend.


-Maurus

maurus 05-16-2005 08:02 AM

1) In your code: What is the quantity value?

It's the overhead? What it's the correct DVD overhead?


2) Totaltime is the time of movie in minutes?


Thanks.


-Maurus

Dialhot 05-16-2005 08:37 AM

Reading the formulas give an easy answer :
- quantity is the number of media you plan to fill (for instance it is 2 when you do 2CD KVCD).
- totaltime is the time in second (as bitrate is given in kbit/s)

For the overhead, it seems to me that the media values given in the code already take in account the overhead.

maurus 05-16-2005 08:59 AM

Yes, quantity seems to me the number of disks, but in the older code (that I previous posted) the Mux Overhead is:


Code:

If GetGadgetText(#Overhead) = "VCD/SVCD Mux Overhead"
        media = media - (10 * 1024)
      ElseIf GetGadgetText(#Overhead) = "DVD Mux Overhead"
        media = media - ((25 * Val(GetGadgetText(#VStreams))) * 1024)
      EndIf

It's correct?
In the new code is not the mux overhead...

Where is actually the mux overhead?

Dialhot 05-16-2005 10:05 AM

Ok. I did not see that you posted an "old" code.
Karl simply didn't paste all the code tiil the overhead function. But it is still there, and it does not change since the "old" code you gave.

(in plain english, the overhead for each media is 10 MB for SVCD and 25 MB per video stream in case of DVD).

maurus 05-16-2005 10:53 AM

Thanks for all.

-Maurus

maurus 05-16-2005 11:07 AM

Quote:

Originally Posted by kwag

Those are some code snips from the latest version of CalcuMatic.
If you use it, try it with any good 2-pass encoder, and you'll see that the encoded file size will match exactly the size calculated by CalcuMatic ;)
-kwag

Finally (issue 1024 vs. 1000) the average bitrate in CalcuMatic it's valid for HC Enc?

Thanks.

-Maurus

Prodater64 05-16-2005 12:23 PM

Quote:

Originally Posted by Dialhot
Ok. I did not see that you posted an "old" code.
Karl simply didn't paste all the code tiil the overhead function. But it is still there, and it does not change since the "old" code you gave.

(in plain english, the overhead for each media is 10 MB for SVCD and 25 MB per video stream in case of DVD).

Why for DVD it is usually set 180 Mb of overheat?

Dialhot 05-16-2005 01:39 PM

Quote:

Originally Posted by Prodater64
Why for DVD it is usually set 180 Mb of overheat?

Actually, there is no means to determine it (none that anyone ever published at least)

180 is the value that Vmesquita choosed when he did a little bitrate calculator called "KDVDCalc", and he probably used that again with Diko. Karl decided to use an other thing.

Honnestly, all depend on the complexity of the DVD and you can check this with DVDLabPro. The more stream you add the more is the overhead. So using a fixed value (like 180) is not the correct way.

Prodater64 05-16-2005 02:19 PM

Quote:

Originally Posted by Dialhot
Quote:

Originally Posted by Prodater64
Why for DVD it is usually set 180 Mb of overheat?

Then, what I must to set, "before" I have the streams?
What is a safe value for any encode, that I almost never oversize a DVD.


Dialhot 05-16-2005 02:31 PM

180 was (and is) a good value for that.

Boulder 05-16-2005 03:01 PM

I've used 4350MB as the size of the disc with overhead subtracted and have had every disc very close to a full one but not over. Two-three movies (or 6-8 episodes) per disc, one or two audio tracks and one subtitle track per movie/episode on almost all discs.

maurus 05-16-2005 06:16 PM

Code:

Case  " 4.70GB DVD-5"  : media = 4508876
1) For two movies, what values is for media?

2254438? half?


Code:

audio_size.f = ( ((taudio / 8) / 1.024)  * totaltime )
video_size.f = (media * quantity) - audio_size.f
avg.f = ((video_size.f / totaltime) * 8) * 1.024

I go for two movies in a dvd-r 4,7 GB with a audio band MP2 at 192 Kbps.
This movie has 103 minutos total time.

In CalcuMatic the average bitrate is 2599. I selected 2 audio streams with 192 and also 2 video streams.

With the code posted by Karl, I get 2880.

How is calculated this CalcuMatic average bitrate?


Thanks.


-Maurus

maurus 05-16-2005 06:16 PM

The Karl's code works ok for me with a only movie in a dvd-5.

Code:

Case  " 4.70GB DVD-5"  : media = 4508876
1) For two movies, what is the value for media?

2254438? exactly the half?


Code:

audio_size.f = ( ((taudio / 8) / 1.024)  * totaltime )
video_size.f = (media * quantity) - audio_size.f
avg.f = ((video_size.f / totaltime) * 8) * 1.024

I go for two movies in a dvd-r 4,7 GB with 1 audio band MP2 at 192 Kbps.
This movie has 103 minutes total time.

In CalcuMatic the average bitrate is 2599. I selected 2 audio streams with 192 and also 2 video streams.

With the code posted by Karl, I get 2880. I'm sure mistaked....

How is calculated this CalcuMatic (2599) average bitrate for 2 video streams?


Thanks.


-Maurus

kwag 05-16-2005 06:37 PM

Hi maurus,

Are you SURE you are using the latest version of CalcuMatic :?:
The latest is version 1.1.16 here: http://www.kvcd.net/downloads/CalcuMatic.exe

-kwag

Dialhot 05-16-2005 06:40 PM

Quote:

Originally Posted by maurus
1) For two movies, what is the value for media?

2254438? exactly the half?

If you have a movie that is 1h30 and the second 2h30, do you want to have each one that fit on only one half ? Or do you think it's better to have more space for the second one than the first ?

The media size do not change ! What change is the length of the video. For two movie the lenght is the sum of the two lengths. That's all !

Note: why don't you simply use Calcumatic to compute your bitrate ?

Quote:

How is calculated this CalcuMatic (2599) average bitrate for 2 video streams?
Simple ! You say you have a movie that is 103 minutes, but 2 video stream, then it calculates the bitrate for ONE video of 206 minutes. There is no trick.


Note: be carrefull. Two video streams with 2 audio streams means 4 audio streams in total ! Not two. You have 103 + 103 minutes of video and 103*2 + 103*2 minutes of audio.

If you want a DVD with TWO movies (so 2 video and 2 audio), then you must specify ONE audio stream.

maurus 05-17-2005 05:31 AM

I'm very confused.

I'm writing a script for encode KDVD with HC. I want my script calculate the average bitrate.

I want put TWO movies (with 1 audio 192 kbps MP2 each one) in a DVD-5 4.7 GB...

How I do this in CalcuMatic?

For calculate the average bitrate of my first movie, I put:

Minutes: 102 Seconds: 12

[Audio 1]: 192 and 2 audio streams (I put 2, because I thinking in my other movie)

Media: DVD-5 4,7 GB - 2 video streams (I put 2, because I thinking in my other movie)

It's correct?

How I must do this in Calcumatic?

And.. What are the correct code for calculate this averga bitrate manually for two movies with 1 audio each one?



-Maurus

Dialhot 05-17-2005 06:36 AM

Quote:

Originally Posted by maurus
I'm writing a script for encode KDVD with HC. I want my script calculate the average bitrate.

Okay.

Quote:

I want put TWO movies (with 1 audio 192 kbps MP2 each one) in a DVD-5 4.7 GB...

How I do this in CalcuMatic?
Simply add the length in minutes of the 2 movies and put this in calcumatic !

Quote:

(I put 2, because I thinking in my other movie)
No, your movie has ONE audio, not two.

Quote:

}Media: DVD-5 4,7 GB - 2 video streams (I put 2, because I thinking in my other movie)
If you have two movies, then there is 2 video streams, each one with one audio. So audio is still one.

Quote:

How I must do this in Calcumatic?
if you declare 2 video stream, that suppose that they do both the same time in minute (the time taht you indicate to calcumatic).
The best, in any case, is to simply add the lengths and process as if you have only one movie that has this length !

Quote:

And.. What are the correct code for calculate this averga bitrate manually for two movies with 1 audio each one?
Add... add... add.

Why do you bother to think with two movies if this confuse you ? 103 minutes x 2 or 206 minutes x 1 lead to the same result, doesn't it ?

The only diff is, if you want to use the same computing than calcumatic, in the overhead : for one movie calcumatic use 25 MB as overhead, and 50 for 2 movies. But this does not do a big difference in the final average.


All times are GMT -5. The time now is 02:24 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.