Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with x86 Windows / 32bit MSYS2 #28

Closed
Vangelis66 opened this issue Nov 11, 2014 · 3 comments
Closed

Doesn't work with x86 Windows / 32bit MSYS2 #28

Vangelis66 opened this issue Nov 11, 2014 · 3 comments

Comments

@Vangelis66
Copy link

Hello jb-alvarado :-)
I just joined GitHub solely to report this...
Many thanks for your hard efforts so far and
really sad on your intention to leave this project orphaned...

I am using a Windows Vista SP2 x86 laptop with very little free space on C:/,
so I turned to your script for compiling a non-free version of FFmpeg on
my external HDD F:/.
I have used in the past nu774's script for compiling fdkaac.exe and it worked
like a charm on my setup, so I thought the case would be similar with your script...
I ran media-autobuild_suite.bat and just used the recommended setting for
"64 bit msys2"; it downloaded and extracted fine, only to realize a bit later that it's
(of course) incompatible with my architecture...
Deleted everything and started anew, this time selecting "32 bit msys2"
It also downloaded and extracted fine, but soon your script died
trying to "compile global tools 32bit":


compile global tools 32bit


F:\Compiler\media-autobuild_suite-master\compile_localtools.sh: line 168: wget: command not found
F:\Compiler\media-autobuild_suite-master\compile_localtools.sh: line 169: tar: command not found
rm: cannot remove ‘openjpeg-1.5.2.tar.gz’: No such file or directory
F:\Compiler\media-autobuild_suite-master\compile_localtools.sh: line 171: cd: openjpeg-1.5.2: No such file or directory
F:\Compiler\media-autobuild_suite-master\compile_localtools.sh: line 173: cmake: command not found
F:\Compiler\media-autobuild_suite-master\compile_localtools.sh: line 175: make: command not found
F:\Compiler\media-autobuild_suite-master\compile_localtools.sh: line 176: make: command not found


build openjpeg-1.5.2 failed...
delete the source folder under '/build32' and start again,
or if you know there is no dependences hit enter for continue it
first close the batch window, then the shell window

On the homepage you state it's tested on Win7 (but don't mention x86 or x64),
so I thought Vista was to blame...
I borrowed my sister's laptop with Win7 SP1 x64 and tried to run the script there.
Out of curiosity, since I'm only interested in x86 binaries, I chose to install "32 bit msys2"
as I did in my Vista x86 machine, and ended up getting the same errors...
So Vista was not to blame after all, it appears THERE'S A BUG IN THE SCRIPT WHEN MSYS32 IS USED. I wish it could be fixed somehow so that the script could be used in x86 Windows...

I then started again, using MSYS64 this time on the Win7 x64 machine, and the script executes normally. It stalled in the compilation of gnutls-3.3.3, but your provided solution worked and let it continue (it is still running...). BTW, why have you chosen GnuTLS over PolarSSL?
With GnuTLS, rtmpdump binaries end up quite big... (~ 3.35 MB).
I understand that the script fetches git HEAD FFmpeg sources to compile ffmpeg.exe;
what if I want to compile, say, FFmpeg 2.4.3 with a personal patch of http.c that has not made it to
the git repo? What should I do? I am a complete novice, so bear with me...

I offer my gratitude for all your time and efforts spent in this project.
Vangelis (from Greece)

@jb-alvarado
Copy link
Member

Hi Vangelis,
thanks for the compliment end the error report.
I want to leave this project because it takes to much time, what I don't have and I can not always give support. I think it is only useful for others when somebody take care of it. I like the work on this script, but I need to make different priorities.

Long time I had not tested the 32 bit msys2 version, so I don't saw this error. I think I fix it now. You need to have also in mind, that when it runs and later you want to make a new run and the script starts a msys2 update it can be that after that you have to run the autorebase.bat from the msys32 folder. This is only happen in the 32 bit version, but please don't ask me why :).
I also fix the gnutls issue. I use gnutls because ffmpeg can not use polarssl. For ffmpeg I use the git version, so you always have the newest build, and this is also newer then the point releases from the webpage. When you want to use your own source code for that, take a look in the compile_localtools.sh file, with a little changes you are able to build a other version.

I close here, but when the script not work again, you can write it here to.
Regards
jb_

@Vangelis66
Copy link
Author

Hello again jb-alvarado :-)

Extremely thankful for your immediate response and fix;
I am now running the script on my WinVista SP2 x86 laptop;
I chose 32bit MSYS2 and all went along fine until some 25min later
the script (in the mintty shell) paused while it was installing the
32bit compiler; something about the configuration of fontconfig
or something like that, I do not remember the exact wording...
I killed the shell and the bat command and relaunched the batch script;
It did some "things" and thankfully it proceeded to compile
openjpeg-1.5.2 ....

I said:

what if I want to compile, say, FFmpeg 2.4.3 with a personal patch of http.c
that has not made it to the git repo? What should I do?
I am a complete novice, so bear with me.

You replied:

When you want to use your own source code for that, take a look in the
compile_localtools.sh file, with a little changes you are able to build a other version.

Thanks, but as stated I am completely illiterate when it comes to Linux OS and bash script language.
I have browsed the code with an editor and I can see that @line 1451
do_git "https://github.com/FFmpeg/FFmpeg.git" ffmpeg-git
it connects with git to check/download the sources for ffmpeg...
Can you please be more verbose and offer code that will use the sources
I have previously placed in build32/ffmpeg (and not remove or update them
in the process...)?
I have locally patched the http.c file of FFmpeg 2.4.3 as per here:
https://gist.github.com/caorong/11fff22f7fd279c59a9d
(this addresses bug "https://trac.ffmpeg.org/ticket/3268" which is still open for 10 months)
and I'd like to compile so I can use the binary to access some (foreign)
HLS audio streams on Windows...
I'd be forever indebted to you if you help and it works...
Pardon me for my newbie ignorance, but I follow what Jesus said:
Matthew 7:7
"Ask and it will be given to you; seek and you will find; knock and the door will be opened for you."

I wish you health and all the best in your new goals and endeavours in life...

Vangelis.

@jb-alvarado
Copy link
Member

Ok then here a step by step compiling your own, non free (with libfaac and libfdk-aac) 32 bit, ffmpeg version:

  • open the mintty shell type:
  • when you have already build ffmpeg form git (with my script) first copy this in mintty and run:
    rm -rf $LOCALDESTDIR/include/libavutil
    rm -rf $LOCALDESTDIR/include/libavcodec
    rm -rf $LOCALDESTDIR/include/libpostproc
    rm -rf $LOCALDESTDIR/include/libswresample
    rm -rf $LOCALDESTDIR/include/libswscale
    rm -rf $LOCALDESTDIR/include/libavdevice
    rm -rf $LOCALDESTDIR/include/libavfilter
    rm -rf $LOCALDESTDIR/include/libavformat
    rm -f $LOCALDESTDIR/lib/libavutil.a
    rm -f $LOCALDESTDIR/lib/libswresample.a
    rm -f $LOCALDESTDIR/lib/libswscale.a
    rm -f $LOCALDESTDIR/lib/libavcodec.a
    rm -f $LOCALDESTDIR/lib/libavdevice.a
    rm -f $LOCALDESTDIR/lib/libavfilter.a
    rm -f $LOCALDESTDIR/lib/libavformat.a
    rm -f $LOCALDESTDIR/lib/libpostproc.a
    rm -f $LOCALDESTDIR/lib/pkgconfig/libavcodec.pc
    rm -f $LOCALDESTDIR/lib/pkgconfig/libavutil.pc
    rm -f $LOCALDESTDIR/lib/pkgconfig/libpostproc.pc
    rm -f $LOCALDESTDIR/lib/pkgconfig/libswresample.pc
    rm -f $LOCALDESTDIR/lib/pkgconfig/libswscale.pc
    rm -f $LOCALDESTDIR/lib/pkgconfig/libavdevice.pc
    rm -f $LOCALDESTDIR/lib/pkgconfig/libavfilter.pc
    rm -f $LOCALDESTDIR/lib/pkgconfig/libavformat.pc
  • Then:
  • cd /build32
  • wget --tries=20 --retry-connrefused --waitretry=2 http://ffmpeg.org/releases/ffmpeg-2.4.3.tar.bz2
  • tar xf ffmpeg-2.4.3.tar.bz2
  • cd ffmpeg-2.4.3
  • apply your patch
  • CPPFLAGS='-DFRIBIDI_ENTRY="" ' ./configure --arch=x86 --target-os=mingw32 --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-video --disable-debug --disable-shared --disable-doc --enable-gpl --enable-version3 --enable-runtime-cpudetect --enable-avfilter --enable-bzlib --enable-zlib --enable-librtmp --enable-gnutls --enable-avisynth --enable-frei0r --enable-filter=frei0r --enable-libbluray --enable-libcaca --enable-libopenjpeg --enable-fontconfig --enable-libfreetype --enable-libass --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libsoxr --enable-libtwolame --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvorbis --enable-libvo-aacenc --enable-openal --enable-libopus --enable-libvidstab --enable-libvpx --enable-libwavpack --enable-libxavs --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi --enable-nonfree --enable-libfaac --enable-libfdk-aac --extra-cflags='-DPTW32_STATIC_LIB -DLIBTWOLAME_STATIC -DCACA_STATIC' --extra-libs='-lxml2 -llzma -lstdc++ -lpng -lm -lglib-2.0 -lpthread -lwsock32 -lhogweed -lnettle -lgmp -ltasn1 -lws2_32 -lwinmm -lgdi32 -lcrypt32 -lintl -lz -liconv -lole32' --extra-ldflags='-mconsole -Wl,--allow-multiple-definition'
  • sed -i "s|--target-os=mingw32 --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-video ||g" config.h
  • sed -i "s/ --extra-cflags='-DPTW32_STATIC_LIB -DLIBTWOLAME_STATIC -DCACA_STATIC' --extra-libs='-lxml2 -llzma -lstdc++ -lpng -lm -lglib-2.0 -lpthread -lwsock32 -lhogweed -lnettle -lgmp -ltasn1 -lws2_32 -lwinmm -lgdi32 -lcrypt32 -lintl -lz -liconv -lole32' --extra-ldflags='-mconsole -Wl,--allow-multiple-definition'//g" config.h
  • make #(when you have multicore type behind -j and the number of the cores)
  • make install

The finished ffmpeg bin you found under: /local32/bin-video

You know what Jesus says in Matthew 25,40:
[...] "Anything you did for one of the least important of these brothers of mine, you did for me."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants