Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg 根据时间获取视频帧 | FLYING的博客 #18

Open
yang-f opened this issue Feb 28, 2020 · 0 comments
Open

ffmpeg 根据时间获取视频帧 | FLYING的博客 #18

yang-f opened this issue Feb 28, 2020 · 0 comments

Comments

@yang-f
Copy link
Owner

yang-f commented Feb 28, 2020

https://yangf.vip/2017/07/08/ffmpeg-%E6%A0%B9%E6%8D%AE%E6%97%B6%E9%97%B4%E8%8E%B7%E5%8F%96%E8%A7%86%E9%A2%91%E5%B8%A7/

视频帧的排列顺序一般是I、B、B、P、B、B、P、B、B……I、B、B、P……如果时间戳对应的帧为P帧或者B帧是不能直接获取当前的视频帧的,所以我们的基本思路是:1,seek到前面最近的一个I帧;2,解码到离所给时间戳最近的视频帧,返回; 假设所给的时间戳单位为ms,我们需要将它转换为ffmpeg内部的时间戳:1int64_t fm_timestamp = input_timestamp/(av

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant