Topic: MPEG-4 Support in Media Foundation & Win10PESE  (Read 1165 times)

0 Members and 1 Guest are viewing this topic.

MPEG-4 Support in Media Foundation & Win10PESE
« on: February 02, 2016, 05:21:52 AM »

Gerhard S.

  • Jr. Chef
  • **
  • Date Registered: Dec 2015
  • Posts: 95
MPEG-4 Support in Media Foundation   Plugin-Status: fully working, almost complete.
https://msdn.microsoft.com/en-us/library/dd757780(v=vs.85).aspx
• AAC Decoder
• AAC Encoder
• H.264 Video Decoder
• H.264 Video Encoder
• MPEG4 Part 2 Video Decoder
• MPEG-4 File Sink
• MPEG-4 File Source (formerly: 'splitter')

This section describes the Media Foundation components that support MPEG-4 formats, including H.264 video, AAC audio, and the MP4 and 3GP file formats.
• AAC Decoder, [Windows 8]MSAudDecMFT.dll(Media Foundation Audio Decoders), [Windows 7]Msmpeg2adec.dll(MS DTV-DVD Audio Decoder), https://msdn.microsoft.com/de-de/library/windows/desktop/dd742784(v=vs.85).aspx
• AAC Encoder, Mfaacenc.dll(Media Foundation AAC Encoder), https://msdn.microsoft.com/de-de/library/windows/desktop/dd742785(v=vs.85).aspx
• H.264 Video Decoder, Msmpeg2vdec.dll,  (MS DTV-DVD Video Decoder); (Media Foundation H.264 video decoder is a Media Foundation Transform)
• H.264 Video Encoder, Mfh264enc.dll (Media Foundation H264 Encoder), https://msdn.microsoft.com/en-us/library/dd797816(v=vs.85).aspx
• MPEG4 Part 2 Video Decoder, MP4SDecd.dll (Windows Media MPEG-4 S Video Decoder),
• MPEG-4 File Sink, Mf.dll (Media Foundation DLL), https://msdn.microsoft.com/en-us/library/dd388100(v=vs.85).aspx
• MPEG-4 File Source:  MF source filters are not stored in any directory in the registry. Instead, MF provides a set of enumeration and creation functions that allow you to instantiate the right component for each source type.

Found other MF related files on search with expression "Media Foundation" in file content --> (37 pcs., ~20,9 MB)


Supporting Direct3D 11 Video Decoding in Media Foundation
This topic describes how to support Microsoft Direct3D 11 in a Microsoft Media Foundation decoder. Specifically, it describes the communication between the decoder and the video renderer. This topic does not describe how to implement the decoding operations.
Here are the basic steps that a software decoder must perform to support Direct3D 11 in Media Foundation:
1.Open a handle to the Direct3D 11 device.
2.Find a decoder configuration.
3.Allocate uncompressed buffers.
4.Decode frames.


In Windows Media Foundation, TopoEdit is the equivalent of DirectShow’s GraphEdit tool.
MS SDK for Windows 10 installed (2.9 GB). From now on, MS is watching my activities (on/with SDK)...
Native Win10, Planet Earth Amazing nature scenery (720p HD).mp4

ila_rendered


State of things, in Win10PESE; components not at all - or with failures implemented:

ila_rendered

======================================================================
Sorry friends, project is stuck. Partial successes visible.

ila_rendered

I don't want to say: "For ever discontinued".

=========================14.02.2016=============================================
Source: DVD Win10 Pro, version 10.0.10586.0 64-bit; Builder: [2016-02-05]
New attempt on running Win10PESE (ISO ~1100 MB) -> Topoedit.exe don't want to start.
DependencyWalker:
Minor problem: Missing a dozen MFT related DLL's. Copied the missing (x86/x64) from Win10 to PE. - OK.
 - This can be enforced by Script. FileCopy,%WindowsDir%\System32\*.dll  Call,FileCopyMUI,%WindowsDir%\System32,*.dll  and FileCopy,%WindowsDir%\SysWOW64\*.dll
More larger problem: x86-dll's are in System32 folder. (Note: In Win 64-bit, folder .\System32 holds the 64-bit dll's)
=> Also here: Call,FileCopyMUI,%WindowsDir%\System32,*.dll  and FileCopy,%WindowsDir%\SysWOW64\*.dll
FileCopy does not the "expected".
%WindowsDir%\System32\ presents itself with me as C:\Windows\SysWOW64\
In this regard, 3 other Plugins by my own, revised: 
Filmerit.script => disabled, not needed for MFT
CodecTweakTool.script => disabled, not needed for MFT
MediaFeaturePack_W10_x64.script


Topoedit starts  :smile: - but...

Opend the *.mp4 Videofile as Source; ok, filetype is registered.
Next stage: Tried to add a MF related transform; for mp4 -> 'MS H264 Video Decoder MFT':

ila_rendered

Translated appearing error message : "This is not an allowed Win32-application."

"%1" <-> Guess: Registry is still not properly configured. Maybe because failures RegPEconvert *.reg to *.script
The only hard way: Revise my RegWrite-section.
From RegHiveLoad,Tmp_Software,%RegSoftware% to RegHiveUnLoad,Tmp_Software I count 2370 lines... ~470 0x1's changed to 0x2's in one pass.

ila_rendered

Preliminary conclusion: At least, Topoedit knows/recognizes  the module 'MS H264 Video Decoder MFT' (and the others for Audio decoding, too) - otherwise they would not in the list.

=========================16.02.2016=============================================
Source: DVD Win10 Pro, version 10.0.10586.0 64-bit; Builder: [2016-02-05]
MS H264 Video Decoder MFT is working now. This is the first time, my Win10PESE plays Mpeg-4 Video:

ila_rendered

FullHD 1080p with only 3% CPU

ila_rendered

Not perfect yet. But Palemoon/Firefox are already playing Mpeg-4 720p : (with audio  :confused:  :lol:)

ila_rendered


Next is MS AAC Audio Decoder MFT, Resampler MFT (all the other modules  :wink: ).


Code: [Select]
[Process]
Arch,x64
Echo,"Processing %ScriptTitle%..."
IniRead,%ProjectDir%\script.project,IniVariables,NoWarnRegOverWrite,%NoWarnROW%
If,NOT,QUESTION,List of all MF Transforms already processed?,100,False,Run,%ScriptFile%,MF_Transforms_List

[MF_Transforms_List]
System,RegRedirect,64
ShellExecute,Open,cmd.exe,"/C "CD /D %ScriptDir% & reg EXPORT HKLM\SOFTWARE\Classes\MediaFoundation\Transforms MF_Transforms_List.ini /reg:64""
System,RegRedirect,Off
Message,Delete all #$qInputTypes#$q and all #$qOutputTypes#$q and #$qAttributes#$q and #$qMFTFlags#$q ,INFORMATION,100
ShellExecute,Open,notepad.exe,"%ScriptDir%\MF_Transforms_List.ini"
Message,Delete all ([)HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MediaFoundation\Transforms(]) => Replace_with #$q#$q,INFORMATION,100
ShellExecute,Open,notepad.exe,"%ScriptDir%\MF_Transforms_List.ini"

MF_Transforms_List.ini (55 lines)
Code: [Select]
01f36ce2-0907-4d8b-979d-f151be91c883
05a47ebb-8bf0-4cbf-ad2f-3b71d75866f5
068a8476-9229-4cc0-9d49-2fc699dcd30a
11103421-354c-4cca-a7a3-1aff9a5b6701
128509e9-c44e-45dc-95e9-c255b8f466a6
1610be56-b101-40fd-8136-779285d7d4a6
177C0AFE-900B-48d4-9E4C-57ADD250B3D4
1a1703e9-3e7c-41c3-ad5a-795cbfb19552
1ea1ea14-48f4-4054-ad1a-e8aee10ac805
1f1f4e1a-2252-4063-84bb-eee75f8856d5
265011AE-5481-4f77-A295-ABB6FFE8D63E
2D709E52-123F-49b5-9CBC-9AF5CDE28FB9
2eeb4adf-4578-4d10-bca7-bb955f56320a
2FAE8AFE-04A3-423a-A814-85DB454712B0
32d186a7-218f-4c75-8876-dd77273a8999
36CB6E0C-78C1-42B2-9943-846262F31786
404a6de5-d4d6-4260-9bc7-5a6cbd882432
420a51a3-d605-430c-b4fc-45274fa6c562
46A4DD5C-73F8-4304-94DF-308F760974F4
4a76b469-7b66-4dd4-ba2d-ddf244c766dc
51571744-7fe4-4ff2-a498-2dc34ff74f1b
5210f8e4-b0bb-47c3-a8d9-7b2282cc79ed
5686a0d9-fe39-409f-9dff-3fdbc849f9f5
62ce7e72-4c71-4d20-b15d-452831a87d9d
6B0B3E6B-A2C5-4514-8055-AFE8A95242D9
6ca50344-051a-4ded-9779-a43305165e35
70707B39-B2CA-4015-ABEA-F8447D22D88B
70f598e9-f4ab-495a-99e2-a7c4d3d89abf
745057c7-f353-4f2d-a7ee-58434477730e
798059f0-89ca-4160-b325-aeb48efe4f9a
7bafb3b1-d8f4-4279-9253-27da423108de
7e320092-596a-41b2-bbeb-175d10504eb6
82d353df-90bd-4382-8bc2-3f6192b76e34
874131cb-4ecc-443b-8948-746b89595d20
88753B26-5B24-49bd-B2E7-0C445C78C982
92b66080-5e2d-449e-90c4-c41f268e5514
92b6df56-82f7-4340-a562-5451481fd712
93af0c51-2275-45d2-a35b-f2ba21caed00
98230571-0087-4204-b020-3282538e57d3
9AB6A28C-748E-4B6A-BFFF-CC443B8E8FB4
a16e1bff-a80d-48ad-aecd-a35c005685fe
ab300f71-01ab-46d2-ab6c-64906cb03258
AC3315C9-F481-45D7-826C-0B406C1F64B8
bbeea841-0a63-4f52-a7ab-a9b3a84ed38a
bc47fcfe-98a0-4f27-bb07-698af24f2b38
C0CD7D12-31FC-4BBC-B363-7322EE3E1879
ca34fe0a-5722-43ad-af23-05f7650257dd
CB17E772-E1CC-4633-8450-5617AF577905
cba9e78b-49a3-49ea-93d4-6bcba8c4de07
d23b90d0-144f-46bd-841d-59e4eb19dc59
e6335f02-80b7-4dc4-adfa-dfe7210d20d5
e7fd7e9f-f823-4283-9b29-ba65bf439cad
f2f84074-8bca-40bd-9159-e880f673dd3b
f371728a-6052-4d47-827c-d039335dfe0a
f447b69e-1884-4a7e-8055-346f74d6edb3


=========================21.02.2016=============================================

Edit this MF_Transforms_List.ini as follows: (73 lines) --- MF_Transforms_List.ini has to be an ANSI-coded textfile.
Code: [Select]
[Registry_Base_Folders]
HKEY_CLASSES_ROOT\CLSID
HKEY_CLASSES_ROOT\Wow6432Node\CLSID
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID
[Keys]
01f36ce2-0907-4d8b-979d-f151be91c883
05a47ebb-8bf0-4cbf-ad2f-3b71d75866f5
...
...
f371728a-6052-4d47-827c-d039335dfe0a
f447b69e-1884-4a7e-8055-346f74d6edb3
[MF_Base_Folders]
HKEY_CLASSES_ROOT\DirectShow\MediaObjects
HKEY_CLASSES_ROOT\MediaFoundation
HKEY_CLASSES_ROOT\Wow6432Node\DirectShow\MediaObjects
HKEY_CLASSES_ROOT\Wow6432Node\MediaFoundation
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\DirectShow\MediaObjects
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MediaFoundation
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\DirectShow\MediaObjects
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\MediaFoundation
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\DirectShow\MediaObjects
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\MediaFoundation

Put in the same folder as MF_Transforms_List.ini the special homemade MF_Registry_readout.exe
Start MF_Registry_readout.exe:
 - First FileOpen DialogBox: Select your MF_Transforms_List.ini as input;
- Second FileOpen DialogBox: Create an empty (output-)file 'MF_Registry_readout.bat' - and select it in already opend FileOpen DialogBox;
Wait until MF_Registry_readout.exe has finished; then hit any key on keyboard to stop MF_Registry_readout.exe;
MF_Registry_readout.exe builds MF_Registry_readout.bat  (91 kB)
Code: [Select]
DEL MF_Reg_Readout.reg
DEL MF_Reg_Temp.reg
reg EXPORT HKCR\CLSID\{01f36ce2-0907-4d8b-979d-f151be91c883} MF_Reg_Temp.reg /reg:64
TYPE MF_Reg_Temp.reg >> MF_Reg_Readout.reg
DEL MF_Reg_Temp.reg
reg EXPORT HKCR\CLSID\01f36ce2-0907-4d8b-979d-f151be91c883 MF_Reg_Temp.reg /reg:64
TYPE MF_Reg_Temp.reg >> MF_Reg_Readout.reg
DEL MF_Reg_Temp.reg
reg EXPORT HKCR\CLSID\{05a47ebb-8bf0-4cbf-ad2f-3b71d75866f5} MF_Reg_Temp.reg /reg:64
TYPE MF_Reg_Temp.reg >> MF_Reg_Readout.reg
...
...
...
DEL MF_Reg_Temp.reg
reg EXPORT HKLM\SOFTWARE\Wow6432Node\Classes\MediaFoundation MF_Reg_Temp.reg /reg:64
TYPE MF_Reg_Temp.reg >> MF_Reg_Readout.reg

Start MF_Registry_readout.bat  --> Summary: MF_Reg_Readout.reg (624 kB)
Open MF_Reg_Readout.reg with Texteditor and delete all 'Windows Registry Editor Version 5.00' (~250 occurrences)
 - Paste then at the beginning of MF_Reg_Readout.reg 1 line 'Windows Registry Editor Version 5.00
 - Replace all C:\ to X:\  (~180 occurrences)
Use Builder\Utils\Reg ReConvert and pick file MF_Reg_Readout.reg
->RegCPE Convert and Open : -> MF_Reg_Readout.reg_RC.ini.script (866 kB; 3853 lines)
Code: [Select]
RegHiveLoad,Tmp_Software,%RegSoftware%
RegWrite,HKLM,0x1,Tmp_Software\Classes\CLSID\{01f36ce2-0907-4d8b-979d-f151be91c883},,CFrameRateConvertDmo
RegWrite,HKLM,0x1,Tmp_Software\Classes\CLSID\{01f36ce2-0907-4d8b-979d-f151be91c883}\InprocServer32,,C:\Windows\System32\mfvdsp.dll
...
...
...
...
RegWrite,HKLM,0x1,Tmp_Software\Wow6432Node\Classes\MediaFoundation\Transforms\PreferredByOutputType,{e06d8026-db46-11cf-b4d1-00805f6cbbea},{e6335f02-80b7-4dc4-adfa-dfe7210d20d5}
RegWrite,HKLM,0x1,Tmp_Software\Wow6432Node\Classes\MediaFoundation\Transforms\PreferredByOutputType,{e06d802c-db46-11cf-b4d1-00805f6cbbea},{AC3315C9-F481-45D7-826C-0B406C1F64B8}
RegHiveUnLoad,Tmp_Software

This^^ is our final scripttext for the Registry-section in MediaFeaturePack_W10_x64.script
(I have to find out, whether the 0x1's must be changed to 0x2's)

FF plays now Mpeg-4 FullHD 1080p with Audio

Topology Status: Resolved. ->  ila_rendered  ila_rendered

Firefox: about:config -> media.mediasource.enabled = TRUE; media.mediasource.mp4.enabled = TRUE; set media.mediasource.webm.enabled to TRUE

Check: HTML5-Videoplayer on YouTube -> ila_rendered



UHD / 4K movie playback is also possible: -> LG 4K OLED: Wonders
New Firefox versions after v40 have html5 and hardware accelerating. I have to try out yet, whether Flash Plugin is no longer needed. already removed.
"The minimum system requirements for viewing 4K UHD video is a PC with an Intel or AMD CPU equivalent to
Intel Core i7 with 4 cores, running at 2.3GHz.
" The following screencapture is taken from my laptop on running Win10PESE:

ila_rendered

=========================22.02.2016=============================================

It's time to opt for a media player.
110 DirectShow filters + complete MediaFoundation Transforms are now with MediaFeaturePack_W10_x64 onboard.

I'm looking for:
either
- an advanced, lightweight MediaPlayer with or without a minimal set of own filters. Must be able to handle HD media files;
or
- a complete multimedia solution. Plays "everything" from every data storage (+DVD-Player, + BlueRay, +USB-Stick) - and can also convert between various formats.
 For converting there is a freeware 'XMedia Recode'...

Link1: HEVC 4K Ultra HD Media Player VLC for Windows available
DL: latest releases, act. 2.1.4-libde265-4

Testvideo: Tears of Steel, 4096px × 1720px "tos-4096x1720-tiles.mkv", File size: 233 MB

Media Player Classic - Home Cinema (MPC-HC) Portable, 64-bit, v1.7.10: Plays 4k video continuous in full screen mode on i5 CPU-load 100%  ~10 fps. HD 1080p clear video + clear sound without crackling/disorder.

VLC from libde265.org crashes after 1 second 4k video playback. HD 1080p continuous - but audio with crackling.
"Normal" VLC portable v2.2.1 doesn't crash with 4k test video - but frame rate is under 1fps. HD 1080p continuous - but audio with crackling.

Kyhi Revisied Plugins: VLC Media Player v2.2.2 Plugin: (testing...)

0scar, SMPlayer Plugin:  (testing...)

Downloaded SMplayer portable v16.1.0 (64-bit):
4k test video clear video + clear sound without crackling/disorder;
HD 1080p clear video + clear sound without crackling/disorder;
ila_rendered
« Last Edit: February 23, 2016, 12:59:09 AM by Gerhard S. »

 

Powered by EzPortal