[Ffmpeg-devel] using apiexample.c

Panagiotis Issaris takis.issaris
Wed Nov 15 14:51:11 CET 2006


Hi,

On Tue, 2006-11-14 at 12:14 +0100, Riccardo Zanella wrote:
> >> I'm using apiexample.c to learn how to encode video.
> >> I want to be able to set the bitrate, so i think I have to modify
> >> this line:
> >>
> >> c->bit_rate = 400000;
> >>
> >> where c is AVCodecContext*.
> >>
> >> But it seems it doesn't work: the bitrate of the output stream isn't
> >> affected by the modification.
> > 
> > How do you know that? What does ffmpeg -i say about your output file?
> 
> If i compile and run apiexample.c with:
> 
> c->bit_rate = 400000;
> 
>[...]
> Linux)
> Input #0, mpegvideo, from 'test.mpg':
>    Duration: 00:00:00.0, start: 0.000000, bitrate: -2147483 kb/s
>    Stream #0.0: Video: mpeg1video, yuv420p, 352x288, 104857 kb/s, 25.00 
> fps(r)
> Must supply at least one output file

Have a look at the output size of the file. On my system modifying the
c->bit_rate does change the resulting file size (and video quality) as
expected. So, I'd suspect the meta-info is wrong or missing.

With friendly regards,
Takis





More information about the ffmpeg-devel mailing list