[FFmpeg-user] FFmpeg audio frame count/nb_samples misunderstanding?

klongwood3 klongwood3 at gatech.edu
Mon Dec 9 20:52:39 EET 2019

I am streaming audio between two linux machines using ffmpeg and ffplay. The
sender is using rtsp to transport audio using a USB microphone over TCP. The
receiver (listener) is receiving and playing the audio received using



Using /‘ashowinfo’/, I am able to see a line containing various information
for each input audio frame. The option /nostats/ is used to avoid other
stats interleaved within the log output. “n” denotes the (sequential) number
of the input frame, starting from 0. The receiver and sender are both using
the /-af/ option flag to see the frame counts. However when the stream ends,
the audio frame numbers are completely off as shown below. I have searched
before, but have not seen any specific or technical algorithm that ffmpeg
uses to justify how frame counts are defined. Also I am not sure why my
sender with the microphone audio has various nb_sample sizes with each frame
increment? I have noticed that the audio streamed from rtsp is always
received as having each frame with "nb_sample" of 1024. I have tried adding
the /frame_size/ option but with no change in consistent number of samples
per frame input for the sender. The aim is to have a consist method to
correlate where the sender and receiver are at once the audio stream has
been stopped. 

Below are the log files outputted for each command with their respective

Sending log:

Receiving log:

Sent from: http://www.ffmpeg-archive.org/

More information about the ffmpeg-user mailing list