[FFmpeg-devel] [PATCH] ffmpeg.c: allow ffmpeg to output stats for each video stream

Michael Niedermayer michael at niedermayer.cc
Thu Jul 12 15:01:42 EEST 2018


On Wed, Jul 11, 2018 at 03:47:45PM -0700, Wang Cao wrote:
> >
> > This changes the printed values
> > ./ffmpeg -i ~/videos/matrixbench_mpeg2.mpg -qscale 2  -vframes 3 -an
> > test2.avi
> > frame=    3 fps=0.0 q=2.0 Lsize=      51kB time=00:00:00.12
> > bitrate=3495.7kbits/s speed=  12x
> > video:51kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
> > muxing overhead: 11.128063%
> > vs.
> > frame=    3 fps=0.0 q=2.0 Lsize=      57kB time=00:00:00.12
> > bitrate=3884.7kbits/s speed=11.2x
> > video:51kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
> > muxing overhead: 11.128063%
> > the file is the same
> 
> 
> Thanks for pointing this out! I have noticed the change in the stats but I
> think the change is correct. Before my patch, the bitrate calculation is
> based on total_size as in
> 
> >     oc = output_files[0]->ctx;
> >     total_size = avio_size(oc->pb);
> 
> If I understand this correctly, the size of whole file will be used to
> calculate the bitrate which considers probably header overhead.
> 
> I changed it to
> 
> > total_size = ost->data_size;
> 
> Therefore only the size of the stream under consideration will be used for
> calculation.
> 
> Please correct me if my understanding is wrong. Thanks!

Do i understand correctly that you suggest to remove the display of the
filesize and file bitrate ?
And in its place would be a display of a randomly picked stream bitrate ?


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

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180712/7f94bb32/attachment.sig>


More information about the ffmpeg-devel mailing list