Comments (5)
Do you mean step to the next/previous 1 frame? It's still developing. But for timeline preview, accurate seeking to a given time is enough, via seek(msec, SeekFlag::FromStart)
see example https://github.com/wang-bin/mdk-examples/blob/master/Qt/qmdkplay.cpp#L23
from mdk-sdk.
Do you mean step to the next/previous 1 frame?
Yes exactly, next 1 frame works fine, but previous doesn't and it will be useful too. Also seek to arbitrary exact frame will be useful, so for example I can call
seek(1234, SeekFlag::FromStart | SeekFlag::Frame)
and then for example
seek(976, SeekFlag::FromStart | SeekFlag::Frame)
from mdk-sdk.
Do you mean step to the next/previous 1 frame?
Yes exactly, next 1 frame works fine, but previous doesn't and it will be useful too. Also seek to arbitrary exact frame will be useful, so for example I can call
seek(1234, SeekFlag::FromStart | SeekFlag::Frame)
and then for example
seek(976, SeekFlag::FromStart | SeekFlag::Frame)
If frame rate is known, seek forward a large number of frames and seek to by time are equivalent. If frame rate is unknown, it's impossible to fast seek by frame, you must decode frames 1 by 1(it's supported now) and which will be slow. So seeking to arbitrary exact frame is not useful.
from mdk-sdk.
If frame rate is known, seek forward a large number of frames and seek to by time are equivalent.
You're right, this seems to work correctly if I calculate the timestamp from frame and frame rate and seek to timestamp.
I'll close this issue, but still it would be nice for the user of the SDK if that happens internally when passing SeekFlag::Frame
.
Maybe something like this could be implemented in the SDK for SeekFlag::FromStart | SeekFlag::Frame
case, if frame rate is known
auto delta = targetFrame - currentFrame;
if (delta > 0 && delta < 5) {
seek(delta, SeekFlag::FromNow | SeekFlag::Frame);
} else {
double timestampMs = (targetFrame / codec.frame_rate) * 1000.0;
seek(timestampMs, SeekFlag::FromStart);
}
from mdk-sdk.
Try the latest build. Backward seeking works. the first parameter pos
can be -1, -2, -3 etc. frame rate must be known.
from mdk-sdk.
Related Issues (20)
- 由于找不到mdk.dll,无法继续执行代码 HOT 6
- 额外字幕的添加 HOT 4
- 在安卓上mdk::SetGlobalOption("JavaVM", QJniEnvironment::javaVM())是否是必须的? HOT 11
- linux arm64 执行./aplay 报错提示找不到 libpulse.so HOT 3
- 只有集显的window平台 setDecoders解码参数要怎么填好? HOT 1
- [feature request] Need a mdk::Player::getDecoder function HOT 11
- Thumbnail generation HOT 2
- 开启最快速度解码后音频严重滞后 HOT 6
- setLoop(-1); 有些电脑不生效 HOT 4
- android使用sync控制视频进度的时候,会不断间隔黑屏 HOT 6
- 国产aarch64架构的cpu和国产系统的, 怎么使用mdk-sdk? HOT 4
- 如何正确使用Vulkan作为渲染API HOT 18
- 是否提供播放进度变化positionchanged信号 HOT 1
- Crash on Debian 12 HOT 12
- avdevice://dshow:video=screen-capture-recorder 无画面 HOT 2
- sync控制视频进度的时候,音画不同步 HOT 7
- 单独渲染YUV数据,ID3D11Texture2D,LPDIRECT3DSURFACE9 HOT 4
- 如何设置AVFormatContext.video_codec_id = AV_CODEC_ID_MJPEG HOT 31
- Dead lock on mp4 playing HOT 3
- Question. I have a device that receives an rtsp stream and plays it through your library. Is it possible to stream this video to another device HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mdk-sdk.