Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Programming and Hacking > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd September 2020, 23:30   #1  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 705
Windows XP compatible non-SSE2 FFmpeg binaries

On Zeranoe's forum I had a topic where once every 4 months I would post new FFmpeg binaries that are Windows XP compatible and will work on old CPUs without SSE2 instruction sets (like my own AMD Athlon XP 3200+).
Because Zeranoe took down his forum not so long ago I thought I'd create a topic here on Doom9 in the hope some of you might still find these binaries useful.

This all began end 2016 when (as far as I could tell) no one was willing to create WinXP- and old-CPU compatible FFmpeg binaries anymore.
Windows XP doesn't support TLS 1.2 and the latest compatible FFmpeg binary back then couldn't open TLS 1.2 encrypted https-urls either, which a lot of websites started using. This was the main reason I wanted to see if I could compile my own FFmpeg binaries. With the help of a third-party cryptography-library (OpenSSL, GnuTLS, or MbedTLS) I could solve that issue.
I had never compiled software before. In fact, it was literally my first encounter with Linux (Cygwin) Bash! But after my first attempts I forked Roger Pack's cross-compilation-script and the rest is history.

Binaries: https://rwijnsma.home.xs4all.nl/files/ffmpeg/?C=M;O=D
Github: https://github.com/Reino17/ffmpeg-windows-build-helpers

My FFmpeg binaries are compiled with --enable-libfdk-aac, but they don't contain the actual code because of an incompatible license. You can download libfdk-aac separately here and put the dll-file in the same folder as 'ffmpeg.exe', or in any folder listed in the %PATH%-variable.
This was made possible with the help of a patch created by Gianluigi Tiesi.

My FFmpeg binaries are also compiled with --enable-frei0r. You can download frei0r video filtering plugins separately here and put the 'frei0r-1' folder in the same folder as 'ffmpeg.exe'.
This was also made possible with the help of a patch created by Gianluigi Tiesi.

Build-configuration:

Code:
--arch=x86
--target-os=mingw32
--prefix=/cygdrive/[...]/cross_compilers/mingw-w64-i686/i686-w64-mingw32
--cross-prefix=/cygdrive/[...]/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-
--extra-cflags='-O2 -march=pentium3 -mtune=athlon-xp -mfpmath=sse -msse'
--pkg-config=pkg-config --pkg-config-flags=--static
--extra-version=Reino
--enable-gpl
--enable-gray
--enable-version3
--disable-bcrypt
--disable-debug
--disable-doc
--disable-htmlpages
--disable-manpages
--disable-mediafoundation
--disable-podpages
--disable-txtpages
--disable-w32threads
--enable-avisynth
--enable-frei0r
--enable-filter=frei0r
--enable-gmp
--enable-libaom
--enable-libass
--enable-libfdk-aac
--enable-libflite
--enable-libfontconfig
--enable-libfreetype
--enable-libfribidi
--enable-libgme
--enable-libjxl
--enable-libmp3lame
--enable-libopenmpt
--enable-libopus
--enable-librubberband
--enable-libsoxr
--enable-libtwolame
--enable-libvidstab
--enable-libvorbis
--enable-libvpx
--enable-libwebp
--enable-libx264
--enable-libx265
--enable-libxml2
--enable-libxvid
--enable-libzimg
--enable-mbedtls
Changelog 01-09-2024:
Code:
FFmpeg buildscript:
  xz          5.4.6 --> 5.6.2
  SDL2       2.30.3 --> 2.30.6
  freetype   2.13.2 --> 2.13.3
  mbedtls    2.28.8 --> 2.28.9
  mpg123     1.32.6 --> 1.32.7
  libopenmpt  0.7.6 --> 0.7.9
  harfbuzz    8.4.0 --> 9.0.0
  *git              --> latest commit

  ffmpeg 7.1-596-5bc3b7f (N-115062) --> 7.1-2362-6aafe61 (N-116828)

Optional external libraries for use with FFmpeg:
  frei0r-plugins 2.3.2-16-fdc9f32 --> 2.3.3-3-cbb507d
__________________
My hobby website

Last edited by Reino; 1st September 2024 at 22:26. Reason: New binaries
Reino is offline   Reply With Quote
Old 3rd September 2020, 02:47   #2  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
Many thanks...

I already downloaded the new builds, also the new ffms2 C-plugin. Will start testing right away. And it is good to see you supporting your builds here at Doom9, should give you more visibility compared to the deceased Zeranoe forum.

Cheers
manolito
manolito is offline   Reply With Quote
Old 3rd September 2020, 05:23   #3  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
Sorry, no joy this time with both ffmpeg builds (static and shared)...

The new ffms2 build seems to work fine so far (only made two test encodes). But both ffmpeg builds crash immediately after calling them. I get the old error popup which is very familiar. No idea if it is WinXP, or if the missing SSE2 capability causes it.



Cheers
manolito
manolito is offline   Reply With Quote
Old 3rd September 2020, 23:31   #4  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 705
Quote:
Originally Posted by manolito View Post
I get the old error popup which is very familiar.
Hmm, this is very strange, because here on WinXP Pro SP3 my binaries run just fine.
Doing a search for "NtCreateFile" returns:
Code:
[...]\i686-w64-mingw32\include\ddk\ntifs.h
[...]\i686-w64-mingw32\include\winternl.h
[...]\i686-w64-mingw32\lib\libntdll.a
[...]\i686-w64-mingw32\lib\libntoskrnl.a
These are all MinGW-w64 7.0.0 files. My binaries from 4 months ago were also already compiled with MinGW-w64 7.0.0 and if I remember correctly you didn't have any problems with these binaries. At the moment I don't know what to make of this.

Quote:
Originally Posted by lvqcl View Post
I'm using Cygwin 2.874, the latest WinXP compatible version. And I'm not using winpthreads, but pthreads-w32.
It could be that something else in the MinGW-w64 buildscript is causing this though.
__________________
My hobby website
Reino is offline   Reply With Quote
Old 4th September 2020, 00:54   #5  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
Quote:
Originally Posted by Reino View Post
My binaries from 4 months ago were also already compiled with MinGW-w64 7.0.0 and if I remember correctly you didn't have any problems with these binaries.
Correct, your binaries from 4 months ago do run just fine on my old computer...

My system is absolutely standard, the CPU is an Intel Celeron Coppermine 1.1 GHz.



If you need any more information, just let me know. For now I am back to the older version...
BTW the new libfdk DLL works just fine with the older ffmpeg binary. Is it safe to use it, or are there any catches?
manolito is offline   Reply With Quote
Old 4th September 2020, 16:04   #6  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 705
Maybe you could run the binary through Dependency Walker and see what it has to say.

I also came across "Bugs in NTDLL.dll of non-english editions of Windows® XP". This website claims - if I understand correctly - the issue you're experiencing could be a bug in 'NTDLL.dll' of your German Windows XP because of a specific security update.
__________________
My hobby website
Reino is offline   Reply With Quote
Old 3rd September 2020, 09:09   #7  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,029
Sweet. I still gotta test the new builds, but just like I said on MSFN last year: Doom9 is the international encoding forum and pretty much everyone is here, so you're definitely gonna have more visibility than on the zeranoe's forum.
Anyway, thank you for the builds, I'll try them as soon as I get back home!
FranceBB is offline   Reply With Quote
Old 3rd September 2020, 09:52   #8  |  Link
lvqcl
Registered User
 
Join Date: Aug 2015
Posts: 309
The error text in english is probably this:
"The NtCreateFile API failed. This error should never be returned to an application, it is a place holder for the Windows Lan Manager Redirector to use in its internal error mapping routines"

Also, found this: https://github.com/msys2/MINGW-packa...ment-479645419
lvqcl is offline   Reply With Quote
Old 5th September 2020, 10:29   #9  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,992
No idea if anybody can make any sense out of below,
is KDiff of both results from dependency walker posted by Mani,
Left is from older one "ffmpeg-4.3-3133-1128aa8-win32-static-xpmod-sse.dwi", right from newer "ffmpeg-4.4-853-276d86a-win32-static-xpmod-sse.dwi".
At the end, older working one is cut off after new one exits with error.

As Png files [for those that dont have kdiff or other installed]

1)

2)

3)

4)

5)

EDIT: I missed out less interesting/matching sections.
EDIT: Old one fails to find module QUSEREX.dll, new fails to find MFPLAT.dll.

Quote:
Could it be that your latest builds rely on some Windows Media Foundation functions which are not available under WinXP? Is it possible to remove the Media Foundation requirements from the build script?
MFPLAT.dll. might be media foundation.
uses these from MFPLAT.dll
Code:
MFCreateAlignedMemoryBuffer
MFCreateMediaType
MFCreateSample
MFShutdown
MFStartup
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 5th September 2020 at 10:55.
StainlessS is offline   Reply With Quote
Old 5th September 2020, 13:37   #10  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 705
Hmm, this is getting weirder and weirder.
Quote:
Originally Posted by manolito View Post
And I really wonder why these new binaries work on your AMD Athlon CPU...
Maybe the fact that I'm using a highly optimized WinXP iso has something to do with it. I don't know.


As far as the "The NtCreateFile API failed"-error is concerned, it's really strange that only your German localized WinXP suffers from this. FranceBB, your WinXP is English (International)?
I can't imagine any of the changes in 'cross_compile_ffmpeg.sh' are the cause of this, so this night I'll put my pc to work and revert gcc to 9.3.0 and maybe revert binutils and the others too.

[edit]
Quote:
Originally Posted by StainlessS View Post
Old one fails to find module QUSEREX.dll
Here too:
Code:
LoadLibraryA("C:\WINDOWS\system32\QUSEREX.DLL") called from "FFMPEG-4.4-853-276D86A-WIN32-STATIC-XPMOD-SSE.EXE" at address 0x01AEBA86.
LoadLibraryA("C:\WINDOWS\system32\QUSEREX.DLL") returned NULL. Error: The specified module could not be found (126).
GetProcAddress(0x00000000, "QueueUserAPCEx_Init") called from "FFMPEG-4.4-853-276D86A-WIN32-STATIC-XPMOD-SSE.EXE" at address 0x01AEB915 and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x77C10000 [MSVCRT.DLL], "___lc_codepage_func") called from "FFMPEG-4.4-853-276D86A-WIN32-STATIC-XPMOD-SSE.EXE" at address 0x0270D40E and returned 0x77C330F4.
I have no idea what it is, but at least it doesn't crash the binary. Loading Gianluigi (Sherpya) his binary in Dependency Walker I don't get this log message.
[/edit]
Quote:
Originally Posted by lvqcl View Post
I suppose that the latest binaries were built on a modern computer and MediaFoundation encoder was auto-enabled.
Then the obvious solution is to recompile it with --disable-mediafoundation option.
No, I also compile on my AMD Athlon XP pc.
In 'ffbuild/config.log' I can indeed see mediafoundation=yes. Even though there's no reason not to autodetect MediaFoundation, because FFmpeg doesn't support WinXP anymore after all, it's really strange it is detected in my case. I guess I'll have to add --disable-mediafoundation.
__________________
My hobby website

Last edited by Reino; 5th September 2020 at 13:46.
Reino is offline   Reply With Quote
Old 5th September 2020, 18:12   #11  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
Problem solved...

Reino just sent me a test build compiled with "--disable-mediafoundation", and this build works without any problems.

Thanks so much to Reino,

Cheers
manolito
manolito is offline   Reply With Quote
Old 5th September 2020, 22:48   #12  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,029
Quote:
Originally Posted by Reino View Post
FranceBB, your WinXP is English (International)?
Yep. EN US (International).
I changed it in 2013 as I didn't like the localized one I had from 2001 to 2013 anymore and I wanted everything to be in English. (There's probably a post on MSFN buried somewhere in the XP section)

Quote:
Originally Posted by manolito View Post
Problem solved...

Reino just sent me a test build compiled with "--disable-mediafoundation", and this build works without any problems.
I'm glad that it's working fine on your end as well now.
Anyway, thank you Reino and long live to XP.
FranceBB is offline   Reply With Quote
Old 5th September 2020, 23:12   #13  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 705
I guess it was --disable-mediafoundation after all. So no need to revert anything in the MinGW-w64 buildscript.
I've recompiled and replaced all 3 FFmpeg archives, as well as FFMS2, just to be sure.
__________________
My hobby website
Reino is offline   Reply With Quote
Old 6th September 2020, 00:40   #14  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
Beautiful, your new builds work nicely...

FWIW you mentioned that you use a patch by Sherpya for your builds. Sherpya's FFmpeg builds used to be XP compatible on my ancient XP machine, but not any more. His latest build from June 2020 crashes right on startup with the same error popup as your build before the fix.

Looks like for XP users your builds are now the only game in town...
manolito is offline   Reply With Quote
Old 5th September 2020, 12:39   #15  |  Link
lvqcl
Registered User
 
Join Date: Aug 2015
Posts: 309
From ffmpeg Changelog:
Quote:
version 4.3:
...
- MediaFoundation encoder wrapper
from configure:
Quote:
--enable-mediafoundation enable encoding via MediaFoundation [auto]
I suppose that the latest binaries were built on a modern computer and MediaFoundation encoder was auto-enabled.
Then the obvious solution is to recompile it with --disable-mediafoundation option.
lvqcl is offline   Reply With Quote
Old 5th September 2020, 13:05   #16  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,029
Actually, I haven't experienced the same problems you guys are facing.
It might be because of several reasons, but on my computer it works like a charm: Screenshot

Windows XP x86 all updates + POSReady Updates 'till June 2019 + custom kernel with PAE Enabled.
My Intel Xeon CPU supports SSE, SSE2, SSSE3, SSE4.1, SSE4.2, though.
I'm not sure whether the issues you guys are facing are related to your CPU instructions set or if it's due to the fact that I'm using One Core API (custom kernel with backported functions).
Anyway, it works over here. Same goes for ffms2 C plugin which works like a charm.

Last edited by FranceBB; 5th September 2020 at 13:11.
FranceBB is offline   Reply With Quote
Old 6th September 2020, 01:57   #17  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,992
Big up to Reino, thanks very much
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 6th September 2020, 12:15   #18  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,589
your build remind me of this

btw, is build for xp mean remove some of the features from ffms2 and ffmpeg? or they the same as non-xp one?
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 1st May 2021, 03:51   #19  |  Link
patul
Registered User
 
Join Date: Sep 2005
Posts: 130
Quote:
WINDRES libavdevice/avdeviceres.o
/bin/sh: /cygdrive/[...]/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-gcc -E -xc-header
-DRC_INVOKED -MMD -MF libavdevice/avdeviceres.d -MT libavdevice/avdeviceres.o: No such file or directory
/cygdrive/m/[...]/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-windres: preprocessing failed.
make: *** [ffbuild/common.mak:93: libavdevice/avdeviceres.o] Error 1
Perhaps windres.exe (part of binutils) was the problem, maybe you can try to use previous working version?
patul is offline   Reply With Quote
Old 2nd May 2021, 15:18   #20  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 705
Quote:
Originally Posted by patul View Post
Perhaps windres.exe (part of binutils) was the problem, maybe you can try to use previous working version?
Too late I noticed "windres error with binutils 2.36.1" and the suggested fix, because I had already started a complete re-run with binutils 2.35.2.
Anyway, going back to 2.35.x proved successful. Thanks.

I've just uploaded new ffmpeg binaries and removed the "old" static one.
__________________
My hobby website
Reino is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:51.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.