The MASM Forum

Members Gallery => Showcase => Topic started by: fearless on August 29, 2024, 04:05:42 AM

Title: MediaPlayer
Post by: fearless on August 29, 2024, 04:05:42 AM
A basic media player application written in x86 and x64 assembler that utilizes the MFPlayer-Library (https://github.com/mrfearless/MFPlayer-Library) - which consists of functions that wrap the MFPlay (https://learn.microsoft.com/en-us/previous-versions/windows/desktop/api/mfplay/) COM implementation of the IMFPMediaPlayer (https://learn.microsoft.com/en-us/previous-versions/windows/desktop/api/mfplay/nn-mfplay-imfpmediaplayer) and IMFPMediaItem (https://learn.microsoft.com/en-us/previous-versions/windows/desktop/api/mfplay/nn-mfplay-imfpmediaitem) objects.

(https://i.postimg.cc/qhbJyF4N/mediaplayer-75.png) (https://postimg.cc/qhbJyF4N)


https://github.com/mrfearless/MediaPlayer (https://github.com/mrfearless/MediaPlayer)

Features


Download

The latest releases can be downloaded at https://github.com/mrfearless/mediaplayer/releases (https://github.com/mrfearless/mediaplayer/releases)

Edit: Updated to attach v1.0.0.5 releases and update screenshot.
Title: Re: MediaPlayer
Post by: Vortex on August 29, 2024, 04:22:51 AM
Hi fearless,

My compliments, very nice work :thumbsup:
Title: Re: MediaPlayer
Post by: fearless on August 29, 2024, 04:33:05 AM
Thanks.

There is more features that could be added to it or design changes like proper fullscreen without the controls at the bottom - which was a design choice as I didnt want to go to that length of effort to hide/show them when the mouse was over the video window etc. And stuff like playlist support could be added. But the MediaPlayer application is mainly to verify that the MFPlayer library works ok, but could be a basis for a more fully featured media player in future, or it could be all wrapped up in a single custom control.
Title: Re: MediaPlayer
Post by: Biterider on August 29, 2024, 05:22:56 AM
Very nice work, compliments  :thumbsup:

Biterider
Title: Re: MediaPlayer
Post by: jj2007 on August 29, 2024, 03:50:07 PM
Excellent, my compliments :thumbsup:

Ctrl O seems not to work here on Win10, and I couldn't open a *.ogg file that opens fine with Windows. You might add dragging files on the window.

Otherwise flawless and cute :thup:
Title: Re: MediaPlayer
Post by: greenozon on August 29, 2024, 10:04:51 PM
Wow, exciting work, congrats!

PS can't eat japanese hieroglyphs  in movies names any chance?
Title: Re: MediaPlayer
Post by: fearless on August 30, 2024, 12:27:08 AM
Thanks.

@jj2007 - unfortunately the Microsoft Media Foundation doesn't seem to support .ogg files. Just these one listed here: https://learn.microsoft.com/en-us/windows/win32/medfound/supported-media-formats-in-media-foundation (https://learn.microsoft.com/en-us/windows/win32/medfound/supported-media-formats-in-media-foundation)

Drag and drop is included in it, but from reports it seems it might not be working for some people. I found a few interesting forum posts and blogs relating to drag and drop not working properly: https://forum.pellesc.de/index.php?topic=5852.0 (https://forum.pellesc.de/index.php?topic=5852.0) and https://helgeklein.com/blog/how-to-enable-drag-and-drop-for-an-elevated-mfc-application-on-vistawindows-7/ (https://helgeklein.com/blog/how-to-enable-drag-and-drop-for-an-elevated-mfc-application-on-vistawindows-7/)

So I guess I will look into that and use the findings there to adjust, and hopefully it will work for others. Currently I'm running Win10 Pro with a user with admin rights and UAC disabled, which is probably why it seems to work for me.

@greenozon - working on Unicode versions right now, which hopefully will tackle the issues raised on the github repo.
Title: Re: MediaPlayer
Post by: jj2007 on August 30, 2024, 07:31:53 AM
Quote from: fearless on August 30, 2024, 12:27:08 AMunfortunately the Microsoft Media Foundation doesn't seem to support .ogg files.

I vaguely remember that I had to install a codec pack to make them run.
Title: Re: MediaPlayer
Post by: greenozon on August 31, 2024, 05:03:40 PM
Will it render modern videos encoed by H.265, AV1, or more newwer one?
Title: Re: MediaPlayer
Post by: fearless on August 31, 2024, 06:05:56 PM
If you have the hevc codec installed it should work: https://www.windowscentral.com/how-open-heic-and-hevc-files-windows-10s-photos-app (https://www.windowscentral.com/how-open-heic-and-hevc-files-windows-10s-photos-app)

I have the paid hevc codec version from the Microsoft store (few euros) and it displays a .mkv file with the codec: MPEG-H Part2/HEVC H.265 (shown in vlc the codec info)
Title: Re: MediaPlayer
Post by: satpro on August 31, 2024, 06:07:28 PM
I really like your coding style.  Concise.

The program runs fine on Win 11.  It's FAST.  I tested a bunch of files without a glitch.
Title: Re: MediaPlayer
Post by: greenozon on August 31, 2024, 06:38:25 PM
OMG
there is already H.266 (AKA  VVC codec)

did you give it a try as well?
Title: Re: MediaPlayer
Post by: greenozon on August 31, 2024, 06:45:45 PM
I"ve found a very nice collection of modern codec small video samples:  https://www.elecard.com/videos (https://www.elecard.com/videos)

it plays only H.264 out of that zoo, unfortunately...

any chance to add support?
(MPC-HC plays 100%)
Title: Re: MediaPlayer
Post by: Mikl__ on August 31, 2024, 07:34:06 PM
Hi fearless,

Very very nice!
Title: Re: MediaPlayer
Post by: fearless on September 02, 2024, 06:12:32 AM
v1.0.0.1

https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.1 (https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.1)

Title: Re: MediaPlayer
Post by: Vortex on September 02, 2024, 06:19:01 AM
Hi fearless,

Visiting your GitHub page, I downloaded the new version, keep up the good work :thumbsup:
Title: Re: MediaPlayer
Post by: fearless on September 02, 2024, 07:29:01 AM
Thanks Vortex.

A small bug found its way into the x64 version, I have since updated it to fix that, and uploaded it to github and here.
Title: Re: MediaPlayer
Post by: fearless on September 05, 2024, 05:49:46 AM
v1.0.0.2

https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.2 (https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.2)

Title: Re: MediaPlayer
Post by: greenozon on September 05, 2024, 07:13:41 AM
great news!
quick quesiton: where do you keep the ini file? I didn't find it nearby the exe :)
Title: Re: MediaPlayer
Post by: fearless on September 05, 2024, 09:16:14 AM
I keep it in the AppData\Roaming\MediaPlayer folder, which is the recommended place for applications, that wont be affected by Windows complaining or blocking write access - like say if it was installed in Program Files\MediaPlayer and the ini file was located in the same folder. This way a user could place MediaPlayer.exe in one of those protected folders, and it should work fine, as the ini file is located elsewhere.

Located at:
C:\Users\<UserName>\AppData\Roaming\MediaPlayer\⏯ MediaPlayer.iniReplace <UserName> with your own name, for example:

C:\Users\greenozon\AppData\Roaming\MediaPlayer\⏯ MediaPlayer.ini
Title: Re: MediaPlayer
Post by: greenozon on September 05, 2024, 03:51:46 PM
thanks! nice
but why do you have that strange symbol - "⏯" in the path?
just curious

https://prnt.sc/1Wr43FDjDXqo (https://prnt.sc/1Wr43FDjDXqo)

also why 2 ini files?
Title: Re: MediaPlayer
Post by: fearless on September 05, 2024, 08:13:47 PM
The unicode glyph "⏯" is the play/pause button, used as a hint to someone looking at the .ini file that perhaps as it has a unicode symbol in the name, then perhaps the file also is unicode format.

If someone edits the ini file with notepad or other basic text editor, instead of say notepad++ (which has support for reading the unicode file and writing to it properly) then the BOM byte markers at the beginning of the file (FFh,FEh) will be destroyed, thus rendering the ini file useless as the wide versions of the GetPrivateProfileString, WritePrivateProfileString wont work.

Instead, I check the ini file for the BOM presence and if its not there the ini file gets re-created anew with the BOM - and thus will also delete anything that was in the unreadable non-unicode ini file.

The Ansi version of the ini file doesnt have the play/pause glyph, and is not used, unless you recompile MediaPlayer without the unicode support. It is a leftover from when the first version of MediaPlayer was not compiled with unicode support. You can safely delete it.
Title: Re: MediaPlayer
Post by: fearless on September 14, 2024, 03:27:34 AM
v1.0.0.3

https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.3 (https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.3)


Title: Re: MediaPlayer
Post by: NoCforMe on September 14, 2024, 04:12:19 AM
Quote from: fearless on September 14, 2024, 03:27:34 AMReduced size of resources with sorcery and dark magic.

Now that's the kind of programming we all want to hear about!
Title: Re: MediaPlayer
Post by: fearless on September 14, 2024, 06:00:07 AM
Just updated the x64 version in the post above, it had a tiny crash, so fixed that and re-uploaded it.
Title: Re: MediaPlayer
Post by: greenozon on September 15, 2024, 01:26:01 AM
Never before had I seen the resources in such a cryptic format *.rtlc

it should be some new revolutionary SW magic, isnt' it? :)
Title: Re: MediaPlayer
Post by: vitsoft on September 15, 2024, 04:43:22 AM
x64 version works well, including drag&drop, thank you  :eusa_clap: 

I play music noninteractively with a script, using an old Media Player Classic from Windows XP, which can shut itself down when the song is over: 
mplayerc.exe /Play /Close "aSong.mp3"

I'd like to replace mplayerc.exe with your MediaPlayer.exe but it doesn't seem to accept command-line arguments except for the file name.
Would it be possible to accept the /Close parameter please?
Title: Re: MediaPlayer
Post by: fearless on September 15, 2024, 06:20:36 AM
@vitsoft - Yes I will add that feature in the next version.
Title: Re: MediaPlayer
Post by: fearless on September 25, 2024, 06:21:10 AM
v1.0.0.4

https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.4 (https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.4)

Title: Re: MediaPlayer
Post by: greenozon on September 25, 2024, 04:04:18 PM
fantastic progress, kudos!
Title: Re: MediaPlayer
Post by: ognil on September 26, 2024, 01:22:34 AM
Great job fearless, :thumbsup:  :thumbsup:

Any clue how to play .mp4 files from the link via your player?

Link: https://www.elecard.com/videos (https://www.elecard.com/videos)

Thank you.
Title: Re: MediaPlayer
Post by: fearless on September 26, 2024, 01:58:04 AM
I tested those media files and others a few weeks ago and found the only ones I could get to play where:

City Hall - AV01
Ushaika river emb. - VP9
Tomsk State University - HEVC/H.265
Tomsk Theater Square - AVC/H264

The other ones did not work.

It may be that certain codecs are required to be installed to get those files to play, especially the HEVC/H.265 - I have the Microsoft HEVC codec installed, purchased from the Microsoft Store.
Title: Re: MediaPlayer
Post by: Biterider on September 26, 2024, 05:43:33 AM
Hi fearless
Nice lean and efficient interface. Congrats  :thumbsup:

Biterider
Title: Re: MediaPlayer
Post by: greenozon on September 26, 2024, 03:51:33 PM
Quote from: fearless on September 26, 2024, 01:58:04 AMI have the Microsoft HEVC codec installed, purchased from the Microsoft Store.

0.99$ is the price for it?

https://apps.microsoft.com/detail/9nmzlz57r3t7?hl=en-US&gl=US (https://apps.microsoft.com/detail/9nmzlz57r3t7?hl=en-US&gl=US)
Title: Re: MediaPlayer
Post by: fearless on September 26, 2024, 07:37:14 PM
@Biterider - thanks. Yes I try to keep the UI simple and clean. Still a few more things that I want to add to it.

@greenozon - yes thats the one, cost me about €1. Also looking at the MS Store, I have the AV1 Video Extension installed as well.
Title: Re: MediaPlayer
Post by: fearless on September 28, 2024, 01:21:45 AM
v1.0.0.5

https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.5 (https://github.com/mrfearless/MediaPlayer/releases/tag/1.0.0.5)