[Ffmpeg-devel] ffserver Documentation

Michel Bardiaux mbardiaux
Thu Mar 15 18:43:03 CET 2007


Piero Bugoni wrote:
>> However, In order to document correctly, I have had
>> to
>> turn to the ffmpeg program documentation, which is
>> also somewhat terse.
>>
>> So, now I have some questions regarding ffmepg.
>>
> 
> Regarding video bit rate, -sameq, -qmin, -qmax, and so
> forth, I have some questions. I understand these are
> typically ffmpeg-user type questions, but the answers
> I intend to include in documentation. 
> 
> So, here is one example:
> 
> This command: ./ffmpeg  -t 10  -y -r 29.97 -s 320x240
> -f video4linux2 -i /dev/video1  out.yuv
> 
> produced the following output:
> Input #0, video4linux2, from '/dev/video1':
>   Duration: N/A, bitrate: 27620 kb/s
>   Stream #0.0: Video: rawvideo, yuv420p, 320x240,
> 27620 kb/s, 29.97 fps(r)
> Output #0, rawvideo, to 'out.yuv':
>   Stream #0.0: Video: rawvideo, yuv420p, 320x240,
> q=2-31, 200 kb/s, 29.97 fps(c)
> Stream mapping:
>   Stream #0.0 -> #0.0
> Press [q] to stop encoding
> frame=  300 q=0.0 Lsize=   33750kB time=10.0
> bitrate=27620.3kbits/s
> video:33750kB audio:0kB global headers:0kB muxing
> overhead 0.000000%
> 
> The "Output #0" line indicates that for Stream #0.0
> that the bit rate is 200 kb/s (the default). But the
> status line indicates a bit rate of 27620.3kbits/s,
> and the output file was, not surprisingly, around 33M.

That line indicates the 'selected' bit rate. But since you chose 
rawvideo as output codec, the *only* possible bitrate is 
8x3/2x320x240x29.97.

Admittedly, this part of libavcodec is not very good. avcodec_string, 
which prepares such messages, is quite independent of the codec 
themselves. Some codecs complain or even abort when the bitrate is 
impossible, but others (like rawvideo) proceed silently.

> 
> Also, is there a relationship between "q" and bitrate?
> Does specifying one override the other?
> 
> The doc says that -sameq implies VBR. What does this
> mean?
> 
> I know that -sameq produces a bigger file, and better
> output than high "q" values. For instance, setting
> -qmin 32 and -qmax 32 produces a very small file,
> howerver, that is almost unviewable.

qmin/qmax with rawvideo!?

> 
> When grabbing raw video from a capture card, and
> outputting to a raw file, are "q" and bitrate
> meaningless? i.e. spew data to disk as fast as the
> card captures it, no encoding, just a simple recording
> operation?

Correct. But outputting without encoding is not necessarily faster than 
encoding. That will depend on the available disk bandwidth. And if you 
use too much of it, you might interfere with the capture card.

> 
> The end goal of all this is to help people tune the
> "q", and bitrate values to their bandwidth for best
> results with ffserver/ffmpeg. It is probably less
> important if you have tons of disk space, (-sameq is
> very convenient), but I think it is definitely
> critical for network usage. 
> 
> Thanks.
> 
> Piero.


-- 
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux at mediaxim.be

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/




More information about the ffmpeg-devel mailing list