microsoft / microsoft/Windows-classic-samples

How to Get rotated image from camera with media foundation

Open
#251 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
5.7k
Forks
3.3k
PR merge metrics
No merged PRs in 30d

Description

i use the MF_MT_VIDEO_ROTATION attribute,but it does not take effect. The process is as follows:
1、hr = m_pReader->GetNativeMediaType(
(DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM,
i,
&pType
);
2、hr = pType->SetUINT32(MF_MT_VIDEO_ROTATION, MFVideoRotationFormat_90);
3、hr = m_pReader->SetCurrentMediaType(
(DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM,
NULL,
pType
);
4、hr = m_pReader->ReadSample(
(DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM,
0,
NULL,
NULL,
NULL,
NULL
);

What's the problem?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MF_SOURCE_READER_FIRST_VIDEO_STREAM sequence using GetNativeMediaType, SetCurrentMediaType, and ReadSample. Check the Media Foundation requirements for MF_MT_VIDEO_ROTATION and determine why the requested rotation is not reflected in the camera output. Done means the sample produces the expected 90-degree rotation and the working sequence is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
audio-video-rtc, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.