microsoft / media-foundation

Repository for Windows Media Foundation related tools and samples
MIT License
144 stars 31 forks source link

mpg video cannot be loaded. #46

Closed DougRogers closed 1 year ago

DougRogers commented 1 year ago

Loading this video into MediaEngineDCompWin32Sample fails with the following error reported.

Exception thrown at 0x00007FFADC17039C (KernelBase.dll) in QtVideoApp.exe: WinRT originate error - 0xC004F011 : 'The text associated with this error code could not be found.'. avcore\audiocore\client\audioclient\audioclientcore.cpp(467)\AUDIOSES.DLL!00007FFAC4B6C7C7: (caller: 00007FFAC4B6C8ED) ReturnHr(1) tid(c94) 88890008 Exception thrown at 0x00007FFADC17039C (KernelBase.dll) in QtVideoApp.exe: WinRT originate error - 0xC00D5212 : 'Decoder error'.

Error 0xC004F011 is SL_E_LICENSE_FILE_NOT_INSTALLED

I am not able to install a suitable codec to play these videos

UVS050417-003-4.zip

DougRogers commented 1 year ago

MPEG-2 Video Extension is currently installed but does not appear to be recognized and used.

cjrog commented 1 year ago

Hi,

In order to properly determine why this is occurring, would you be able to collect traces while reproducing the error you have mentioned.

Instructions are as follows:

Logs Using latest mftracelog.exe

1. Download  
    - Download mftracelog.zip https://github.com/microsoft/media-foundation/releases/download/V1/mftracelog.zip
    - Unzip the downloaded file to obtain mftracelog.exe for x86, arm64 and amd64 platforms
    - Identify your machine's platform (amd64, x86, arm64) and open the corresponding folder   
2. Start tracing and reproduce the issue
    - If the repro involves Edge browser, close all Edge browser sessions
    - Launch mftracelog.exe by double-clicking on the file in File Explorer
    - Select "Simple" and "Full Traces" radio button in the mftracelog.exe UI and click "Start Tracing" button. 
    - Reproduce the issue. Try to capture the repro in less than 2 minutes, if possible, to avoid large trace file.
3. Stop tracing:
    - Click "Stop Tracing" button.  
    - This will generate several output files. File Explorer will automatically open to show four files. 
    - Select all four files and select "compress to zip file" through right-click menu to create a zip file  
4. Share the zip file 
DougRogers commented 1 year ago

trace log attached mftracelog.zip

You can just change the file name in MediaEngineDCompWin32Sample.cpp to repro the issue. That is what this trace is from.

isuru-c-p commented 1 year ago

MPEG2 video playback via the store codec pack is not supported in the sample app as it configures the MediaEngine to run in a browser compatibility mode:

THROW_IF_FAILED(creationAttributes->SetGUID(MF_MEDIA_ENGINE_BROWSER_COMPATIBILITY_MODE, MF_MEDIA_ENGINE_BROWSER_COMPATIBILITY_MODE_IE_EDGE));

You should be able to get MPEG2 video to play by removing the above line from MediaEngineWrapper::CreateMediaEngine in MediaEngineWrapper.cpp.

DougRogers commented 1 year ago

When that line is removed, the playback rate cannot be changed for videos that have played with no issues.

The video uploaded to this report does not play, either. Did you test it?