【发布时间】:2011-07-11 22:22:01
【问题描述】:
我需要在视频的特定间隔内提取帧(例如从 40 秒到 50 秒)。 在 c++ 中工作。 首先,我得到了我需要开始阅读的位置
static double t = 10 ;//time in seconds
int64_t timestamp = t * AV_TIME_BASE; //destination time
av_seek_frame( pFormatContext , -1 , timestamp + pFormatContext->start_time ,AVSEEK_FLAG_BACKWARD );
然后我使用 av_read_frame 来获取所有连续帧。 我的问题是我不知道什么时候停止。如何检查我是否达到了结束时间间隔(例如 50 秒)?
谢谢。
【问题讨论】: