<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hello,<br><br>I know it is using the PTS of the frame to seek to frames. <br>I
want to perform a 'Step Forwards/Backwards' operation in my player, but
the problem is that the seeking to frames are not always working as I
expected.<br><br> int64_t time_stamp = 0;<br> time_stamp = current_pts - frame_span; // frame_span is calculated by avg_frame_rate, and in stream time base<br> search_flag = AVSEEK_FLAG_BACKWARD;<br> int ok = av_seek_frame(format_ctx, video_stream, times_tamp, search_flag);<br><br>The result would sometimes either jump to the current key frame or several key frames earlier. What should I do to fix it?<br>By the way, is there any convenient way to know the index of the frame, which is now playing?<br><br>Best Regards.</div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>