Hi,
it was like 2 years ago when the "MFCreateAVIMediaSink" function popped up. Back then my program needed Windows 7 support so it was out of the question. I tryed the method anyway but had no luck then. Today i am in a different situation as my program now has a minimum requirement of Windows 8.1, so i could make use of the function, so i think lets give it a try.
The video format i want to store in the AVI container is H264. An ordinary media type like the following is working flawless on the ASF and MPEG4 File Sink :
-
MF_MT_MAJOR_TYPE = MFMediaType_Video
MF_MT_SUBTYPE = MFVideoFormat_H264
MF_MT_AVG_BITRATE = 2000000
MF_MT_FRAME_RATE = 60, 1
MF_MT_FRAME_SIZE = 1920, 1080
MF_MT_INTERLACE_MODE = MFVideoInterlace_Progressive
MF_MT_MPEG2_PROFILE = eAVEncH264VProfile_High
MF_MT_PIXEL_ASPECT_RATIO = 1, 1
-
This type and nearly every other Media Type i got to work on other Sinks are rejected. Of course i read into the format and header structure of the AVI format, but i couldnt get it to work. At some point i thought maybe the Microsoft implementation uses DirectShow internally, so i tryed setting several additional attributes like described here under Format Mappings :
-
MF_MT_ALL_SAMPLES_INDEPENDENT = FALSE
MF_MT_FIXED_SIZE_SAMPLES = FALSE
MF_MT_SAMPLE_SIZE = 0
-
The values are exactly as they have to be according to the AM_MEDIA_TYPE documentation. I also tryed setting up a DirectShow Media Type and then use "MFInitMediaTypeFromAMMediaType". Well that the AVI Sink would use DirectShow internally was realy just a guess ...
I think it has something to do with passing the right header structure, maybe a VIDEOINFOHEADER ? I couldnt find any info at all about AVI in the Media Foundation documentation on all classes, attributes and functions. I also searched through everything in DirectShow but still cant get it to work.
Any help is appreciated
Regards
co0Kie