Skip to content
New issue

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

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

Already on GitHub? # to your account

单独渲染YUV数据,ID3D11Texture2D,LPDIRECT3DSURFACE9 #175

Closed
ArtistZhou opened this issue Jan 10, 2024 · 4 comments
Closed

单独渲染YUV数据,ID3D11Texture2D,LPDIRECT3DSURFACE9 #175

ArtistZhou opened this issue Jan 10, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@ArtistZhou
Copy link

目前我的了解,mdk只能播放有数据源的媒体
如果我有软解出来的YUV数据,D3D11硬解出来的ID3D11Texture2D,DXVA硬解出来的LPDIRECT3DSURFACE9
MDK有办法可以直接渲染吗

@wang-bin
Copy link
Owner

Player.enqueue(frame),软解数据可以用VideoFrame的接口构造个frame,硬解数据我要加几个接口

@ArtistZhou
Copy link
Author

期待下个版本能用上,主要是硬解数据,目前没有占用资源最低的办法,d3d11零拷贝渲染的命令,包括bpbuff和EGLStream
glfwplay.exe 支持吗 ,命令分别怎么写呢
image

@wang-bin
Copy link
Owner

d3d11渲染: glfwplay.exe -c:v D3D11 -d3d11 test.mp4

egl我默认优先使用eglstream,不支持的话用pbuf,也可以通过环境变量D3D11_GL=eglstreamD3D11_GL=eglpbuf指定用哪个,然后运行: glfwplay.exe -c:v D3D11 -es test.mp4

以上默认还是会有gpu拷贝,最新的包做了些优化避免拷贝以降低gpu使用率,需要解码器输出合适的纹理: glfwplay.exe -c:v D3D11:shader_resource=1 -d3d11 test.mp4glfwplay.exe -c:v D3D11:shader_resource=1 -es test.mp4。这些命令行解码和渲染的d3d11用不同的上下文,amd显卡可能显示有问题(驱动的问题),如果用相同的上下文就不会有问题,也是绝大多数软件的使用方式:glfwplay.exe -d3d11.device 1 -c:v D3D11:shader_resource=1 -d3d11 test.mp4

D3D11替换成MFT:d3d=11同理

@wang-bin wang-bin self-assigned this Jan 14, 2024
@wang-bin wang-bin added the enhancement New feature or request label Jan 14, 2024
@wang-bin
Copy link
Owner

最新包加了接口,我没测

mdkVideoBufferPool* pool{}; // can be reused for textures from the same producer

while (tex = ...) {
    player.enqueue(VideoFrame::from(&pool, DX11Resources{
        .resource = tex,
        .subResource = index,
    })//.setTimestamp(...)....
    );
}

mdkVideoBufferPoolFree(&pool);

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants