MfPack version 3.1.6 released today!
MfPack version 3.1
How To..
MfPack 3.1.5 - Major changes
MfPack Files
Added the new AudioLoopBack sample in Updates.
Added the new AudioLoopBack sample.
Your wish has become true. We added the simple AudioLoopBack sample that is more nifty than the MS sample here A more up to date sample will be released soon because the mmio methods are deprecated soon, starting with mmioOpen. Regards, Tony.
Your whish has become true. We added the simple AudioLoopBack sample that is more nifty than the MS sample here A more up to date sample will be released soon because the mmio methods are deprecated soon, starting with mmioOpen. Regards, Tony.
Your whish has become true. We added the simple AudioLoopBack sample that is more nifty than the MS sample here Regards, Tony.
Since MFPackX300 there have been two samples added that are able to take snapshots: - MfCameraFrameCapture sample. - MFCaptureEngineVideoCapture sample.
So? Developing new apps is a road with much challenges. And the project is not finished yet, because Microsoft decided that DirectX is from now, part of Media Foundation.
MfPack Files
Home
Ok, Here a pseudo code sample how to perform what you want: // Event handler Do not call this method in rendering mode or audio-only mode. Do this in a for while loop or what ever you want. function TcMediaEngine.GetVideoStreamTick(out lstrtick: LongLong): HResult; var llstrtick: LONGLONG; hr: HResult; begin if pu_RenderingState in [rsPlaying, rsPaused] then begin hr := pr_MediaEngine.OnVideoStreamTick(llstrtick); if Succeeded(hr) then lstrtick := llstrtick else lstrtick := -1; end else hr := E_FAIL;...
Ok, Here a pseudo code sample how to perform what you want: // Event handler Do not call this method in rendering mode or audio-only mode. Do this in a for while loop or what ever you want. function TcMediaEngine.GetVideoStreamTick(out lstrtick: LongLong): HResult; var llstrtick: LONGLONG; hr: HResult; begin if pu_RenderingState in [rsPlaying, rsPaused] then begin hr := pr_MediaEngine.OnVideoStreamTick(llstrtick); if Succeeded(hr) then lstrtick := llstrtick else lstrtick := -1; end else hr := E_FAIL;...
Ok, Here a pseudo code sample how to perform what you want: ' // Event handler Do not call this method in rendering mode or audio-only mode. Do this in a for while loop or what ever you want. function TcMediaEngine.GetVideoStreamTick(out lstrtick: LongLong): HResult; var llstrtick: LONGLONG; hr: HResult; begin if pu_RenderingState in [rsPlaying, rsPaused] then begin hr := pr_MediaEngine.OnVideoStreamTick(llstrtick); if Succeeded(hr) then lstrtick := llstrtick else lstrtick := -1; end else hr := E_FAIL;...
Ok, Here a pseudo code sample how to perform what you want: 1: // Event handler Do not call this method in rendering mode or audio-only mode. Do this in a for while loop or what ever you want. `function TcMediaEngine.GetVideoStreamTick(out lstrtick: LongLong): HResult; var llstrtick: LONGLONG; hr: HResult; begin if pu_RenderingState in [rsPlaying, rsPaused] then begin hr := pr_MediaEngine.OnVideoStreamTick(llstrtick); if Succeeded(hr) then lstrtick := llstrtick else lstrtick := -1; end else hr :=...
Ok, Here a pseudo code sample how to perform what you want: 1: // Event handler Do not call this method in rendering mode or audio-only mode. Do this in a for while loop or what ever you want. `function TcMediaEngine.GetVideoStreamTick(out lstrtick: LongLong): HResult; var llstrtick: LONGLONG; hr: HResult; begin if pu_RenderingState in [rsPlaying, rsPaused] then begin hr := pr_MediaEngine.OnVideoStreamTick(llstrtick); if Succeeded(hr) then lstrtick := llstrtick else lstrtick := -1; end else hr :=...
Ok, Here a pseudo code sample how to perform what you want: 1: `// Event handler Do not call this method in rendering mode or audio-only mode. Do this in a for while loop or what ever you want. function TcMediaEngine.GetVideoStreamTick(out lstrtick: LongLong): HResult; var llstrtick: LONGLONG; hr: HResult; begin if pu_RenderingState in [rsPlaying, rsPaused] then begin hr := pr_MediaEngine.OnVideoStreamTick(llstrtick); if Succeeded(hr) then lstrtick := llstrtick else lstrtick := -1; end else hr :=...
Hi Alex, TransferVideoFrame can only be performed to a DXGI or WIC surface. How to do this is described Here
Hi Alex. Maybe there are some left overs from k-lite in the registry that are causing issues. Use a good registry cleaner is my advise. My experience with k-lite is not the highlight of my life ;-) Regards, Tony.
Hi Alex. I tested the file with resolution1080p on a clean Windows 10 OS with the latest updates. VLC uses it's own codecs. One solution is to disable hardware acceleration on your GPU if possible. That seems to help on some videocards. You should know that the codec used in MP4 containers are not supported by RFC6381 MIME tags. So, it's always a guess if a codec supports the H.264 format. Regards, Tony.
Hi Alex. I tested the file with resolution1080p on a clean Windows 10 OS with the latest updates. VLC uses it's own codecs. One solution is to disable hardware acceleration on your GPU if possible. That seems to help on some videocards. Regards, Tony.
Hi Alex, I tested this mp4 on the systems here. On all players, Windows Media Player included, this file renders normally without any exception raised. So, I think the issue is related to your OS. A quick way to analyze a media stream/file is to use, for example, the helper-methods in WinApi.MediaFoundationApi.MfMetLib like function GetStreamContents or function GetMediaType. The IMfMediaEngine has some build in methods to check the contents of a stream, like; IMFMediaEngine.CanPlayType, IMFMediaEngine.GetError....
Hi Alex, I tested this mp4 on the systems here. On all players, Windows Media Player included, this file renders normally without any exception raised. So, I think the issue is related to your OS. A quick way to analyze a media stream/file is to use, for example, the helper-methods in WinApi.MediaFoundationApi.MfMetLib like function GetStreamContents or function GetMediaType. Regards, Tony.
Hi Jim, All files that needs this unit are provided. Maybe this sample is not.
Hi Jim, thanks. WinApiTypes.inc is the include file and WinApi.WinApiTypes.pas where ANYSIZE_ARRAY, Float32 and all other exotic definitions are declared.
Hi Jim, thanks. WinApiTypes.inc is the include file and WinApi.WinApiTypes.pas where all exotic definitions are declared.
Hi Jim, thanks. WinApiTypes.inc is the include file where all exotic definitions are declared.
Thanks Jim! I pushed some updates that involves the Single type conversion issues and added Math in WinApi.DirectX.D2D1_1Helper.pas . See here Regards Tony.
Hi, casts which Delphi 10.1 will not accept. For instance single(123.4 ) is rejected Please send a source code about this. The audio loopback translation This translation is not an official translate and that's why it is placed in a sandbox. The issue with the callback is a solution that works with Delphi. We are working on that, but that can take some while. About the parent: Strictly this would mean a pointer to an object that is the parent. Delphi is not suitable to use a parent within a class....
This is not really an error. Result value source: FACILITY_MEDIASERVER: (the Windows Media Server.) The source of the error code is the Windows Media Server. Returned: The request is invalid because Shutdown() has been called. That means you called shutdown before this return code appears. You can only call this function once. Hope this helps.
Today we published the win 11 sdk translations. The loopback sample has been placed in the sandbox, that means the public can edit the source code to make it a working sample. Since we are a bit underpowered, we think this the best shot.
Today we published the win 11 sdk translations. The loopback sample has been placed in the sandbox, that means the public can edit the source code to make it na working sample. Since we are a bit underpowered, we think this the best shot.
This is not really an error. Result value source: FACILITY_MEDIASERVER: (the Windows Media Server.) The source of the error code is the Windows Media Server. Returned: The request is invalid because Shutdown() has been called. Hope this helps.
What is the result code?
We tested the original code, but nothing strange is happening. Can you reproduce this behavior from your own source in code?
Well.. Until Delphi 10.3.3 we didn't encountered such strange things. The source files are edited and updated in the latest version of Delphi available (in this case 10.3.3). So, maybe you should address this behavior to Embarcadero ?
You are right!
Great!
Hi, The new update of MfPack has a directory named SandBox/ MfFrameCapture, with an example how to use the SourceReader.
Hi, The new update of MfPack has a directory named SandBox/ MfFrameCapture, with an example how to use the SourceReader.
Hi, You could use IMFMediaEngine.Shutdown to release it's sources instead of releasing the MediaEngine each time when changing sources. So, a logical sequence would be: LoadSource, Play and when finished, ShutDown.
Hi, You could use IMFMediaEngine.Shutdown to release it's sources instead of releasing the MediaEngine each time when changing sources. So, a logical sequence would be: LoadSource, Play and when finnished, ShutDown.
Hi, You could use IMFMediaEngine.Shutdown to release it's sources instead of releasing the MediaEngine each time when changing sources.
Hi, Every time a new file or source is loaded, the topography of this file (source) has to be recreated and used sources have to be released. (because, for example, a mp4 topo has a different topo like AVI.) This is normal behavior. Remember the API is low level, so, more work to be done to made things working. I recommend to read the documentation here
Hi, Every time a new file or source is loaded, the topography of this file (source) has to be recreated and used sources have to be released. (because, for example, a mp4 topo has a different topo like AVI.) Therefore all sources of the previous sources have to be reiniated and used sources to be released. This is normal behavior. Remember the API is low level, so, more work to be done to made things working. I recommend to read the documentation here
Hi, Every time a new file or source is loaded, the topography of this file (source) has to be recreated and used sources have to be released. (because, for example, a mp4 topo has a different topo like AVI.) Therefore all sources of the previous sources have to be reiniated and used sources to be released. This is normal behavior. Remember the API is low level, so, more work to be done to made things working.
Hi, Thanks for reporting this issue. We il implement this correction in the new d2d1 APi update for sdk 10.0.20348.0 coming soon.
You should try, I think... MediaFoundation is very flexible and can cooperate with older designs like DirectShow and DirectSound. If you want to keep updated real time (almost), you should follow MfPack on Github
You should try, I think... MediaFoundation is very flexible and can cooperate with older designs like DirectShow and DirectSound. If you want to keep updated real time (almost), you should follow [MfPack on Github]https://github.com/FactoryXCode/MfPack)
Well, it's possible to run multiple instances at one time. It's a crime to communicate with eachother, but possible when you create a solid messaging protocol. However you should study the frame-server implementation. And that is not the most easy way to accomplish. If I where you, use the source reader.
Hi Alex, Theoretical it's possible. For this, you have 2 options: Use MFPlay (See here or use a source reader (See here A new example is under construction that is able to show and store frames from a videofile. This sample will be published very soon.
Hi Alex, Theoretical it's possible. For this, you have 2 options: Use MFPlay (See here or use a source reader (See here
Yes, but : Header file audioclientactivationparams.h is currently not included in the Windows 10 SDK. So we can not run it in Visual Studio, although the Delphi skeleton for this sample is ready for months. And because of that we don't know if the methods are implemented in Windows, because no library (dll) is mentioned on ms.docs. Most likely this header will be published at the end of this year when Windows 11 SDK will be released.
Hi, Did you add the correct search path in the sample Project/Options/Delphi Compiler/Search path ? (..\MfPack\src)
Ahh Ok, I see. A good explanation you might find here
The function function TTranscoder.ConfigureVideoOutput has default values for the framesize. Before rendering you should calculate the framesize of the original and use those in stead of the default values (vWidth: Uint32 = 320; vHeight: Uint32 = 240) in procedure TfrmTranscoder.Start(). For this you might use function GetFrameSize in Helpers.pas. After this you should set the container properties. The sample uses the default MF_TRANSCODE_ADJUST_PROFILE_DEFAULT. See function TTranscoder.ConfigureContainer()....
The function function TTranscoder.ConfigureVideoOutput has default values for the framesize. Before rendering you should calculate the framesize of the original and use those in stead of the default values (vWidth: Uint32 = 320; vHeight: Uint32 = 240) in procedure TfrmTranscoder.Start(). For this you might use function GetFrameSize in Helpers.pas.
The function function TTranscoder.ConfigureVideoOutput has default values for the framesize. Before rendering you should calculate the framesize of the original and use those in stead of the default values (vWidth: Uint32 = 320; vHeight: Uint32 = 240). For this you might use function GetFrameSize in Helpers.pas.
Hello, This should be possible. For this you probably need the D2D1 API. A sample how to extract frames can be found in the MfVideoThumbNail sample app that uses this API. Regards, Tony.
Ok, Get same error here (pointer error) Now It seems this is a implementation in interface IMFCollection. How to solve: Change the interface declaration like this: // Interface IMFCollection // ======================= // Represents a generic collection of IUnknown pointers. // NOTE: To create an empty collection object, call MFCreateCollection. // PIMFCollection = ^IMFCollection; {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IMFCollection);'} {$EXTERNALSYM IMFCollection} IMFCollection = interface(IUnknown)...
Ok, Get same error here (pointer error) Now It seems this is a implementation in interface IMFCollection. How to solve: Change the interface declaration like this: // Interface IMFCollection // ======================= // Represents a generic collection of IUnknown pointers. // NOTE: To create an empty collection object, call MFCreateCollection. // PIMFCollection = ^IMFCollection; {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IMFCollection);'} {$EXTERNALSYM IMFCollection} IMFCollection = interface(IUnknown)...
Ok, Get same error here (pointer error) Now It seems this is a implementation in interface IMFCollection. How to solve: Change the interface declaration like this: // Interface IMFCollection // ======================= // Represents a generic collection of IUnknown pointers. // NOTE: To create an empty collection object, call MFCreateCollection. // PIMFCollection = ^IMFCollection; {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IMFCollection);'} {$EXTERNALSYM IMFCollection} IMFCollection = interface(IUnknown)...
Hello, Where in function TTranscoder.ConfigureAudioOutput(): HResult;does this error occur and what is the result (hr) of the function that fails?