目标:
1. 实现快进、快退。
###一些知识:
* ffmpeg中定义:
```
#define AV_TIME_BASE 1000000
#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
#define AVSEEK_FLAG_BACKWARD 1 //向后查找标志。
#define AVSEEK_FLAG_BYTE 2
#define AVSEEK_FLAG_ANY 4
#define AVSEEK_FLAG_FRAME 8
```
*函数av_rescale_q
```
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Returns a * bq / cq.
```
* 函数av_seek_frame
```
int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Seeks to the key frame at timestamp.
stream_index: If stream_index is -1, a default stream is selected, and timestamp is automatically converted from AV_TIME_BASE units to the stream specific time_base.
timestamp is measured in AVStream.time_base units or if there is no stream specified then in AV_TIME_BASE units.
flags: Set options regarding direction and seeking mode.
AVSEEK_FLAG_ANY: Seek to any frame, not just keyframes
AVSEEK_FLAG_BACKWARD: Seek backward
AVSEEK_FLAG_BYTE: Seeking based on position in bytes
```
没有合适的资源?快使用搜索试试~ 我知道了~
[8] ffmpeg + SDL2 实现的视频播放器「快进、快退」
共15个文件
h:6个
c:6个
makefile:1个
5星 · 超过95%的资源 需积分: 47 125 下载量 93 浏览量
2016-10-11
13:39:44
上传
评论 1
收藏 1.43MB ZIP 举报
温馨提示
博文:http://blog.csdn.net/i_scream_/article/details/52787222 中的代码。 测试平台:ubuntu16.04 64bit + ffmpeg3 + SDL2.
资源推荐
资源详情
资源评论
收起资源包目录
player_v1.7.zip (15个子文件)
video.h 5KB
wrap_base.c 3KB
Readme.md 1KB
player.h 6KB
player_v1.7.c 8KB
packet_queue.h 4KB
video.c 10KB
seek_about.c 2KB
seek_about.h 2KB
wrap_base.h 3KB
Makefile 586B
audio.h 5KB
packet_queue.c 4KB
naxienian.mp4 1.44MB
audio.c 8KB
共 15 条
- 1
i丶scream
- 粉丝: 61
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页