简体   繁体   中英

Resolution Issue when create .mp4 video file from camera streaming using SourceReader

I'm developing the Window Desktop Camera application using SourceReader technique.I have completed Video streaming and still capture.

Now, I'm working on to capturing an .mp4 video file from USB camera. I'm able to capture video file for the following resolutions: 640 x 480,1280 x 720 and 1920 X 1080. I have encountered an issue when changing the video resolution higher than 1920 x 1080 and call SetInputMediaType for the IMFSinkWriter object returns an HRESULT error code 0xc00d36b.

I used video subtype for encoding : MFVideoFormat_H264

Is there any other subtype available for encoding .mp4 file other than MFVideoFormat_H264?

Why cant i capturing an .mp4 file higher than FULL HD resolution? Am i missing anything to encode the video file? If yes, please provide me some guidelines to solve this issue.

Thanks in advance.

The likely bottleneck is the maximal resolution supported by video encoder. You are presumably using the encoder implicitly as a part of Sink Writer. Sink Writer on its own does not limit the resolution, but if encoder is unable to handle specific media type then encoding is impossible. Specifically, in Windows 7 resolution is (or might be) limited to 1920x1088.

Also, you lost one digit from the error code.

See also:

Roman gave a great answer, but just to add on the topic of other codecs - if you check MPEG-4 File Sink on MSDN you see that it mentions MJPG support as well (even though not clear if it's only available from Windows 8 or it simply has been improved in Windows 8), so you should be able to use MFVideoFormat_MJPG as well. I assume that should not have any size limitations, but of course the size of the resulting .mp4 file will grow drasticly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM