[Mp4-tech] Oversized MP4 files with ffmpeg and XviD

Olivier Amato oamato wanadoo.fr
Thu Mar 17 19:51:35 ESTEDT 2005


I'm getting a rate control issue when using ffmpeg to encode in 2-pass mode 
with XviD codec : the resulting bitrate is far higher than the target I'm 
indicating.
Here are the 2 command lines I'm using :
ffmpeg -i input_file.avi -vcodec xvid -b 1000 -g 125 -pass 1 -passlogfile 
log_file output_file.mp4
ffmpeg -i input_file.avi -vcodec xvid -b 1000 -g 125 -pass 2 -passlogfile 
log_file output_file.mp4
The log file is well produced and seems to be valid, but the resulting 
"output_file.mp4" has an average bitrate of 3655 kbps ( instead of 1000 
kbps ) !!??
When I try the same process with mpeg4 codec ( just replacing "-vcodec xvid" 
by "-vcodec mpeg4" ), the encoded file then has an average bitrate of 1005 
kbps as expected.
BTW, when I'm encoding in 1 pass only with Xvid, I don't have this rate 
control issue anymore. The following command line produces a resulting file 
with an average bitrate of 1018 kbps :
ffmpeg -i input_file.avi -vcodec xvid -b 1000 -g 125 output_file.mp4
Would somebody know how to solve this issue ( I've already posted this 
question to ffmpeg-user-list without feedback ... ) ?
Olivier


More information about the Mp4-tech mailing list