View Single Post
Old 1st May 2014, 15:24   #332
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 3,009
Send a message via Skype™ to thinktink
I'm thinking the difference might be down to fb2k not updating their handler to the latest Opus code release. Or it could be I'm using the instant bitrate at time of decode and they're using the bitrate for the entire file (or the entire link in a "possibly chained stream", yuk.)


From opusfile.h:
PHP Code:
/**Computes the bitrate for a given link in a (possibly chained) Ogg Opus
    stream.
   The stream must be seekable to compute the bitrate.
   For unseekable streams, use op_bitrate_instant() to get periodic estimates.
   \param _of The \c OggOpusFile from which to retrieve the bitrate.
   \param _li The index of the link whose bitrate should be computed.
              USe a negative number to get the bitrate of the whole stream.
   \return The bitrate on success, or a negative value on error.
   \retval #OP_EINVAL The stream was only partially open, the stream was not
                       seekable, or \a _li was larger than the number of
                       links.*/
opus_int32 op_bitrate(const OggOpusFile *_of,int _liOP_ARG_NONNULL(1);

/**Compute the instantaneous bitrate, measured as the ratio of bits to playable
    samples decoded since a) the last call to op_bitrate_instant(), b) the last
    seek, or c) the start of playback, whichever was most recent.
   This will spike somewhat after a seek or at the start/end of a chain
    boundary, as pre-skip, pre-roll, and end-trimming causes samples to be
    decoded but not played.
   \param _of The \c OggOpusFile from which to retrieve the bitrate.
   \return The bitrate, in bits per second, or a negative value on error.
   \retval #OP_FALSE  No data has been decoded since any of the events
                       described above.
   \retval #OP_EINVAL The stream was only partially open.*/
opus_int32 op_bitrate_instant(OggOpusFile *_ofOP_ARG_NONNULL(1); 


Or I guess it's possible they're calculating it themselves instead of relying on the OpusFile API.
thinktink is offline   Reply With Quote