Jump to content

Need help to make a 4k video player


Recommended Posts

I recently stumbled upon a 4k(3840 x 2160) mp4 video file and tried to play it with my zPlayer and I couldn't. I could hear the audio, but I coudn't see the video. I thought that I couldn't play it because my monitor was 2k(1920 x 1080). Then I found that VLC and and Media Player played it flawlessly. Windows Media Player Legacy also played it, but the video stuttered and lagged frequently, with very high memory usage. I tried WMPlayer.ocx and it was about the same as WMP Legacy. So I conjecture that, even if I had a 4k monitor, winmm.dll or WMPlayer.ocx would not be fit to playback a 4k video.

Microsoft says that MCI is a legacy feature and has been superseded by MediaPlayer. Maybe MediaPlayer class is the way to go. But how? It would be very much appreciated if someone could guide me to implement MediaPlayer with AutoIt. Thanks in advance.

My desktop configuration is as follows:
CPU: AMD Ryzen 5 3400G with Radeon Vega Graphics 3.70 GHz
RAM: 8.00GB
OS: Windows 11
Monitor: 1920 x 1080
 

Link to comment
Share on other sites

Hey mate,

MediaPlayer is a winRT object (very early WinRT libraries here) , but it seems to work with a control used for UWP apps.  So I'd say its unlikely this will work but I'll have a crack.

We can certainly generate the MediaPlayer object, and the activation factory for the control:

#include "..\Include\WinRT.au3"
#include "..\Include\NameSpaces\Windows.Media.Playback.au3"
#include "..\Include\NameSpaces\Windows.UI.Xaml.Controls.au3"

_WinRT_Startup()

Local $pCtrlFactory = _WinRT_GetActivationFactory("Windows.UI.Xaml.Controls.MediaPlayerElement", "{77E525C3-EB17-4B8D-889D-1EA8ABDBD4EF}")
ConsoleWrite("Ctrl Factory: " & $pCtrlFactory & @CRLF  & @CRLF)

Local $pPlayer = _WinRT_ActivateInstance("Windows.Media.Playback.MediaPlayer")
_WinRT_DisplayInterfaces($pPlayer)


_WinRT_Shutdown()

The console output:

Ctrl Factory: 0x000002B7F0205958

(13,0) Supported Interfaces:
Class: Windows.Media.Playback.MediaPlayer
{381A83CB-6FFF-499B-8D64-2885DFC1249E} - IMediaPlayer
{3C841218-2123-4FC5-9082-2F883F77BDF5} - IMediaPlayer2
{EE0660DA-031B-4FEB-BD9B-92E0A0A8D299} - IMediaPlayer3
{BD4F8897-1423-4C3E-82C5-0FB1AF94F715} - IMediaPlayerSource
{82449B9F-7322-4C0B-B03B-3E69A48260C5} - IMediaPlayerSource2
{85A1DEDA-CAB6-4CC0-8BE3-6035F4DE2591} - IMediaPlayerEffects
{FA419A79-1BBE-46C5-AE1F-8EE69FB3C2C7} - IMediaPlayerEffects2
{30D5A829-7FA4-4026-83BB-D75BAE4EA99E} - IClosable
{00000038-0000-0000-C000-000000000046}
{80035DB0-7448-4770-AFCF-2A57450914C5} - IMediaPlayer4
{CFE537FD-F86A-4446-BF4D-C8E792B7B4B3} - IMediaPlayer5
{E0CAA086-AE65-414C-B010-8BC55F00E692} - IMediaPlayer6
{5D1DC478-4500-4531-B3F4-777A71491F7F} - IMediaPlayer7
{FA993888-4383-415A-A930-DD472A8CF6F7}

I haven't created libraries for Windows.UI.Xaml.Controls.X objects as of yet - (the generator skips over anything that doesn't directly extend "system.object"). I'll have a play over the weekend and report back if it yields anything.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...