[Libav-user] Problem: Decoding HEVC file in C++ with FFmpeg missing one frame

Yifan Li li.yifan at hotmail.com
Mon Mar 21 08:30:27 EET 2022

Hello everyone,

i'm trying to decode my Hevc file in c++ with using FFmpeg. I used Hevc decoder and try to save the frames in ppm format. My Hevc file has 677 frames, which i checked with ffprobe in command window. But i any got 676 frames with my project. Also i have checked with other Hevc files, the results are same, i got always one frame less. And i assumed that, that could happy in the position, which at last phase i tried to flush the decoder. That means, that could be 3 frames in the decoder to be flush, but i got only 2 frames.

Can anybody help me, i attach my cpp file and add a link to the whole project files. What you need is to define test file path and output directory for saved images. Which are for me like that:


Thanks a lot!

Best regards,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20220321/d5078917/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: FFmpegDecoder.cpp
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20220321/d5078917/attachment.ksh>

More information about the Libav-user mailing list