Hi All,

I have a program that is capable of playing multiple video streams at
the same time. Each video stream exist in a separate thread.

I have noticed that I get a lot of this error:

[h264 @ 0x9ca59f0]non-existing PPS referenced
    Last message repeated 3 times
[h264 @ 0x9ca59f0]number of reference frames exceeds max (probably
corrupt input), discarding one
    Last message repeated 11 times
[h264 @ 0x9ca59f0]non-existing PPS referenced

whenever I try to read multiple h264 streams in different threads in
my program. This error seems to pop up with every av_read_frame call
that I make when using multiple streams in multiple threads. It seems
that both videos are playing fine, but I am wondering if I should be
concerned about this error?

When I try playing just one stream, I only see the error popup in the
beginning and never again afterward. So I am wondering if maybe there
is something with the av_read_frame call that I have to be careful
about when playing back multiple streams at the same time?

Here is a simplified version of my decode function that I call each
frame for each thread (video stream):

AVPacket packet;
if (av_read_frame(formatContext, &packet) >= 0)
{
  if (formatContext->streams[packet.stream_index]->codec == codecContext)
  {
    int finished(0);
    avcodec_decode_video(codecContext, codecFrame, &finished,
packet.data, packet.size);
    if (finished)
    {
      sws_scale(scaleContext, codecFrame->data, codecFrame->linesize,
0, codecContext->height, destFrame->data, destFrame->linesize);
    }
  }
  av_free_packet(&packet);
}

Do I need to put a mutex around any of these functions to make ffmpeg
thread happy? Or is there something else that I am missing?
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to