AVFrame* frame = av_frame_alloc(); avcodec_receive_frame(codec_ctx, frame); Assuming that the operation succeeds, I found frame->format is always zero What's the format field used for? Only for outputs? And how can I get pix_fmt of the frame?