ffmpeg seek--ts

来源:互联网 发布:淘宝商品不合格违规了 编辑:程序博客网 时间:2024/06/06 03:07

read_timestamp返回pos--pos_limit间的视频帧的dts信息;

/**     * Get the next timestamp in stream[stream_index].time_base units.     * @return the timestamp or AV_NOPTS_VALUE if an error occurred     */    int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,                              int64_t *pos, int64_t pos_limit);

基于二分查找实现seek,外部接口

/** * Perform a binary search using av_index_search_timestamp() and * AVInputFormat.read_timestamp(). * * @param target_ts target timestamp in the time base of the given stream * @param stream_index stream number */int ff_seek_frame_binary(AVFormatContext *s, int stream_index,                         int64_t target_ts, int flags);


二分查找实现seek,内部接口

/** * Perform a binary search using read_timestamp(). * * @param target_ts target timestamp in the time base of the given stream * @param stream_index stream number */int64_t ff_gen_search(AVFormatContext *s, int stream_index,                      int64_t target_ts, int64_t pos_min,                      int64_t pos_max, int64_t pos_limit,                      int64_t ts_min, int64_t ts_max,                      int flags, int64_t *ts_ret,                      int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t ));

查找最后一帧的position & timestamp

int ff_find_last_ts(AVFormatContext *s, int stream_index,                      int64_t *ts, int64_t *pos,                     int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t ));


原创粉丝点击