[FFmpeg-user] Get bitrate from stream

Jesper Nilsson jesperpoppenilsson at gmail.com
Fri Sep 21 15:47:27 EEST 2018


Hello,
i have been trying to extract the bitrate of a stream for a proxy. This
proxy is to set a correct duration and position for a QMediaPlayer. When i
run the ffprobe command on the proxy for a specific song, it returns 290
kbit/s. This results in a faulty duration of 52 minutes, where the actual
value is 47 minutes. Is this possible to work around this, i know that it
says "Estimating duration from bitrate, this may be inaccurate" but when i
check the actual bitrate, its 320. This is a too large difference and wont
be accepted. I use VLC mediaplayers information to extraxt the correct
bitrate.

Commands Used:

ffprobe -select_streams v:0 -show_entries frame=pkt_size,pkt_duration_time
<input.aac>

Returns:
ffprobe version n4.0.2 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 8.1.1 (GCC) 20180531
  configuration: --prefix=/usr --disable-debug --disable-static
--disable-stripping --enable-avresample --enable-fontconfig --enable-gmp
--enable-gnutls --enable-gpl --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype
--enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack
--enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb
--enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus
--enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh
--enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis
--enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvenc
--enable-omx --enable-shared --enable-version3
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
[aac @ 0x55e660b0b640] Estimating duration from bitrate, this may be
inaccurate
Input #0, aac, from
'<input.aac>':

  Duration: 00:52:13.42, bitrate: 290 kb/s
    Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 291 kb/s

Kind regards, Jesper


More information about the ffmpeg-user mailing list