Quantcast
Channel: Media Foundation Development for Windows Desktop forum
Viewing all 1079 articles
Browse latest View live

Video Processor MFT missing


RLE video codec not working in Windows 2012 in native AVI API.

$
0
0

I have been using the native AVI API to create AVI videos on XP, 2003, 2008, and Windows 7 using the MRLE codec for years. The same exact software running on 2012 creates a video with every frame being exactly identical to the first frame. Is there a fix for this?

I found some reference code on another site as well describing this problem on stack over flow: is-it-possible-to-encode-using-the-mrle-codec-on-video-for-windows-under-windows

Doc error for MFCreateAVIMediaSink & MFCreateWAVEMediaSink

$
0
0

Despite what the docs for MFCreateAVIMediaSink& MFCreateWAVEMediaSink say, they are NOT exported from MF.dll, but instead from MFSRCSNK.dll.  Similarly, they aren't in mf.lib, but MFSRCSNK.lib.  On the plus side, the include file listed is correct.

It seems odd to export them from that file, since those 2 are almost the only exports from that DLL, but it's been that way since 8.1.

multichannel support for AAC encoder

$
0
0

Hi,

I'm writing a program using Windows Media Foundation AAC encoder to encode audio. According to documentation here https://msdn.microsoft.com/en-us/library/windows/desktop/dd742785(v=vs.85).aspx 6 channels is supported.

But in my program when I set it to 6, I'll get a MF_E_INVALIDMEIDATYPE error.

Below is my code

CLSID* pCLSIDs = NULL;// Pointer to an array of CLISDs.
UINT32 nCount = 0;
MFT_REGISTER_TYPE_INFO encoderInfo;
encoderInfo.guidMajorType = MFMediaType_Audio; 
encoderInfo.guidSubtype = MFAudioFormat_AAC;// AAC Encoder class id is not exposed, so we have to enumerate     

HRESULT hr = fpMFTEnum(MFT_CATEGORY_AUDIO_ENCODER, 0, NULL, &encoderInfo, NULL, &pCLSIDs, &nCount);
ciEncoder.CreateObject(pCLSIDs[0], IID_IMFTransform);
LComObject<IMFMediaType> ciInputType;  // Input media type of the encoder
hr = fpMFCreateMediaType((IMFMediaType**)(ciInputType.GetAssignablePtrRef()));
hr = ciInputType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio);
hr = ciInputType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_PCM);
hr = ciInputType->SetUINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 16); // must be 16
hr = ciInputType->SetUINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, Samplerate);
hr = ciInputType->SetUINT32(MF_MT_AUDIO_NUM_CHANNELS, Channels); //Must be 1 (mono)or 2 (stereo), or 6 (5.1).
hr = ciEncoder->SetInputType(0, ciInputType.get(), 0);      if (FAILED(hr)) {
   LDEBUG("Failed to set encoder input meida type"); 
   break;     
}

I've removed all error handling code.

ciEncoder->SetInputType will fail if Channels == 6, when Channels == 1 or 2, SetInputType succeeds. It happens on both 32 and 64 bit Win7 Professional.

Thanks for your help


Sequencer Source with file sink

$
0
0

Does the Sequencer Source work with a file sink?

A session with 2 non-contiguous segments raised an MEError event after the first segment.  The first segment was written to the file, but silence before its start time (MF_TOPOLOGY_PROJECTSTART) was not written, and no end of presentation event occurred after the error.

I suppose the question is does the sequencer source insert silent samples between segments...?

Are work items from the Timer Queue ( MFScheduleWorkItem ) and Long-Function Queue are serialized in any way with the Standard Queue ?

$
0
0

Hi,

are work items serialized between the Timer, Long-Function and Standard Queue ? I did a lot of tests and it seems so, as they never interfere with each other. When i put a scheduled work item on the Timer Queue, the callers callback always gets invoked while there is no dispatched work item from the Standard Queue for example.

But to make it 100 % safe i build a timer class that implements an IMFAsyncCallback and puts a wait item on the Timer Queue. On the callers callback i then can put the "real work item" onto the Standard Queue. But if the Timer Queue would be serialized with the Standard Queue ( which seems it is ) then i wouldnt need a timer class and can omit that step.

Regards

co0Kie


SetOutputType failed because of resolution

$
0
0

Hi,

I'm using H.264 encoder MFT to do video encoding in my program. Everything works correctly until I found a file on which the H.264 encoder couldn't set output type successfully.

The code I used to set up encoder is here

ciEncoder.CreateObject(pCLSIDs[0], IID_IMFTransform);
// H.264 Encoder MFT needs to set output first 
LComObject<IMFMediaType> ciOutputType;  // Output media type of the encoder
hr = fpMFCreateMediaType((IMFMediaType**)(ciOutputType.GetAssignablePtrRef()));
hr = ciOutputType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video);
hr = ciOutputType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_H264);
hr = ciOutputType->SetUINT32(MF_MT_AVG_BITRATE, 768 * 1000);
hr = ciOutputType->SetUINT32(MF_MT_INTERLACE_MODE, 2);
hr = ciOutputType->SetUINT32(MF_MT_MPEG2_PROFILE, eAVEncH264VProfile_Base);
hr = MFSetAttributeRatio(ciOutputType.get(), MF_MT_FRAME_RATE, 10, 1);
hr = MFSetAttributeSize(ciOutputType.get(), MF_MT_FRAME_SIZE, vf.iWidth, vf.iHeight);
hr = MFSetAttributeRatio(ciOutputType.get(), MF_MT_PIXEL_ASPECT_RATIO, 1, 1);
hr = ciEncoder->SetOutputType(0, ciOutputType.get(), 0);

The input video (an swf video) resolution is 76x12 and with above code SetOutputType returns MF_E_INVALIDMEDIATYPE.

If I keep width 76 but change height to 70 for example, then SetOutputType can succeed. I also tried other values like 24, 38 but both failed.

Could anyone help to check this?

Thanks


MediaPlayer Playlist

$
0
0

Hi,

I have an older VB 2010 project, a sort of media manger what imports and renames my pictures and videos into structured file folders and allows to play a slide show and videos.

This was working for years, but now in Windows 10 preview the Media Player does no execute the entire playlist, means it plays the first video and then stops. I can push the play button and it plays the next video, but not automatically.

Actually I have rewritten the application in Visual Studio 2015 RC with VB express 2015 (Net framework 4.5.2) using the WMPLib and encounter the same problem.

Perhaps I need to abandonee the playlist and play each video separately by open and close the player.

Any other suggestions is welcome and appreciated.

PrivateSubcreatePlaylist(ByValselfile()AsString) \\\(selFile() = selected videos as string array)

DimplayAsWMPLib.IWMPPlaylist= AxMP.newPlaylist("PL","")

Try

ForEachitemInselfile

IfFile.Exists(item)Then

play.insertItem((i), AxMP.newMedia(item))

EndIf

Next

IfMy.Settings.setStartShow = TrueThen

AxMP.currentPlaylist = play

AxMP.Ctlcontrols.play()

EndIf

CatchexAsIOException

MsgBox(ex.Message)

EndTry

EndSub


How to use hardware H.264 encoder?

$
0
0

Hi,

I'm writing a program using H.264 encoder MFT to do video encoding.

The way I'm using to select/create the encoder is like:

MFT_REGISTER_TYPE_INFO encoderInfo;
encoderInfo.guidMajorType = MFMediaType_Video;
encoderInfo.guidSubtype = MFVideoFormat_H264;
// H.264 Encoder class id is not exposed, so we have to enumerate
HRESULT hr = MFTEnum(MFT_CATEGORY_VIDEO_ENCODER, 0, NULL, &encoderInfo, NULL, &pCLSIDs, &nCount);
if (nCount == 0) {
   break;
}
//Create H.264 Encoder MFT instance
ciEncoder.CreateObject(pCLSIDs[0], IID_IMFTransform);

Now on my machine the nCount will be set to 1 after MFTEnum is called. I just want to know, if there's a certified hardware encoder available on my machine, will nCount be set to 2? and then I'll be able to select the one I want?

Another question is, I'm using the synchronous processing mode to encode frames as described in 

https://msdn.microsoft.com/en-us/library/windows/desktop/aa965264(v=vs.85).aspx#create_mft

If I could enum and select a hardware encoder MFT, may I use the same code logic to do the encoding?

Great thanks

High CPU usage: ntdll.dll!RtlRegisterThreadWithCsrss+0x174: MFReadWrite.dll with UCMA4

$
0
0

I'm seeing a case where a long running service based on UCMA4 (which uses media foundation) spikes CPU usage.  Loading this up in process explorer, I can see the thread sitting at 25% CPU (on a 4 core system), with a cycles delta of over 2 billion.  The stack looks like this:

ntoskrnl.exe!KiCpuId+0xb6
ntoskrnl.exe!KeWaitForMutexObject+0x137b
ntoskrnl.exe!KeWaitForMutexObject+0x1cf
ntoskrnl.exe!KeTestAlertThread+0x13d
ntoskrnl.exe!KeInitializeApc+0xba0
ntoskrnl.exe!IoPageRead+0x27c1
ntdll.dll!RtlEnterCriticalSection
MFReadWrite.dll!DllCanUnloadNow+0x303c8
MFReadWrite.dll!DllCanUnloadNow+0x30489
MFPlat.DLL!MFPutWaitingWorkItem+0x7af
ntdll.dll!RtlWakeAllConditionVariable+0x259
ntdll.dll!RtlTryEnterCriticalSection+0xbc2
KERNEL32.dll!BaseThreadInitThunk+0x1a
ntdll.dll!RtlUserThreadStart+0x21

I tried enabling the media foundation logs in event viewer, but nothing new got logged.  I haven't tried restarting the process yet, since it won't get into this state normally, and it could run for weeks without this problem manifesting again.  This is tricky to trace back to application code because of the UCMA abstraction.  Has anyone else seen something similar, or do you have suggestions on how else to trace this back to something that we're calling?  I suspect that it's a bug in the Microsoft.RTC.Collaboration.AudioVideo.dll, or Microsoft.RTC.Collaboration, but I can't say for sure. 

Thanks!

Trying to run EVRPresenter

$
0
0

Hi:

   I'm trying to run EVRPresenter.  It compiles/links/regsvr32 correctly.  However the MFPLAYER sample no longer exists so I cannot execute it.  If I try to run it from TopoEdit by putting the CLSID into the "Add custom Sink" option I get a "failed to create custom sink"  /  "BUG : the object does not implement the specified interface".  I've searched in this forum and have found some suggestions, but being a newbie to MF  it is not clear how to go about getting  EVRPresenter to run.  Does anyone have any suggested code changes perhaps for MFPLAYER2  that would allow me to run  EVRPresenter.   Or perhaps how to modify EVRPresenter so I can run it from TOPOEDIT  using the "Add custom Sink" option?

   Mags

Using new W10 interface IMFTimedText

$
0
0

Looking at the new interfaces for W10, I see IMFTimedText.  However, the current (pre-release) docs don't describe where to get an instance of this class.  I don't see any new CLSIDs that seem to apply.  Nothing seems to have an output parameter of type IMFTimedText.  I don't see it listed under Services.

How are you supposed to get one?

Multithreading in WMF using ID3D10Multithread

$
0
0

Hi everybody,

At our company we are currently working on a real time video processing / rendering project. We are using Windows Media Foundation (WMF) for video input. One reason is the capability to decode videos on GPU using DirectX, because we are targeting 4K video resolutions which is quite calculation power consuming.

Since the product will be used in a professional video editing context, it is very important for us to have a good understanding of any impacts on performance that we may cause.

Now the question: In every code sample demonstrating the WMF usage there is one call to the function SetMultithreadProtected of ID3D10Multithread interface, setting the multithread protection to true. The documentation of this function is quite vague, so we do not understand the implications of using that function. Our understanding was, that the DirectX 11 API (which is used in the samples) is thread safe with the exception of the Immediate Context returned by the GetImmediateContext function of the ID3D11Device. So what is that additional multithread protection for? Does it impact performance, for example by heavily using locking / unlocking operations?

It would be nice to get some hints or some additional documentation / knowledge base.

Kind regards,

Michael

Cannot setup windows media video 9 screen encoder

$
0
0

Hi folks,

I am trying to set up the SinkWriter to use the Windows Media Video Screen Encoder 9. I registered the MFT before my actual setup, but I am having trouble when setting the input type. It gave me this error: MF_E_INVALIDMEDIATYPE: The data specified for the media type is invalid, inconsistent, or not supported by this object.

Any ideas how to fix it? This is the setup code for input and output (note that I have omitted all the checking for hr at each step to make the code nice and clean):

       // Trying to register screen codec
	MFT_REGISTER_TYPE_INFO infoInput = { MFMediaType_Video, MFVideoFormat_RGB24 };
	MFT_REGISTER_TYPE_INFO infoOutput = { MFMediaType_Video, MFVideoFormat_MSS2 };
	hr = MFTRegisterLocalByCLSID(CLSID_CMSSCEncMediaObject2, MFT_CATEGORY_VIDEO_ENCODER, L"ScreenEncoder", 0, 1, &infoInput, 1, &infoOutput);

        // Configure the input media type here
        hr = MFCreateMediaType(&mediaTypeIn);
	hr = mediaTypeIn->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video);
	hr = mediaTypeIn->SetGUID(MF_MT_SUBTYPE, useH264 ? MFVideoFormat_YUY2 : MFVideoFormat_RGB24);
	hr = mediaTypeIn->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive);
	hr = MFSetAttributeSize(mediaTypeIn, MF_MT_FRAME_SIZE, width, height);
	hr = MFSetAttributeRatio(mediaTypeIn, MF_MT_FRAME_RATE, fps_num, fps_den);
	hr = MFSetAttributeRatio(mediaTypeIn, MF_MT_PIXEL_ASPECT_RATIO, 1, 1);

        // Configure the output media type here
	hr = MFCreateMediaType(&mediaTypeOut);
	hr = mediaTypeOut->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video);
	hr = mediaTypeOut->SetGUID(MF_MT_SUBTYPE, useH264 ? MFVideoFormat_H264 : MFVideoFormat_MSS2);
	hr = mediaTypeOut->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive);
	hr = mediaTypeOut->SetUINT32(MF_MT_AVG_BITRATE, VIDEO_BITRATE);
	hr = MFSetAttributeSize(mediaTypeOut, MF_MT_FRAME_SIZE, width, height);
	hr = MFSetAttributeRatio(mediaTypeOut, MF_MT_FRAME_RATE, fps_num, fps_den);
	hr = MFSetAttributeRatio(mediaTypeOut, MF_MT_PIXEL_ASPECT_RATIO, 1, 1);

	hr = vx->sinkWriter->AddStream(mediaTypeOut, &vx->streamIndex);
	// It fails at this point
	hr = vx->sinkWriter->SetInputMediaType(vx->streamIndex, mediaTypeIn, NULL);

Thanks!

How To Decode a frame mp4 from IMFSourceReader::ReadSample using CLSID_CMpeg4sDecMFT

$
0
0

Dear sir.

I would like to extract a image frame from a MPEG-4 part 2 file.

I have done on MPEG-4 file. but as MPEG-4 part 2 did not.

Here's the source code.

----------------------------------


 TCHAR BASED_CODE szFilter[] = _T("MPEG-4 Files (*.mp4)|*.mp4|All Files (*.*)|*.*||");
 CFileDialog dialogOpenFile(TRUE, _T("mp4"), NULL, OFN_FILEMUSTEXIST, szFilter, this);
 if (IDCANCEL == dialogOpenFile.DoModal())
 {
  return;
 }

 CString strFileName = dialogOpenFile.GetPathName();

 CComPtr<IMFSourceReader> SourceReader;
 VERIFY(S_OK == MFCreateSourceReaderFromURL(strFileName, nullptr, &SourceReader));

 CComPtr<IMFTransform > pMpeg4sDecoder;
 VERIFY(S_OK == pMpeg4sDecoder.CoCreateInstance(CLSID_CMpeg4sDecMFT));


 UINT32 Width, Height;
 CComPtr <IMFMediaType>pInputType;
 CComPtr <IMFMediaType>pOutputType;


 for (DWORD MediaTypeIndex = 0;; MediaTypeIndex++)
 {
  CComPtr < IMFMediaType> pNativeType;
  if (S_OK != SourceReader->GetNativeMediaType(MF_SOURCE_READER_FIRST_VIDEO_STREAM,MediaTypeIndex, &pNativeType))
  {
   break;
  }
  MFGetAttributeSize(pNativeType, MF_MT_FRAME_SIZE, &Width,&Height);
  GUID majorType, subtype;
  pNativeType->GetGUID(MF_MT_MAJOR_TYPE, &majorType);
  if (majorType == MFMediaType_Video)
  {
   GUID NativeSubtype;
   pNativeType->GetGUID(MF_MT_SUBTYPE, &NativeSubtype);

   MFCreateMediaType(&pInputType);
   pInputType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video);
   pInputType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_MP4V);
   VERIFY(S_OK == SourceReader->SetCurrentMediaType(MF_SOURCE_READER_FIRST_VIDEO_STREAM, nullptr, pInputType));
   VERIFY(S_OK == MFSetAttributeSize(pInputType, MF_MT_FRAME_SIZE, Width, Height));
   VERIFY(S_OK == pMpeg4sDecoder->SetInputType(0, pNativeType, 0));

  

   MFCreateMediaType(&pOutputType);
   pOutputType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video);
   pOutputType->SetGUID(MF_MT_SUBTYPE, MEDIASUBTYPE_YV12);
   VERIFY(S_OK == MFSetAttributeSize(pOutputType, MF_MT_FRAME_SIZE, Width, Height));
   VERIFY(S_OK == pMpeg4sDecoder->SetOutputType(0, pOutputType, 0));

  }
 }

 SourceReader->SetStreamSelection(MF_SOURCE_READER_ANY_STREAM, FALSE);
 SourceReader->SetStreamSelection(MF_SOURCE_READER_FIRST_VIDEO_STREAM, TRUE);
 DWORD StreamIndex, Flags;
 LONGLONG TimeStamp;
CComPtr<IMFSample> Sample;
SourceReader->ReadSample(MF_SOURCE_READER_FIRST_VIDEO_STREAM, 0, &StreamIndex, &Flags, &TimeStamp, &Sample);
  if (Flags & MF_SOURCE_READERF_ENDOFSTREAM)
  {
   return;
  }
  HRESULT hr;

  VERIFY(S_OK==(hr= pMpeg4sDecoder->ProcessInput(0, Sample, 0) ));

-----------------

The last line fails with E_UNEXPECTED Catastrophic failure.

I think that  the pMpeg4sDecoder is correctly configured.but I don't have a resolution.

I looked for the more infomation of CLSID_CMpeg4sDecMFT, but I found only a following page.

https://msdn.microsoft.com/ja-jp/library/windows/desktop/ff819454%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

Please tell me my wrong point.

Sincerely yours.


Library for Creating MFTs

$
0
0
For anyone interested in writing MFTs, I have created a library to make things easier.

The library handles all the basic plumbing involved in writing an MFT, leaving you to focus on the actual work of writing the 'transform' part.

Further, I have found that there really weren't any samples out there showing how to create an Asynchronous MFT.  I believe the asynchronous model for MFTs is a superior design to Vista's old Synchronous model (MFT_Grayscale uses the old model), but trying to figure out how to make it go without a working sample was a bit daunting.

But now that I have it all working, I thought I'd share it with others.

The library is free, open source, and public domain.  The download includes several working MFTs that use the library and detailed instructions.

It is available for download at http://www.LimeGreenSocks.com/MFT.  Any feedback is much appreciated.

MFInitMediaTypeFromWaveFormatEx failed

$
0
0

Hi guys,

I'm now trying to use MP3 encoder mft on Win10 pro Insider preview, but failed to set output media type. 

Below is my code:

// Fill in MPEGLAYER3WAVEFORMAT data    MPEGLAYER3WAVEFORMAT mp3wfx; ZeroMemory(&mp3wfx, sizeof(mp3wfx)); mp3wfx.wID = MPEGLAYER3_ID_MPEG; mp3wfx.fdwFlags = 2; // no padding mp3wfx.nBlockSize = int16_t(144 * (128000 / 44100)); // bitrate = 128000kbps mp3wfx.nFramesPerBlock = 1; mp3wfx.nCodecDelay = 0; mp3wfx.wfx.wFormatTag = WAVE_FORMAT_MPEGLAYER3;  // MP3  mp3wfx.wfx.nChannels = 2; mp3wfx.wfx.nSamplesPerSec = 44100; mp3wfx.wfx.wBitsPerSample = 16; mp3wfx.wfx.nBlockAlign = (mp3wfx.wfx.nChannels * mp3wfx.wfx.wBitsPerSample) / 8; mp3wfx.wfx.nAvgBytesPerSec = mp3wfx.wfx.nSamplesPerSec * mp3wfx.wfx.nBlockAlign; mp3wfx.wfx.cbSize = sizeof(MPEGLAYER3WAVEFORMAT) - sizeof(WAVEFORMATEX); // 12

LComObject<IMFMediaType> ciOutputType;  // Output media type of the encoder hr = fpMFCreateMediaType((IMFMediaType**)(ciOutputType.GetAssignablePtrRef())); hr = fpMFInitMediaTypeFromWaveFormatEx(ciOutputType.get(), &(mp3wfx.wfx), sizeof(WAVEFORMATEX));

please ignore the wrappers I have on those COM objects/interfaces.

fpMFInitMediaTypeFromWaveFormatEx returns an error (hr = E_INVALIDARG One or more arguments are invalid).

Mftrace output these

2888,21C 04:28:58.37011 CMFPlatExportDetours::MFTEnumEx @ Category: MFT_CATEGORY_AUDIO_ENCODER, Flags: 0x00000001, input MT: <NULL>, output MT: MF_MT_MAJOR_TYPE=MEDIATYPE_Audio;MF_MT_SUBTYPE=MFAudioFormat_MP3
2888,21C 04:28:58.37058 CMFAttributesDetours::GetUINT32 @0361DD08 attribute not found guidKey = MFT_CODEC_MERIT_Attribute
2888,21C 04:28:58.37071 CMFAttributesDetours::GetUINT32 @0361DE88 attribute not found guidKey = MFT_CODEC_MERIT_Attribute
2888,21C 04:28:58.37086 CMFAttributesDetours::GetUINT32 @0361DB08 attribute not found guidKey = MFT_CODEC_MERIT_Attribute
2888,21C 04:28:58.37096 CMFAttributesDetours::GetUINT32 @0361DB88 attribute not found guidKey = MFT_CODEC_MERIT_Attribute
2888,21C 04:28:58.37106 CMFAttributesDetours::GetUINT32 @0361DB88 attribute not found guidKey = MFT_CODEC_MERIT_Attribute
2888,21C 04:28:58.37117 CMFAttributesDetours::GetUINT32 @0361DD08 attribute not found guidKey = MFT_CODEC_MERIT_Attribute
2888,21C 04:28:58.37127 CMFAttributesDetours::GetUINT32 @0361DD48 attribute not found guidKey = MFT_CODEC_MERIT_Attribute
2888,21C 04:28:58.37138 CMFAttributesDetours::GetUINT32 @0361DC88 attribute not found guidKey = MFT_CODEC_MERIT_Attribute
2888,21C 04:28:58.37148 CMFAttributesDetours::GetUINT32 @0361DD48 attribute not found guidKey = MFT_CODEC_MERIT_Attribute
2888,21C 04:28:58.37158 CMFAttributesDetours::GetUINT32 @0361DB48 attribute not found guidKey = MFT_CODEC_MERIT_Attribute
2888,21C 04:28:58.37167 CMFPlatExportDetours::MFTEnumEx @ Activate 00 @035FBF70, MFT_FRIENDLY_NAME_Attribute=MP3 Encoder ACM Wrapper MFT;MFT_INPUT_TYPES_Attributes=61 75 64 73 00 00 10 00 80 00 00 aa 00 38 9b 71 01 00 00 00 00 00 10 00 80 00 00 aa 00 38 9b 71 ;MFT_TRANSFORM_CLSID_Attribute={11103421-354C-4CCA-A7A3-1AFF9A5B6701};MFT_OUTPUT_TYPES_Attributes=61 75 64 73 00 00 10 00 80 00 00 aa 00 38 9b 71 55 00 00 00 00 00 10 00 80 00 00 aa 00 38 9b 71 ;MF_TRANSFORM_FLAGS_Attribute=1;MF_TRANSFORM_CATEGORY_Attribute=MFT_CATEGORY_AUDIO_ENCODER
2888,21C 04:28:58.37361 COle32ExportDetours::CoCreateInstance @ New MFT @0145D430, <NULL>
2888,21C 04:28:58.37363 COle32ExportDetours::CoCreateInstance @ Created {11103421-354C-4CCA-A7A3-1AFF9A5B6701} MP3 ACM Wrapper MFT (C:\Windows\System32\mfcore.dll) @0145D430 - traced interfaces: IMFTransform @0145D430, 
2888,21C 04:28:58.37432 CMFTransformDetours::SetOutputType @0145D430 Failed MT: 

Thanks for help



Synchronization in MPEG-1 Media Source

$
0
0

Hi, I would like to know why creating of the media source

(MPEG1ByteStreamHandler::BeginCreateObject,MPEG1ByteStreamHandler::EndCreateObject, etc) isn't protected from the concurrent execution?

IMFSourceReader->ReadSample never returns

$
0
0

Hi,

I have a media file that causes ReadSample to hang indefinitely when reading from the audio channel of a video file. This appears to be happening at the end of the stream. It successfully reads 156s of samples from the stream before hanging, yet the stream metadata says it is only 137s long.

Code snippet, sorry about the formatting.

hr =

pReader->ReadSample((DWORD)MF_SOURCE_READER_FIRST_AUDIO_STREAM,
	0,			NULL,&dwFlags,			NULL,&pSample			);
	if (FAILED(hr)) { break; }

if (dwFlags & MF_SOURCE_READERF_CURRENTMEDIATYPECHANGED)		{
			printf("Type change - not supported by WAVE file format.\n");
	break;
		}


		bool atEof=false;
	if (dwFlags & MF_SOURCE_READERF_ENDOFSTREAM)		{
			//printf("End of input file.\n");
		atEof=true;
	}

Unhandled exception at mfh265enc.dll

$
0
0

Hi,

I'm trying to encode video with H.265 encoder MFT on Win10 Pro Insider Preview.

  • Originally I create/init an H.265 encoder in my own program and call ProcessInput/ProcessOuput and it crashed inside ProcessOuput (It didn't crash on first frame, instead it crashed after several frames have been processed).
  • To simplify the question, I used IMFSinkWriter to create a sink, so frame encoding/writing thus is totally handled by sinkwriter. But unfortunately crash still happened inside mfh265enc.dll.

       Please note that in above 2 cases, the change I made was on a program which can successfully encode H.264 video. I only changed the output media type for Encoder/SinkWriter (changed subtype from H.264 to H.265). The way video frames got constructed, supplied to encoder/sinkwriter keep same. When encoding with H.264 everything was good, but once changed to H.265 it crashed.

  • Then I turned to the sample program comes with Win7 SDK: MFCaptureToFile which could capture video into a MP4 file.

       I'm sure the video format from camera is acceptable to H.265 encoder. The only change I've done is to the outputmedia type which is passed to SinkWrite.AddStream. 

       I've changed the subtype to MFVideoFormat_HEVC, and set MF_MT_MPEG2_PROFILE to 1 (eAVEncH265VProfile_Main_420_8).

       But with the 2 changes above, the program still crashes. Showing "Unhandled exception at 0x5A025085 (mfh265enc.dll) in MFCaptureToFile.exe: 0xC0000005: Access violation reading location 0xFFFFFFFF"

======================================

Here's the change I've made to the MFCaptureToFile program.

https://www.dropbox.com/s/oytqen13m7bcs23/DIFF.PNG?dl=0






Viewing all 1079 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>