[FFmpeg-devel] [PATCH] parse videodatarate metadata in flv header

Michael Niedermayer michaelni
Thu Apr 3 14:55:37 CEST 2008


On Tue, Apr 01, 2008 at 11:44:38AM +0200, Arnoud Zwemmer wrote:
> Hi,
>
> I needed the FFmpeg summary (as shown below) to include the bitrate of 
> video streams I'm converting, which works for many formats, but not for 
> FLV, even if a correct 'videodatarate' metadata element is present in the 
> FLV header.
>
> This patch parses the videodatarate element (not sure if there's a reason 
> the element was not parsed before).
[...]

> Index: flvdec.c
> ===================================================================
> --- flvdec.c	(revision 12661)
> +++ flvdec.c	(working copy)
> @@ -197,6 +197,9 @@
>                      }
>                  }
>              }
> +            else if(!strcmp(key, "videodatarate") && vcodec && num_val >= 0) {
> +	         vcodec->bit_rate = (int)num_val * 1024;
> +            }

tabs are forbidden in ffmpeg svn
a >= 0 check is odd, bitrate cannot be 0
and what is the cast good for?

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

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080403/9bd2f563/attachment.pgp>



More information about the ffmpeg-devel mailing list