FFmpeg刷新编解码器的作用是什么?

FFmpeg刷新编解码器的作用是什么?,ffmpeg,Ffmpeg,我正在看FFmpeg的示例。每当解复用完成时,编码都会刷新编解码器: 解复用器: /* flush the decoders */ if (video_dec_ctx) decode_packet(video_dec_ctx, NULL); if (audio_dec_ctx) decode_packet(audio_dec_ctx, NULL); printf("Demuxing succeeded.\n"); 编

我正在看FFmpeg的示例。每当解复用完成时,编码都会刷新编解码器:

解复用器:

 /* flush the decoders */
    if (video_dec_ctx)
        decode_packet(video_dec_ctx, NULL);
    if (audio_dec_ctx)
        decode_packet(audio_dec_ctx, NULL);
    printf("Demuxing succeeded.\n");
编码器:

/* flush the encoder */
    encode(c, NULL, pkt, f);
我不明白这些例子为何会这样做。似乎将nullptr作为帧或数据包发送会进行刷新,但什么是刷新?在FFmpeg的上下文中刷新编解码器意味着什么