[MEncoder-users] Frame Rate and file Size

Corey Hickey bugfood-ml at fatooh.org
Sat Feb 26 03:01:29 CET 2005


bruno agostini wrote:
> I have a strange problem I quite don't understand here. I want to make a
> divx with 2000 jpg. So I use the following command:
> 
> mencoder  mf://*.jpg -mf w=512:h=256:fps=30:type=jpg -ofps 30 -nosound
> -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=500 -o movie.avi
> 
> Then I get a 5 MB movie of 67 sec and I am happy with that. But I also
> want to make a version at 5 fps (it is a scientific movie so that I want
> to have a slow version to see details without having to settle the speed
> on the player everytime). So I use:
> 
> mencoder  mf://*.jpg -mf w=512:h=256:fps=5:type=jpg -ofps 5 -nosound
> -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=500 -o movie.avi
> 
> I have the same number of frame (2000), the same effective bitrate (I
> checked), only the fps (i.e. the movie is now 400 sec) has changed, but
> I get a 25 MB movie! But there is the same amount of information to
> encode in the second case isn't it? So why should the file size be
> different?
>  
> thanks for your help!
> 

I haven't personally tested this but I'm pretty sure I know the answer
to your question.

Vbitrate is the number of kilobits per second of video. By reducing the
framerate to 1/6 for your second video, you increase the length 6 times.
Lavc is giving 500 kilobits to each second, and since the second video
is 6 times longer it get 6 times as much data as the first.


Actually, you may notice that your second video (25 MB) is only 5 times
as big as the first (5MB). There's two probable reasons for this:

1. You're only using one pass, so the actual bitrate used is a
best-effort approximation of the bitrate you requested.

2. Since there are fewer frames per second in your second video, the
number of kilobits per frame is much higher.
first video:  500 kilobits / 30 frames =  16.7 kilobits per frame
second video: 500 kilobits /  6 frames = 100.0 kilobits per frame
That's a lot more data per frame. If lavc simply doesn't need that much
data, it won't use it.


If you want your second video to be smaller, reduce vbitrate.
500 / 6 = 83, so try using vbitrate=83. Also, you'll probably get more
accurate results using two-pass encoding.

-Corey




More information about the MEncoder-users mailing list