Author Topic: Environment for building ffmpeg  (Read 722 times)

Igor

  • Full Member
  • ***
  • Posts: 118
  • Karma: +12/-0
    • View Profile
Environment for building ffmpeg
« on: September 15, 2025, 07:55:21 pm »
Hi all!
Please write me a list of programs that need to be installed on the system to build the ffmpeg-os2-n4.2.2 package.
I have already compiled this package before, but due to reinstallation of the operating system I lost the list of all the programs needed for this.

Please help me.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5570
  • Karma: +136/-1
    • View Profile
Re: Environment for building ffmpeg
« Reply #1 on: September 15, 2025, 09:55:03 pm »
Depends on how many external libraries you want to link in.
You need the basic compiling setup, gcc, libc-dev, watcom-wlink-hll, kbuild-make. Unix utilities such as sh or bash, sed, tr, grep and whatever I'm forgetting. A run of simple configure should work or show missing utilities.
Always used libs, zlib-dev, bzip2-dev, sdl2-dev.
run configure --help > configure.hlp and examine the configure.hlp file for which ever libs you also want to compile in, build your configure line and use ANPM to find packages supplying the various libs-dev you need, or install ffmpeg with yum and pay close attention to the libs it pulls in and install the dev versions of those.
Ask questions if you have a problem

Igor

  • Full Member
  • ***
  • Posts: 118
  • Karma: +12/-0
    • View Profile
Re: Environment for building ffmpeg
« Reply #2 on: September 16, 2025, 08:59:11 pm »
Thank's!

I see:
Code: [Select]
[I:\ffmpeg-os2-n2.8.17]sh
# make
SYS1086: The following character string is too long:

make: *** [common.mak:57: libavdevice/alldevices.o] Error 1
#

I use Make 4.2.1.

I ran the configure first. It worked without errors.

Running sh make from the command line results in the error: sh: 0: Can't open make

At the same time running sh configure its works.

Any ideas are welcome!

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5570
  • Karma: +136/-1
    • View Profile
Re: Environment for building ffmpeg
« Reply #3 on: September 16, 2025, 11:45:23 pm »
You need to do a "SET MAKESHELL=sh.exe" as make defaults to using cmd.exe or perhaps %COMSPEC% as its shell. I'd suggest setting it in config.sys as most things use sh as the make shell and if needed can always do a "SET MAKESHELL=cmd.exe"
Actually in my config.sys, I have,
Code: [Select]
SET EMXOMFLD_LINKER=wl.exe
SET EMXOMFLD_TYPE=WLINK
SET EMXOMFLD_RC=wrc.exe
SET EMXOMFLD_RC_TYPE=WRC
...
Code: [Select]
SET MAKESHELL=sh.exe
REM [ Default shell values ]
SET SHELL=W:/usr/bin/sh.exe
SET EMXSHELL=W:/usr/bin/sh.exe
SET CONFIG_SHELL=W:/usr/bin/sh.exe
SET EXECSHELL=W:/usr/bin/sh.exe

Adjust path as needed.
Most of these are for auto tools. You probably need the first 2 to set up wl.exe as the linker, though I thought installing the RPM would set this stuff up.

Igor

  • Full Member
  • ***
  • Posts: 118
  • Karma: +12/-0
    • View Profile
Re: Environment for building ffmpeg
« Reply #4 on: September 18, 2025, 08:34:19 pm »
Thank's, Dave!

It works! The make starts.
 
But I see next problem:
Code: [Select]
[I:\ffmpeg-os2-n4.2.2-os2]sh
# make
CC      libavformat/adtsenc.o
./libavcodec/x86/mathops.h: Assembler messages:
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
make: *** [ffbuild/common.mak:59: libavformat/adtsenc.o] Error 1

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5570
  • Karma: +136/-1
    • View Profile
Re: Environment for building ffmpeg
« Reply #5 on: September 19, 2025, 12:18:55 am »
Forgot about nasm, "yum install nasm"
If it still fails, post ffbuild/config.log. Should do a "make distclean" and rerun configure after installing nasm

Igor

  • Full Member
  • ***
  • Posts: 118
  • Karma: +12/-0
    • View Profile
Re: Environment for building ffmpeg
« Reply #6 on: September 20, 2025, 07:40:57 pm »
Hi, Dave

I did everyting exactly, but the error persists.
Please write me your INCLUDE= form config.sys

This is a data type compatibility issue in C code (assembler insert).

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5570
  • Karma: +136/-1
    • View Profile
Re: Environment for building ffmpeg
« Reply #7 on: September 21, 2025, 02:07:11 am »
Hmm. from a clone of ffmpeg, I checked out n4.2.2 and tried your configure arguments. Configure choked on not finding Zomf (your --libs=-Zomf) so I simplified your configure arguments as some of it makes no sense and some is redundant.
Code: [Select]
sh ../src/configure --prefix='/@unixroot/usr/local' --enable-bzlib --disable-crystalhd --enable-libfreetype --enable-fontconfig --enable-libvpx --enable-avfilter --enable-avresample --enable-postproc --enable-gpl --enable-libopus --enable-gnutls --enable-libvorbis --disable-decoder=opus --disable-encoder=opus --disable-avx512 --disable-avx2

I'm doing an out of tree build.
Removed the --disable-debug and --disable-strip as we end up with ffmpeg_g.exe with debug data and ffmpeg.exe which is lxlited, same with the other exe's. If you want DLL's unstripped and no debug data, these can be added back.
Removed the --extra-libs=-Zomf as the build adds -Zomf to LDFLAGS.
Removed the --disable-static --enable-shared as both static and DLL's build fine.
Removed the --target=os/2 as configure should figure that out.
Removed the extra-opt-flags as not sure if needed.
Built fine after a change to usr/include/sys/params.h so ntohl() is found.
Trying your whole configure line, I get,
Code: [Select]
Unknown option "-g".
Remove that, I get,
Code: [Select]
Unknown option "-march=i686'".Remove that, I get,
Code: [Select]
Unknown option ""This is a weird one. I removed all the single quotes as they aren't needed now, and success.
Built fine.
Include isn't used by GCC, used by OW and the IBM compilers. I have,
Code: [Select]
SET INCLUDE=W:\usr\include\os2tk45\inc;W:\usr\include\os2tk45\gl;W:\usr\include\os2tk45;

Where did you get your source? Perhaps do,
Code: [Select]
git clone git://source.ffmpeg.org/ffmpeg
git checkout n4.2.2
and use that.
I changed line 194 of usr/include/sys/param.h from #if 0 to #if 1. It's not correct but works.
Have to compare your config.log to mine later.
Still like to try with the source you're using.