Problem setting MKV filesize with 2-pass MPEG-4 AVC

Started by nv22nv, June 12, 2012, 05:03:14 PM

Previous topic - Next topic

nv22nv

I encountered the following problem when encoding a number of different source files (different formats) to MPEG-4 AVC with MKV as the container format. I'm using avidemux 2.5.4 on Ubuntu 10.04.

Here's my problem: Although I can set the filesize correctly, the output file will be significantly larger than that (yes, I thought about the size of the audio track). Here's an example: I set my preferences so that the video size of the output file shall be 5390 MB. With my audio file (AC3) having a size of less than 500 MB, the resulting file shouldn't be larger than 6000 MB, at least not a lot (don't know about the overhead of the MKV container). When the second pass of the encoding was at 13%, the output file already had a size of about 4 GB. The encoder was working with an average bitrate of more than 20,000 kb/s, which is way too high. Perhaps the head of the log file can be helpful to find track of the problem:

#options: 1920x816 fps=25/23976 timebase=23976/25 cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0 me=dia subme=2 psy=1 psy_rd=0,00:0,00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 constrained_intra=0 bframes=5 b_pyramid=1 b_adapt=1 b_bias=0 direct=1 weightb=1 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=4226 ratetol=1,0 qcomp=0,60 qpmin=10 qpmax=51 qpstep=4 ip_ratio=1,40 aq=1:1,00

bitrate=4226 seems like a sane value to me, but the encoder seemed to be working with a value way above that, at least from what I understand.

Can someone help me to get into this problem? Thanks.

Edit: Spelling

Jan Gruuthuse


nv22nv

Thanks for answering, Jan Gruuthuse.

I'm not sure if I understood you right. The linked article seems to be a general instruction on encoding with x264. The way I see it, I already know most of what can be found in there and don't want to read all that. If you wanted to bring my attention to an obvious mistake I did or the answer is somewhere hidden in the documentation, please bear with me and give me a hint.

Jan Gruuthuse

QuoteIf you wanted to bring my attention to an obvious mistake I did
I would not know if you made a mistake.
Quoteor the answer is somewhere hidden in the documentation, please bear with me and give me a hint.
I don't have an answer, sorry.


nv22nv

While I was unable to solve the problem itself, I am now successfully using 1-Pass (average quality quantizer). Not what I wanted at first, but it's a good alternative to me.