News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Video-player for mp4-files

Started by Mikl__, December 12, 2023, 06:36:35 PM

Previous topic - Next topic

Mikl__

Hi, All!
Does anyone have a small and simple asm-example/sample for video-player mp4-files?
Thanks in advance for your answer!

jj2007

I wish I had an example, and indeed I had one, but it stopped working on Win10 :sad:

To give you a hint:

IMediaControl STRUCT
QueryInterface dd ?
AddRef dd ?
Release dd ?
GetTypeInfoCount dd ?
GetTypeInfo dd ?
GetIDsOfNames dd ?
Invoke_ dd ?
Run dd ?
Pause_ dd ?
Stop dd ?
GetState dd ?
RenderFile dd ?
AddSourceFilter dd ?
get_FilterCollection dd ?
get_RegFilterCollection dd ?
StopWhenReady dd ?
IMediaControl  ENDS

TimoVJL

May the source be with you

Mikl__

Ciao jj2007!
Perhaps you are talking about this?
Win x64 Tutorial #37f: video-player and Component Object Model
The program worked well in Win7-64, but stopped understanding the mp4-format and now I have problems in Win10. I thought you would tell me what I could replace it
Hello Timo! I'll try... Can you write a little more detail?

TimoVJL

#4
My retired Windows 8.1 Bing was able to have some additional codecs and many movies worked there.

Now MS offer that:
https://support.microsoft.com/en-us/topic/media-feature-pack-list-for-windows-n-editions-c1c6fffa-d052-8338-7a79-a4bb980a700a
May the source be with you

Mikl__


jj2007

Quote from: jj2007 on December 12, 2023, 08:45:26 PMI had one, but it stopped working on Win10

Hi Mikl,

I installed the Win10 codec from https://www.windows10codecpack.com, and now it works (I recently switched from my old Win7 notebook to the Win10 notebook I bought over a year ago, so certain things stopped working, as usual...).

Here is a central piece of code (the complete program is too chaotic to be posted here...):
IGB STRUCT
pigb    dd ?    ; --- current video ---
pimc    dd ?    ; IMediaControl
pimx    dd ?    ; IMediaEventEx
piba    dd ?    ; IBasicAudio
pims    dd ?    ; IMediaSeeking
pigw    dd ?    ; IVideoWindow
IGB ENDS       ; v v v expands to AM_SEEKING_NoPositioning etc v v v
Enum    #AM_SEEKING_, 0:NoPositioning, AbsolutePositioning, RelativePositioning, IncrementalPositioning, PositioningBitsMask, SeekToKeyFrame, ReturnTime, Segment, NoFlush
...
  invoke CoCreateInstance, addr CLSID_FilterGraph, 0, CLSCTX_INPROC_SERVER, addr IID_IGraphBuilder, addr igb.pigb
  .if !eax                        ; create a new filter using IGraphBuilder
xchg eax, ebx ; flag
or ebx, rvCoInvoke(igb.pigb, IGraphBuilder.QueryInterface, offset IID_IMediaControl, addr igb.pimc)
or ebx, rvCoInvoke(igb.pigb, IGraphBuilder.QueryInterface, offset IID_IMediaEventEx, addr igb.pimx)
or ebx, rvCoInvoke(igb.pigb, IGraphBuilder.QueryInterface, offset IID_IBasicAudio, addr igb.piba)
or ebx, rvCoInvoke(igb.pigb, IGraphBuilder.QueryInterface, offset IID_IVideoWindow, addr igb.pigw)
or ebx, rvCoInvoke(igb.pigb, IGraphBuilder.QueryInterface, offset IID_IMediaSeeking, addr igb.pims)
.if Zero? ; if !ebx then everybody returned S_OK above
                CoInvoke igb.pigb, IGraphBuilder.RenderFile, CurrentFile$, 0        ; CurrentFile$ can be a URL

Siekmanski

Another DirectShow example with direct access to the pixeldata.

https://masm32.com/board/index.php?msg=68128
Creative coders use backward thinking techniques as a strategy.

TimoVJL

So time to test it with Windows 11 ?
Or is there some secrecy, what works in Windows 11 ?
May the source be with you

JoeBr

Think you can also use ffmpeg/ffplay - Hutch had an example on that through a Shell/ CreateProcess call.

Joe

Mikl__

Thank very much Marinus, Jochen, Timo and JoeBr!