Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use FFMPEG (command line Input) to convert my videos to a specific output format. The problem I am facing is when I try to pass a constant bit rate(700 kbps) to FFMPEG, the result is an output video with a different bit rate(say 1000 kbps). This phenomenon occurs invariably for all videos.Why is this happening? I need to maintain a constant bit rate. Can anyone help me out.

My FFMPEG version is 0.5

The command line parameter which I am passing to FFMPEG is,

-i {inputfile}
-b 700k -ab 64k
-vcodec libx264
-acodec libfaac -ac 2 -ar 44100
-y -s 320x240 
{outputfile}

EDIT:

I was able to force CBR with a fluctuation of +/- 3% when I used the following parameters.

 ffmpeg -i myfile.avi
 -b 4000k -minrate 4000k 
 -maxrate 4000k -bufsize 1835k   out.m2v

But when I used -maxrate and - minrate along with my parameter set I was not able to force CBR. My parameter set is as follows,

-i {inputfile}
-b 1200k -minrate 1200k 
 -maxrate 1200k -bufsize 1200k 
-ab 64k -vcodec libx264
-acodec libfaac -ac 2 -ar 44100
-y -s 320x240 
{outputfile}

Why is this happening?

share|improve this question

migrated from stackoverflow.com Jun 5 '12 at 17:33

This question came from our site for professional and enthusiast programmers.

1  
Don't forget that your audio bitrate is adding 64 kbps. –  LordNeckbeard Jun 1 '12 at 17:52
    
I thought the -b switch has been deprecated. –  Marco Jun 5 '12 at 17:54
    
@Marco well it's not deprecated, but it does have a different meaning than it used to: -b used to set video bit rate, but now it sets the overall bit rate (both video & audio). To set the video bitrate, you should more properly use -b:v (and -b:a instead of -ab). None of this will particularly help the questioner, though. –  evilsoup Jan 17 '13 at 15:36

1 Answer 1

To force a CBR you should use minrate, maxrate and bufsize (see here)

ffmpeg -i myfile.avi
       -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k
       out.m2v
share|improve this answer
    
thanks. let me try it out –  user735647 Jun 1 '12 at 7:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.