in some files, av_read_frame do not return AVERROR_EOF on end of file. in the part of ffmpeg , (line 2577) ..decode_thread main loop ret = av_read_frame(ic, pkt) if(ret<0) { printf("error or eof\n"); ... } .. How to workaroud this behavior? Thanks Zdenek