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

Added a way to access frame texture #70

Merged
merged 2 commits into from
Aug 5, 2024
Merged

Conversation

mycrl
Copy link
Collaborator

@mycrl mycrl commented Aug 4, 2024

First of all, I found that it is currently impossible to scale the frame and convert the color space, which makes it difficult to use in some projects. For example, I currently need to obtain NV12 textures, and I want to scale the frame directly because the size I need is not necessarily the size of the screen, it will normally be smaller.

If you are on Windows, if you want to properly utilize hardware acceleration, and your project also uses the D3D interface at the bottom, then using Video Processor MFT is a very good choice.

If you want to handle the conversion process more efficiently and avoid frequent memory copy operations between the CPU and GPU, getting the texture directly from the frame is a better way. I can directly pass the texture into IMFTransform.

I think Video Processor MFT is a better way to implement frame conversion in the current project. Have you considered integrating this part into the current project?

@NiiightmareXD
Copy link
Owner

Looks good, thanks for contributing 😊.

@NiiightmareXD NiiightmareXD merged commit fa261c7 into NiiightmareXD:main Aug 5, 2024
@NiiightmareXD
Copy link
Owner

Also, I will check out Video Processor MFT, thanks for suggesting that.

@mycrl
Copy link
Collaborator Author

mycrl commented Aug 8, 2024

Also, I will check out Video Processor MFT, thanks for suggesting that.

@NiiightmareXD I tried using Video Processor MFT for conversion and scaling, but it was very cumbersome to use, such as supporting hardware acceleration or asynchronous processing, which is very troublesome in rust. I found a newer API that might be more suitable, namely ID3D11VideoProcessor, which at least does not need to worry too much about hardware acceleration, and the API seems to be simpler.

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

Successfully merging this pull request may close these issues.

2 participants