[libav-api] Setting ctx.thread_count drops frames, only for dnxhd

Erik Ackermann kurterikackermann at gmail.com
Tue Nov 14 03:08:22 CET 2017


Okay, I figured out it was a bug in my code. Was confusing the AVERROR_EOF
from av_read_frame with av_receive_frame, so wasn't flushing the decoder
buffer properly. I'm sure there must be some history as to why
av_read_packet was renamed av_read_frame, but the former name seems to make
more sense.

On Thu, Nov 9, 2017 at 7:25 PM, Erik Ackermann <kurterikackermann at gmail.com>
wrote:

> I wrote a decoder with the new send receive API, but when I set
> thread_count to >1 I do not get all my frames, and this happens only for
> dnxhd content (h264 and prores work for all thread_count values). I'm
> compiling against FFmpeg 3.4.
>
> Interestingly, the number of missing frames is always (thread_count - 1).
>
> Is there something special I need to do when setting thread_count, other
> than calling avcodec_receive_frame() until all streams return AVERROR_EOF?
>
> Using ffprobe -count_frames with various -threads and -thread_type all
> return the correct value, so I guess I am missing something dnxhd
> specifically requires.
>
> Thanks,
> Erik
>


More information about the libav-api mailing list