[Libav-user] Number of video frames per packet

Venkateswaran.S venketeswaran2015 at gmail.com
Thu Apr 4 10:47:00 EEST 2019


Hi all,

I wants to know that number of frames(AVFrame) in video packet (AVPacket).
I have tested this with some sample .mp4 and .mkv file format and got to
know that each AVPacket contains one AVFrame. Is it fixed.?

while (avcodec_send_packet
<https://ffmpeg.org/doxygen/4.0/group__lavc__decoding.html#ga58bc4bf1e0ac59e27362597e467efff3>(dec_ctx,
pkt) >= 0)
{
//should i put another while loop here to decode frames in packet.?
ret = avcodec_receive_frame
<https://ffmpeg.org/doxygen/4.0/group__lavc__decoding.html#ga11e6542c4e66d3028668788a1a74217c>(dec_ctx,
frame);
if (ret == AVERROR
<https://ffmpeg.org/doxygen/4.0/group__lavu__error.html#gae4bb6f165973d09584e0ec0f335f69ca>(EAGAIN)
|| ret == AVERROR_EOF
<https://ffmpeg.org/doxygen/4.0/group__lavu__error.html#gab4faa0afdf35076914824200331defff>
)
return;
else if (ret < 0) {
fprintf(stderr, "Error during decoding\n");
exit(1);
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20190404/1498fa07/attachment.html>


More information about the Libav-user mailing list