audioffmpeglibavtranscodinglibfaac

libfaac: Queue input is backward in time


I am using libav along with libfaac to encode audio into aac. following is the logic:

frames[n]
i = 0 ;
while (there are frames)
{ 
  cur_frame =  frames[i];
  av_encode_audio(frame, ...., &frame_finished);
  if( frame_finished )
  {
     i++;
  }
}

but I am getting this annoying warning for few frames "queue input is backward in time !"


Solution

  • The answer is very simple, you are not supposed to pass the same frame again to the libfaac, so even if the frame_finished is not 1 you should still go to the next frame.

    it should be as follows:

    frames[n]
    i = 0 ;
    while (there are frames)
    { 
      cur_frame =  frames[i];
      av_encode_audio(frame, ...., &frame_finished);
      i++;
    }