[Ffmpeg-devel] h263+: size of encoded frames after opening ffmpeg

Michael Niedermayer michaelni
Tue Jan 30 14:50:44 CET 2007


Hi

On Tue, Jan 30, 2007 at 02:21:19PM +0100, Martin wrote:
> Hi,
> 
> Martin wrote:
> > Hi,
> > 
> > Michael Niedermayer wrote:
> > 
> >>Hi
> >>
> >>On Fri, Jan 19, 2007 at 11:23:59AM +0100, Martin wrote:
> >>
> >>
> >>>Hi,
> >>>
> >>>Michael Niedermayer wrote:
> >>>
> >>>
> >>>>Hi
> >>>>
> >>>>On Wed, Jan 17, 2007 at 11:14:40AM +0100, Martin wrote:
> >>>>[...]
> >>>>
> >>>>
> >>>>
> >>>>>>>Even better, is there a
> >>>>>>>possibility to change the bitrate without closing and reopening ffmpeg?
> >>>>>>
> >>>>>>
> >>>>>>you can set the quality of frames which affects the bitrate,
> >>>>>>closing and reopening within the same stream is generally not allowed
> >>>>>>doing so means you are on your own
> >>>>>
> >>>>>Ok, how can I set the quality within the same stream without closing and
> >>>>>reopening? I tried to set the AVCodecContext.crf parameter but it
> >>>>>doesn't seem to have any effect on quality and size of outputted frames.
> >>>>>Is there another parameter which I can use?
> >>>>
> >>>>
> >>>>AVFrame.quality 
> >>>>and set CODEC_FLAG_QSCALE
> >>>
> >>>Thank you very much, that worked. How is the relationship between
> >>>quality and bitrate? Is there a formula which expresses it?
> >>
> >>
> >>besides encode at quality X and look at the bitrate, no but theres some
> >>approximation, and that is that quality and bitrate are approximatly
> >>inversly proportional so double the quality variable and bitrate should
> >>be approximately cut in half
> > 
> > 
> > what I measured didn't give this behaviour (double quality -> half bitrate):
> > I used a bitrate of 1280000 bits/sec in AVCodecContext. Measured Bitrate
> > with different qualities:
> > 
> > ## Qual Bitrate
> > 1) 600: 3012856
> > 2) 1200: 1002368
> > 3) 2400: 556024
> > 4) 4800: 419112
> > 
> > A function is inversely proportional if x*y = a, where a is some
> > constant. So the products of quality and bitrate are:
> > 
> > 1) 1807713600
> > 2) 1202841600
> > 3) 1334457600
> > 4) 2011737600
> > 
> > This is far from approximately constant. There must be some computation
> > that you are doing to get a bitrate from quality, right? I really need
> > to know how to compute it and appreciate any help on this!

to find the exact bitrate for a frame at quality X you have to encode the
frame at that quality

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070130/da39e5ea/attachment.pgp>



More information about the ffmpeg-devel mailing list