[Mp4-tech] Number of bits encoded

Karsten Suehring ksuehring web.de
Fri Aug 24 15:14:41 EDT 2007


Hi Ashfiqua,
> 1. Is there any way to find out the number of encoded bits before
> performing the encoding? I mean how can I know that the encoded I frame
> will contain x bits, P frame will contain y bits etc.?

If you are using rate control, you can set the (average) target bit rate
for a sequence. The encoder will try to hit that rate.
If you are not using rate control, I would say it's impossible to
estimate the exact number of bits before encoding because this depends
to much on the used encoding algorithm and each single mode decision in it.
> 2. And if I want that each I and P frame will contain exactly 2 slices,
> how to do that?

In encoder.cfg set "SliceMode = 1"  and SliceArgument to half of
macroblocks in the picture.
> 3. After encoding, how can I know that this packet belongs to I, P or B
> frame?

There is no such concept like I, P or B frames in H.264. A frame can
consist of one or more I, P or B type slices. Each slice contains a
syntax element that specifies the slice type (called slice_type)
Best regards,
Karsten


More information about the Mp4-tech mailing list