Sorry for my late Reply, but sometimes I have to work.
@TRon
Still don't know, which OS You're using - VM, o.k., but which one. On Linux Mint it works for me with
Wine.
(see below "@TRon + justinpang", why this may be important.)
access violation when loading a wma file
I just tried it out on my WinXP:
Works - see attached '01_PlayingWMA_WinXP.jpg'.
But there is a Bug with Audio-only: When Seeking paused, there is no OnProgress-Event, so that the Player's WaveForm, Position, etc. are not updated.
BTW: Playing (among others) WMA-Files was
in 2014 the Reason for me to switch from
Fmod/FmodEx (= Audio-only) to FFmpeg as Decoder.
The source-code is a mess
No Comment - I did not write that. I can only confirm, that it works by and large.
Writing an AudioVideo-Player is much more complicated than Writing an Audio-Only-Player.
It's not only the AV-SyncingStuff like most People think.
Everyone is called upon to write some better Code. Wanted to try make it cross-plattform ... it doesn't seem to work at all
It definitively works.
I tried it on my WinXP SP3, Win7 Ultimate, Win10 and Linux Mint v17.2 + Wine v1.6.2 - all 32-bit.
If You want to make that Code cross-platform with FPC, see
here:
"I've replaced all Windows-API-Calls with SDL2-Calls to make it cross-plattform".
This is the BasicStructure for a working cross-plattform FFmpeg-based MediaPlayer with SDL2, written in FPC (not OOP).
it is not a direct copy of ff-play + ff-play uses an SDL window + You asked why ?
I wrote, that it's
"a direct Port ... to FPC-OOP" (this is not the same).
But,
it's a direct Copy of FFplay's Strategy for Rendering Multimedia-Files and -Streams, where he...
• completely left out the SDL2-EventLoop
• replaced all SDL2-Threads, -Mutexes and -ConditionVariables with Windows-dependent Code (again, why?)
• creates the SDL2-Window within his PlayerComponent, which is easy:
You just have to replace FFplay's 'SDL_CreateWindow()' with 'SDL_CreateWindowFrom()'.
I still ask "why?", because it makes no Sense at all to turn something cross-plattform into something plattform-dependent. :'(
@justinpang
Didn't try it on Win11, but should work.
Didn't try it with SDL2 v2.26.5, but should work.
On Win10 and Linux Mint + Wine, I use ffmpeg-6.1-588-4006c71-win32-shared-xpmod-sse + SDL2 v2.26.4.0.
On Win11, You may try
Somby's FFmpeg- and SDL2-Builds:
-> GoTo:
"FFMPEG/SDL2".
(Somby's WebSite obviously only exists in German, couldn't find an English Version.)
I downloaded and tested it yesterday on Win10:
Works - see attached '02_FFmpeg+SDL2-BuildsBySomby_Win10.jpg'.
I added the addtional DLLs ... And the Demo shows no error.
It depends on the Configuration of the FFmpeg-Build, whether those external DLLs are included in the corresponding FFmpeg-DLLs, or not.
Perhaps Reino's latest FFmpeg-Build includes DLLs that are still compatible with Win10, but no longer compatible with Win11 - don't know.
His Aim is to still generate
FFmpeg-Builds, which are compatible with WinXP 32-bit. You can see the current BuildConfiguration in the first Post.
@TRon + justinpang
On WinXP,
I had the same Error with several SDL2-Versions. The only SDL2-Version, that works on my WinXP is v2.0.14.0.
(Don't ask me why - I simply tried it out.)
If it still does not work after having tried out several SDL2-Versions, try this:-> GoTo Line #5877 in 'uexplayer.pas', and disable...
if (m and SDL_INIT_VIDEO)=0 then begin
if SDL_InitSubSystem(SDL_INIT_VIDEO)<0 then begin
raise Exception.CreateFMT(rsClassFunctionError,[classname,'SDL_InitSubSystem(SDL_INIT_VIDEO)',SDL_GetError]);
end;
FSDLSubSystems:=FSDLSubSystems or SDL_INIT_VIDEO;
end;
This is not from the original C-File; Somby added it - FFplay uses 'SDL_Init() + Flags'.
Last but not least, don't forget that Somby wrote his own minimal FPC-Wrappers for FFmpeg and SDL2.
So maybe the Problem is there.
I use in my FFPlay4Laz-Project
FFmpeg-Wrapper from FFVCL and
SDL2-Wrapper by Tim Blume - Works.