ffmprovisr icon indicating copy to clipboard operation
ffmprovisr copied to clipboard

compiling from source

Open kieranjol opened this issue 6 years ago • 16 comments

Ben mentioned this as a possibility in https://github.com/amiaopensource/ffmprovisr/issues/351

I think that this could come in very handy for those of us who occasionally need to compile things like mediainfo/ffmpeg/rawcooked/dvdrip(!) when testing out a branch or something.

So I'm thinking of the simplest scenarios like: 'If a project has a configure file, you may just need to cd into the directory that contains the configure script, and run:

./configure && make

and if you wish to install the build so that it is accessible from all folders, you can run make install

However you may need to have several dependencies installed, such as gcc, g++, make, autotools etc. You often just have to keep trying and keep fixing each error that pops up. For example you may get an error saying that libtoolize not found, so a quick google search should let you know how to install that dependency for your operating system. In the case of ubuntu, it is apt install libtool.

kieranjol avatar Nov 08 '18 21:11 kieranjol

I think that is a great idea! Maybe a note for make clean could be helpful too for the times when things take a few tries to get built right.

privatezero avatar Nov 08 '18 21:11 privatezero

YES, make clean has solved my issues a million times. I also notice that mediaarea use autogen a lot, but another tip is that you can often figure out how to build something just by looking at a travis file, for example here's how I build rawcooked: https://github.com/MediaArea/RAWcooked/blob/master/.travis.yml#L44

also here's my awful but effective ubuntu build script for ffmpeg a bunch of other things for when i reinstall ubuntu: https://gist.github.com/kieranjol/116bd33a75cae438cfe125693be50beb

kieranjol avatar Nov 08 '18 22:11 kieranjol

Good idea! It's ages since I've compiled ffmpeg from source - I don't remember specifically, but I assume I just followed the wiki compilation guide. That guide is pretty exhaustive, so there's probably value in having more basic info on compiling from source, preferably something relatively generic that could be applied to other programs than ffmpeg too.

kfrn avatar Nov 08 '18 22:11 kfrn

Yeah, maybe the key skill here is just not being deterred by the build failures due to a missing dependency. I think that linux and maybe OSX have it so much easier than Windows in this regard, as you can use package managers to install most if not all major dependencies. I don't think I've ever successfully built anything on windows :(

kieranjol avatar Nov 09 '18 00:11 kieranjol

Ha, I don't think I've ever even attempted to build something from source on Windows. My advice to Windows users would probably be to use the Linux subsystem. 😆

kfrn avatar Nov 09 '18 02:11 kfrn

Currently it can be done also under Windows 10 Pro and Home with the apps (Ubuntu and Debian tested here). There are a few additional installations to be done, but after that is works like a charm. We have an installation script that configures our new computer, running under Linux, macOS or Windows. I can prepare a PR after the AMIA conference, when nobody else does it before.

retokromer avatar Nov 09 '18 06:11 retokromer

+++++++++++++++++++

ablwr avatar Nov 09 '18 15:11 ablwr

I'd like to see this added and also we should mention that paths need to be changed/updated to point to the locally-compiled ffmpeg rather than the one installed via apt or homebrew, etc. I'm doing that right now! ;D

ablwr avatar Dec 10 '18 15:12 ablwr

Oh I'll add that I think there is value in presenting this as a thing to do and just pointing towards the resources (above) that help do this. Knowing what can be done and where to go is at least 80% of the battle, imo! :potato:

ablwr avatar Dec 10 '18 15:12 ablwr

Update:

  • Linuxbrew has been merged into Homebrew
  • Sadly, all options have been removed from the official Homebrew formula. Yet parameterisable formulae are now available in taps here and here.

retokromer avatar Feb 28 '19 19:02 retokromer

status / thoughts on this?

ablwr avatar Jun 04 '19 00:06 ablwr

Things are becoming better, but there are still a few issues for an easy cross compiling for all common platforms. (I will possibly meet later this week Carl Eugen in Vienna.)

retokromer avatar Jun 04 '19 04:06 retokromer

Tell Carl I say hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

ablwr avatar Jun 04 '19 11:06 ablwr

Update:

  • Terminal on Windows 10 works very well now (I presume, it will be officially launched on 28th May with the Version 2004)

This allows to use the same commands on Linux, macOS and Windows!

retokromer avatar May 24 '20 07:05 retokromer

Update:

  • Terminal on Windows 10 works very well now (I presume, it will be officially launched on 28th May with the Version 2004)

This allows to use the same commands on Linux, macOS and Windows!

That's really cool!

If you'd said a decade ago that Microsoft would now be a big proponent of open-source ...

kfrn avatar Jun 04 '20 06:06 kfrn

Somethink like

git clone "https://git.ffmpeg.org/ffmpeg.git" <path>

cd <path/folder>

#for <patch>; do git apply <patch>; done

./configure --prefix=/usr/local --enable-shared --enable-version3 \
  --cc=clang --enable-gpl --enable-libfreetype --enable-libmp3lame \
  --enable-librubberband --enable-libtesseract --enable-libx264 \
  --enable-libx265 --enable-libxvid --disable-lzma --enable-libopenjpeg \
  --disable-decoder=jpeg2000 --extra-version=$(date +'%F')

make -j <threads>

make -j <threads> install

make clean

with a few explanation would fit?

retokromer avatar Nov 13 '20 15:11 retokromer