[FFmpeg-user] Get bitrate from stream

Moritz Barsnick barsnick at gmx.net
Fri Sep 21 17:00:39 EEST 2018


On Fri, Sep 21, 2018 at 14:47:27 +0200, Jesper Nilsson wrote:
> Commands Used:
> 
> ffprobe -select_streams v:0 -show_entries frame=pkt_size,pkt_duration_time
> <input.aac>

The output of that command changes significantly, if you actually
select the *audio* stream: "-select_streams a:0". (Your AAC file
probably has no 0:v.)

Since it's obviously a VBR audio track, you need to let ffmpeg, or in
this case ffprobe, probe all the way to the actual end of the stream,
to get the real value. As you probably realized.

I used this command:

$ ffprobe -select_streams a:0 -show_entries frame=pkt_pts_time,pkt_duration_time input.aac

to see all frames' actual timestamps.

I guess the "proper" length of the audio track - assuming no
discontinuous PTS - is the last frame's
pkt_pts_time + pkt_duration_time

Hope this helps,
Moritz


More information about the ffmpeg-user mailing list