Making Zeranoe builds work under XP & XP builds by rogerdpack

Any other question that don't fit into the other support categorizes.
cdlvcdlv
Posts: 28
Joined: Tue Mar 15, 2016 9:55 am

Making Zeranoe builds work under XP & XP builds by rogerdpack

Post by cdlvcdlv » Wed Apr 06, 2016 8:41 pm

- Last Zeranoe build that works on XP without patching: 5156578 (26-Feb-2016 22:07).
- Last Zeranoe build that works on XP with this patch: f41e37b (13-Jul-2016 22:10).
- You can also try rogerdpack XP compatible builds.
rogerdpack wrote:I try to do some xp compat. builds for my own here, anybody want to try them out?

https://sourceforge.net/projects/ffmpeg ... rce=navbar
------------------------------------------------------------
The following applies to Zeranoe builds from 29-Feb-2016 to 13-Jul-2016 22:10 incl. and it is not working with the latest builds.

It works with both static and shared (thanks, manolito) builds (32 and 64 bits). Thanks to 2225936589, that registered in this forum just to provide the solution.
2225936589 wrote:If you want to run in xp
You need to modify the ffmpeg ffplay
Use winhex Find _wfopen_s, then changed _wfopen
Note things _s (hex 5F 63) -> (00 00)
There are three similar functions also need to be modified
Thanks also to stahlworks for Swiss File Knife.

1.- Download last version of FFmpeg and un-7zip it.
2.- Download sfk (http://swissfileknife.sourceforge.net/).
3.- Rename the last version of sfk (it will be sfkxxx.exe) to sfk.exe.
4.- Create a FixFF4XP.bat with the following code:

Code: Select all

@for %%a in (/7363616E665F73/7363616E660000/ /7374726E6370795F73/7374726E6370790000/ /5F77666F70656E5F73/5F77666F70656E0000/ /737472746F6B5F73/737472746F6B0000/) do sfk replace -binary %%a -dir bin -file .exe .dll -yes
5.- Place both FixFF4XP.bat and sfk.exe in FFmpeg folder (the main one, parent of bin), next to ff-prompt.bat and README.txt.
6.- Double click FixFF4XP.bat.

You should have now working versions of ffmpeg.exe, ffplay.exe and ffprobe.exe under XP.

If you want to watch the .bat work, open cmd.exe in the folder of the .bat and run it. You may also add a pause command at the end of the bat to see what happened before it closes.

When a new version of FFmpeg is available, only steps 1 and 6 are needed to keep easily your XP with FFmpeg up-to-date.
Edit:
Although this is not exclusively for XP, I add a way to keep FFmpeg updated without user interaction. I assume you have 7zip installed (you must find 7z.exe in your installation and change the sixth line accordingly), a copy of wget somewhere and know how to schedule a task in Windows to be run daily.

Create updateFF.bat with the following commands and put it next to FixFF4XP.bat:

Code: Select all

@echo off
setlocal
set ffver=32
if "%1"=="64" set ffver=64
wget -N --no-check-certificate https://ffmpeg.zeranoe.com/builds/win%ffver%/static/ffmpeg-latest-win%ffver%-static.7z
7z x ffmpeg-latest-win%ffver%-static.7z -o. *
for /d %%a in (ffmpeg-*) do set ffdir=%%a
xcopy /e /h /r /y /k %ffdir%\*.* .
rmdir /s /q %ffdir%
call FixFF4XP
endlocal
It just remains to add a scheduled task in Windows.

Note:
That leaves the ffmpeg-latest-win[32|64]-static.7z file in the FFmpeg folder but, on the other hand, it allows wget (with -N) to check the date against the one in ffmpeg site and save the downloading if there's no new version.

updateFF 64 downloads the latest x64 build. Passing any other first parameter (or none), the 32-bits one.

-------------------------
2016/07/03 added strtok_s to be replaced.
Last edited by cdlvcdlv on Fri Aug 19, 2016 10:41 pm, edited 15 times in total.

minotech
Posts: 5
Joined: Sat Apr 09, 2016 10:05 pm

Re: Making last version of FFmpeg work under XP

Post by minotech » Sat Apr 09, 2016 10:31 pm

This FixFF4XP.bat and sfk.exe FIX worked perfectly for me. The 'BAT' file does NOT go in the BIN folder; rather the MAIN one. I ran it from a CMD.EXE window, and you can 'watch it work' that way to verify that there are NO ERRORS. I was AMAZED that I was able to find this FIX for my WinXP problem. THANKS a LOT!

cdlvcdlv
Posts: 28
Joined: Tue Mar 15, 2016 9:55 am

Re: Making last version of FFmpeg work under XP

Post by cdlvcdlv » Tue Apr 12, 2016 7:44 am

Glad to help. :)

You're right, maybe I did not explain myself very well. Indeed, sfk.exe and FixFF4XP.bat go in FFmpeg folder, i.e. the parent of bin (bin is the one that contains ffmpeg.exe, ffplay.exe and ffprobe.exe).

That is, the main folder is another way to name it. It contains ff-prompt.bat and README.txt also. I'll edit the first post to make it more clear.

I found a way to automate it, but the idea was not mine. I'll add the proper acknowledgement.

minotech
Posts: 5
Joined: Sat Apr 09, 2016 10:05 pm

Re: Making last version of FFmpeg work under XP

Post by minotech » Sat Apr 16, 2016 6:33 pm

Glad to help. :) ... You're right, maybe I did not explain myself very well.
THANKS for the reply! I did see the changes that you made them in your original message. Good upgrade. But, that I was able to get it working from your original message; means that you did WELL on it. But, it is kind of reassuring to 'watch it work' (via CMD.EXE window) and give the 'thumbs up' message at the end. (Joking) I actually was concerned that it might say "You've been PUNKED!" ... ;) ... But I decided to risk it!

Anyway, I am pretty sure that I noticed some other 'Die Hard WinXP' USERS (Thread) on here; who have NOT found your solution. I'll aim them over here, and see if they are happy. THANKS again!

CoRoNe
Posts: 24
Joined: Thu Aug 22, 2013 5:14 pm
Contact:

Re: Making last version of FFmpeg work under XP

Post by CoRoNe » Mon Apr 18, 2016 11:57 am

Wow, cdlvcdlv, that works perfectly! Saves me A LOT of trouble and time compiling FFMpeg myself. Thanks a lot!
"The Swiss File Knife" looks like a real interesting piece of software. Might come in handy some day.

manolito
Posts: 26
Joined: Wed Apr 20, 2016 4:02 pm

Re: Making last version of FFmpeg work under XP

Post by manolito » Wed Apr 20, 2016 4:16 pm

Thanks very much for these patching instructions...

The first post says that it only works for static builds, but I just succeeded to make a 32bit shared build work under XP. All I had to do was modify the batch file (replace "-file .exe" with "-file .exe .dll"). I used the patched build under the latest DVDStyler 32-bit, and everything just works.

Can someone confirm that the patch works for shared builds?


Cheers
manolito

cdlvcdlv
Posts: 28
Joined: Tue Mar 15, 2016 9:55 am

Re: Making last version of FFmpeg work under XP

Post by cdlvcdlv » Thu Apr 21, 2016 7:40 pm

Added updateFF.bat. It can be used with other versions of Windows (not just XP).

cdlvcdlv
Posts: 28
Joined: Tue Mar 15, 2016 9:55 am

Re: Making last version of FFmpeg work under XP

Post by cdlvcdlv » Tue Apr 26, 2016 11:59 pm

manolito wrote:All I had to do was modify the batch file (replace "-file .exe" with "-file .exe .dll"). I used the patched build under the latest DVDStyler 32-bit, and everything just works.

Can someone confirm that the patch works for shared builds?
Sorry, I missed out your question. I use XP x64 so I can test the four builds (32 and 64, static and shared). I can confirm the patch works with all four. I'll change the first post with your suggestion.

By the way, to test them I just run the three programs with -version and they print the information flawless. Also, I regularly use the three exes to transcode etc. and, by the time being, I have found no problem with these patched versions. But you can find 3 more function calls with "_s" at the end inside the programs: _gmtime32_s, _localtime32_s and _mktemp_s.

Does anybody know what they are used for? Maybe if you try to use some unusual functionality you still get an error and these calls need to be fixed too. What switches should we add to the command line to produce such an error?

I tried the following and played fine:

Code: Select all

ffplay -i video.mp4 -vf "drawtext='fontfile=c\:\\windows\\Fonts\\arial.ttf:text=%{gmtime\:%c}'"
ffplay -i video.mp4 -vf "drawtext='fontfile=c\:\\windows\\Fonts\\arial.ttf:text=%{localtime\:%c}'"

CoRoNe
Posts: 24
Joined: Thu Aug 22, 2013 5:14 pm
Contact:

Re: Making last version of FFmpeg work under XP

Post by CoRoNe » Sat May 14, 2016 10:28 pm

cdlvcdlv wrote:Also, I regularly use the three exes to transcode etc. and, by the time being, I have found no problem with these patched versions.
I use FFMpeg almost only for remuxing, because my computer is too old for any serious transcoding. So I haven't encoded anything for quite a while. Today when I did some testing with -c:v libx264 another fatal error popped up:
The exception Illegal Instruction
An attempt was made to execute an illegal instruction.
(0xc000001d) occurred in the application at location 0x011e166a.
I have narrowed it down to ffmpeg-20150823-git-1bf76cd-win32-static.7z being the latest working build. ffmpeg-20150825-git-4c39892-win32-static.7z shows the fatal error.
wdsouza1 wrote:Last working version working on Windows XP is ffmpeg-20160227-git-5156578.
Since it concerns a FFMpeg build from august last year and is thus older than the latest working WinXP build, it's a bit off-topic. So sorry for that, but since the error mentions 'illegal instruction' it still might be related.
On the other hand, the build-configuration of both builds is the same, so it might as well be some commit in FFMpeg's source instead of Zeranoe's compiler.
cdlvcdlv wrote:But you can find 3 more function calls with "_s" at the end inside the programs: _gmtime32_s, _localtime32_s and _mktemp_s.

Code: Select all

@FOR %%A IN (/5F676D74696D6533325F73/5F676D74696D6533320000/ /5F6C6F63616C74696D6533325F73/5F6C6F63616C74696D6533320000/ /5F6D6B74656D705F73/5F6D6B74656D700000/) DO (
	sfk176.exe replace ffmpeg-20150825-git-4c39892.exe -binary %%A -yes
)
Just for the sake of it I've tried this as well, but I still get the fatal error.

cdlvcdlv
Posts: 28
Joined: Tue Mar 15, 2016 9:55 am

Re: Making last version of FFmpeg work under XP

Post by cdlvcdlv » Sun May 15, 2016 9:12 am

CoRoNe wrote:Today when I did some testing with -c:v libx264 another fatal error popped up:
The exception Illegal Instruction
An attempt was made to execute an illegal instruction.
(0xc000001d) occurred in the application at location 0x011e166a.
I've used libx264 also without problems but if you provide the full ffmpeg command I could try to reproduce the error.
CoRoNe wrote:I have narrowed it down to ffmpeg-20150823-git-1bf76cd-win32-static.7z being the latest working build. ffmpeg-20150825-git-4c39892-win32-static.7z shows the fatal error.
wdsouza1 wrote:Last working version working on Windows XP is ffmpeg-20160227-git-5156578.
Since it concerns a FFMpeg build from august last year and is thus older than the latest working WinXP build, it's a bit off-topic. So sorry for that, but since the error mentions 'illegal instruction' it still might be related.
On the other hand, the build-configuration of both builds is the same, so it might as well be some commit in FFMpeg's source instead of Zeranoe's compiler.
I agree. Since the error shows also on unpatched versions, odds are that you've find some bug introduced last august. I'd suggest submitting it to https://trac.ffmpeg.org/ providing a way to reproduce the error and the two versions - the last that works and the next that doesn't. The only problem is that you cannot prove that last version does not work without the XP patch (though I'd bet it doesn't) unless you can reproduce the error in Vista or later. It's a tricky situation, as the problem might arise from a combination of factors (e.g. you need to use avisynth or an external filter that interferes in the multimedia chain) along with the versions of ffmpeg.

Post Reply