SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-07-20 20:19:26

brontosaurusrex
#! Junkie
Registered: 2012-06-15
Posts: 478

compiling ffmpeg with x264 from git

Hi: After this you should end up with super-new ffmpeg version with x264 and deb files that you can install on other machines.
Warning: I am not a compiling expert, but i happen to know some basic stuff around ffmpeg and x264 due to exposure. This is only tested on waldorf.
Whats missing: I am not sure how to deal with making apt/sources to ignore and ban ffmpeg from installing from repos (if i ever mistype in the future, but one can always come back to this debs).

COMPILING
------------------

sudo apt-get remove ffmpeg x264 libx264-dev
sudo apt-get install build-essential checkinstall git texi2html yasm zlib1g-dev pkg-config

cd tmp/

git clone git://git.videolan.org/x264 
cd x264/
./configure --enable-static --enable-shared
make
sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes --fstrans=no --default

cd ..
git clone --depth 1 git://git.videolan.org/ffmpeg 
cd ffmpeg/
./configure --enable-gpl --enable-libx264 --enable-x11grab --enable-nonfree --enable-version3
make
sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default
hash x264 ffmpeg
sudo ldconfig

TESTING
------------------

ffmpeg -i someinput.mp4 -vcodec libx264 -preset medium -tune film -crf 21 -threads 0 -ab 130k -strict experimental out.mp4

sudo apt-get install mplayer mediainfo

mediainfo out.mp4
mplayer out.mp4

optional: BLOCKING APT - somebody should confirm that this is the right thing to do
------------------

gksu geany /etc/apt/preferences

add:

Package: ffmpeg*
Pin: release *
Pin-Priority: -1

Package: x264*
Pin: release *
Pin-Priority: -1

Last edited by brontosaurusrex (2013-03-08 10:54:14)

Offline

Help fund CrunchBang, donate to the project!

#2 2012-07-20 20:55:39

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,703
Website

Re: compiling ffmpeg with x264 from git

Nice that you got it going, but just what is the value of using this new ffmpeg?


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#3 2012-07-20 21:03:37

brontosaurusrex
#! Junkie
Registered: 2012-06-15
Posts: 478

Re: compiling ffmpeg with x264 from git

VastOne, this are important for me: ffmpeg mailing list support is better, prores encoder/decoder, ut-video decoder, experimental AAC encoder included (see example), integrated x264 presets, ALAC encoder/decoder, knowhow to build a 10bit ffmpeg&x264, bash script portability from os x and back..., and more that I cant remember right now.

Last edited by brontosaurusrex (2012-07-20 21:08:15)

Offline

#4 2012-07-21 00:06:44

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 9,001

Re: compiling ffmpeg with x264 from git

I thought ffmpeg was deprecated in Linux...the ones in both Debian Stable and Testing say to use avconv instead, which has the same syntax and does the same thing...


while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.

Online

#5 2012-07-21 00:21:45

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,703
Website

Re: compiling ffmpeg with x264 from git

You are correct ffmpeg on debian packages


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#6 2012-07-21 01:29:03

ivanovnegro
Ivan #000000
Registered: 2011-06-02
Posts: 5,260

Re: compiling ffmpeg with x264 from git

That's interesting territory. AFAIK libav is a fork of ffmpeg and maybe till recently you could install ffmpeg only through deb-multimedia, you still can but official Debian defaults now to libav.

Offline

#7 2012-07-21 01:34:58

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,703
Website

Re: compiling ffmpeg with x264 from git

ffmpeg is still available in Sid, although at a lower version than deb-multimedia


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#8 2012-07-21 02:36:27

ivanovnegro
Ivan #000000
Registered: 2011-06-02
Posts: 5,260

Re: compiling ffmpeg with x264 from git

True but just for a transition to libav. In other words, however, Debian wants you to install libav instead.

Edit: And I still have no idea what is the difference but nevermind, I do not have either of them installed.

Last edited by ivanovnegro (2012-07-21 02:38:23)

Offline

#9 2012-07-21 08:05:43

brontosaurusrex
#! Junkie
Registered: 2012-06-15
Posts: 478

Re: compiling ffmpeg with x264 from git

For a video user ffmpeg or avconvert or blackbox are pretty much the same thing, .... deleted some uninformed info here ....

Last edited by brontosaurusrex (2012-07-21 12:58:02)

Offline

#10 2012-07-21 09:27:07

france75006
Member
From: Paris
Registered: 2010-06-13
Posts: 30

Re: compiling ffmpeg with x264 from git

Interesting post explaining the actual (from his point of view, of course) situation:

http://blog.pkh.me/p/13-the-ffmpeg-liba … ml#content


Asus 1001PX: Debian 6.0.7
HP ProLiant MicroServer: Debian 6.0.7
Lenovo E330: Crunchbang 11

Offline

#11 2012-07-21 09:45:04

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,644

Re: compiling ffmpeg with x264 from git

pvsage wrote:

I thought ffmpeg was deprecated in Linux

It most certainly isn't, just in Debian and Ubuntu, cuz the libav crowd that was on the losing end of the ffmpeg coup is also maintaining mplayer and gang in Debian - this is the whole reason for the Debian multimedia renaming disaster.

Offline

#12 2012-07-21 12:21:50

brontosaurusrex
#! Junkie
Registered: 2012-06-15
Posts: 478

Re: compiling ffmpeg with x264 from git

france75006 wrote:

Interesting post explaining the actual (from his point of view, of course) situation:

http://blog.pkh.me/p/13-the-ffmpeg-liba … ml#content

As a user i had no clue that there are epic battles going on in the background.

Offline

#13 2012-07-21 15:25:12

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 9,001

Re: compiling ffmpeg with x264 from git

france75006 wrote:

Interesting post explaining the actual (from his point of view, of course) situation:

http://blog.pkh.me/p/13-the-ffmpeg-liba … ml#content

That is some seriously frelled up dren, dude.  I guess this would be the real Dark Side of the FLOSS.


while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.

Online

#14 2012-07-21 15:27:04

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,703
Website

Re: compiling ffmpeg with x264 from git

^ Interesting how much like children adults can be...

Wait a minute, children can be taught....  Sorry about that. roll


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#15 2012-07-21 15:34:12

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 9,001

Re: compiling ffmpeg with x264 from git

It is disturbingly reminiscent of sandbox antics...


while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.

Online

#16 2012-07-21 15:35:31

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,703
Website

Re: compiling ffmpeg with x264 from git

^ Indeed.  I have witnessed several great apps turn to dust in the wind because of these same antics.


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#17 2012-08-07 15:28:00

brontosaurusrex
#! Junkie
Registered: 2012-06-15
Posts: 478

Re: compiling ffmpeg with x264 from git

adding fdk-aac
---------------------------------

get source:
http://sourceforge.net/projects/opencor … s/fdk-aac/

similar steps as before +

cd fdk-aac-0.1.0/
autoreconf 
./configure
make
sudo checkinstall --pkgname=fdk-aac --backup=no --deldoc=yes --fstrans=no --default

edit: if you are compiling fdk-aac from git then:

libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf
./configure
...

and compile ffmpeg with

cd ffmpeg/
./configure --enable-gpl --enable-libx264 --enable-libfdk-aac --enable-nonfree --enable-version3 --enable-x11grab
make
 sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default
hash x264 ffmpeg
sudo ldconfig

edit: for a static build: ./configure --enable-gpl --enable-libx264 --enable-x11grab --enable-nonfree --enable-version3 --disable-shared --enable-static --extra-libs=-static --extra-cflags=--static

Last edited by brontosaurusrex (2013-04-21 20:12:00)

Offline

#18 2012-11-24 21:16:49

Freddythunder
Member
Registered: 2012-11-21
Posts: 24

Re: compiling ffmpeg with x264 from git

Hello,

I hope I can ask some questions here..  I've installed #! on an old Windows box that barely worked before - now it's lightning fast!  I've set up the LAMP stack and with some creative port forwarding, it's now on the interwebs.  It's all very exciting that with crunchbang I got everything up and running and wireless in about 2 hours total.  I have some experience working on linux remote but this is the first box that I can physically kick.

My first (of many to come) experiments is setting up webcam(s) to use openCV for motion detection.  I know that all of this is possible.  I found this article that talks about using Motion which needs FFmpeg and video4linux.  I read everything here and now have no desire for libav.

I was about to use the first set of instructions to install ffmpeg, but then the last post about fdk-aac confused me (because I'm new).  Does ffmpeg need that aac encoder required for ffmpeg work?  At this time, I'm mostly interested in recording video via connected webcams and streaming out to the web, preferably with audio.  Could any of you offer a better direction or will this work out pretty good?

Thanks!


Sometimes you run across a problem where regex is the best answer.  Then you have two problems.

Offline

#19 2012-11-24 21:50:27

brontosaurusrex
#! Junkie
Registered: 2012-06-15
Posts: 478

Re: compiling ffmpeg with x264 from git

No, you don't need fdk-aac, its just an option. I have close to 0 experience with webcams, but i'am sure somebody will kick in.

Last edited by brontosaurusrex (2012-11-24 21:52:50)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo