Please enter your e-mail address & password to login to the VPS.net customer portal

Our VPS Cloud Community



Go Back   VPS.NET Forums » Public Forums » Tutorials and How-To's
Reply
 
Thread Tools
  #1  
Old 10-02-2009, 10:03 AM
Ditlev Ditlev is offline
The Cloud Keeper
 
Join Date: Feb 2009
Posts: 1,593
Ditlev is on a distinguished road
Send a message via ICQ to Ditlev Send a message via MSN to Ditlev Send a message via Skype™ to Ditlev
Default How-to: install ffmpeg on Debian Lenny from SVN and x264 from GIT

FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec – the leading audio/video codec library. x264 encodes high-quality video superior to other popular encoders.

Installation Guide :
download the following debian package and install it :

Code:
# wget http://www.debian-multimedia.org/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2008.10.16_all.deb

Code:
# dpkg -i debian-multimedia-keyring_2008.10.16_all.deb
Add the following lines to your /etc/apt/source.list :

Code:
# nano /etc/apt/sources.list
Code:
# deb http://www.debian-multimedia.org lenny main
# deb-src http://www.debian-multimedia.org lenny main
update your apt cache :

Code:
# apt-get update
install checkinstall :

Code:
# apt-get install checkinstall
install ffmpeg dependencies :

Code:
# apt-get build-dep ffmpeg
install subversion :

Code:
# apt-get install subversion
download the latest release of ffmpeg using subversion :

Code:
# svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
configure and make ffmpeg :


Code:
# cd ffmpeg/
# ./configure --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libgsm --enable-postproc --enable-libxvid --enable-libfaac --enable-pthreads --enable-libvorbis --enable-libfaad --enable-gpl --enable-x11grab --enable-nonfree
# make
on this step we will use checkinstall to make .deb package of ffmpeg. it makes reinstall and distribution of the package easy.
it will ask you some questions which are quite easy , answer to them and .deb package will be built.

Code:
# checkinstall
when .deb package is built , we can install it , please note you have to replace your own .deb package file name :

Code:
# dpkg -i ffmpeg_20090715-1_amd64.deb
Install x264 (GIT)

Code:
#cd
# git clone git://git.videolan.org/x264.git
# cd x264
# ./configure
# make
# checkinstall --fstrans=no --install=yes --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0ubuntu1" --default
Using FFmpeg and x264
The easiest method for high quality video encoding is by using the libx264 presets that are included with FFmpeg.

Two-Pass encode using the fastfirstpass and hq presets:
Code:
ffmpeg -y -i input.avi -pass 1 -vcodec libx264 -vpre fastfirstpass -b 512k -bt 512k -threads 0 -f mp4 -an /dev/null && ffmpeg -i input.avi -pass 2 -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre hq -b 512k -bt 512k -threads 0 -f mp4 output.mp4
You can add options such as frame size (for example: -s 640x480) or tweak my example settings to customize your encode.

One-pass CRF (Constant Rate Factor) using the hq preset:
Code:
ffmpeg -i input.avi -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre hq -crf 22 -threads 0 output.mp4
Fmpeg x264 encoding guide has more info on the differences of two-pass and CRF. Also see FFmpeg libx264 presets for more preset descriptions and usage.

Two-pass iPod 640x480 using the fastfirstpass, normal, and ipod640 presets:
Code:
ffmpeg -y -i input.avi -pass 1 -vcodec libx264 -vpre fastfirstpass -vpre ipod640 -b 512k -bt 512k -s 640x480 -threads 0 -f ipod -an /dev/null && ffmpeg -i input.avi -pass 2 -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre normal -vpre ipod640 -b 512k -bt 512k -s 640x480 -threads 0 -f ipod output.mp4

Additional Resources
FFmpeg x264 encoding guide
x264 - a free h264/avc encoder
x264 changelog
FFmpeg homepage
FFmpeg revision log
x264 encoding guide
FFmpeg x264 mapping and options guide


Source: HOWTO: Install and use the latest FFmpeg and x264 - Ubuntu Forums & Admins eHow How to install ffmpeg on Debian Lenny from SVN
__________________
a node a day keeps the doctor away...


http://twitter.com/ditlev/ <- follow me on Twitter!
Join the VPS.NET group on LinkedIN

Reply With Quote
  #2  
Old 11-24-2009, 09:50 AM
butler360 butler360 is offline
I Got Nodes
 
Join Date: Oct 2009
Posts: 261
butler360 is on a distinguished road
Default

Thanks for this!

But shouldn't
Code:
# nano /etc/apt/nano sources.list
be
Code:
# nano /etc/apt/sources.list
?
Reply With Quote
  #3  
Old 11-24-2009, 10:36 AM
anthonysomerset anthonysomerset is offline
On Cloud 9
 
Join Date: Sep 2009
Location: London, UK
Posts: 2,993
anthonysomerset is on a distinguished road
Send a message via AIM to anthonysomerset Send a message via MSN to anthonysomerset Send a message via Skype™ to anthonysomerset
Default

yes that must be a typo above
Reply With Quote
  #4  
Old 11-26-2009, 10:04 AM
Ditlev Ditlev is offline
The Cloud Keeper
 
Join Date: Feb 2009
Posts: 1,593
Ditlev is on a distinguished road
Send a message via ICQ to Ditlev Send a message via MSN to Ditlev Send a message via Skype™ to Ditlev
Default

Quote:
Originally Posted by butler360 View Post
Thanks for this!

But shouldn't
Code:
# nano /etc/apt/nano sources.list
be
Code:
# nano /etc/apt/sources.list
?
thanks - post edited
__________________
a node a day keeps the doctor away...


http://twitter.com/ditlev/ <- follow me on Twitter!
Join the VPS.NET group on LinkedIN

Reply With Quote
  #5  
Old 11-29-2009, 11:21 PM
butler360 butler360 is offline
I Got Nodes
 
Join Date: Oct 2009
Posts: 261
butler360 is on a distinguished road
Default

Apparently some changes were made so this guide no longer works (unless I'm just doing something wrong). It looks like some changes were made in the libtheora version so you end up with "Error: libtheora not found." They have changed the guide at HOWTO: Install and use the latest FFmpeg and x264 - Ubuntu Forums and it got me past that error but now I'm stuck at compiling FFMPEG:
Code:
/root/ffmpeg/libavcodec/libavcodec.a(libx264.o): In function `X264_init':
/root/ffmpeg/libavcodec/libx264.c:284: undefined reference to `x264_encoder_open_79'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1
rm ffmpeg.o
That error led me to [FFmpeg-user] make compile errors but I don't know how to fix it so I'm stuck.
Reply With Quote
  #6  
Old 12-31-2009, 03:28 AM
butler360 butler360 is offline
I Got Nodes
 
Join Date: Oct 2009
Posts: 261
butler360 is on a distinguished road
Default

Still having trouble with this. The Ubuntu forum has great instructions but they don't seem to be totally compatible with Debian.
Reply With Quote
  #7  
Old 12-31-2009, 05:41 AM
butler360 butler360 is offline
I Got Nodes
 
Join Date: Oct 2009
Posts: 261
butler360 is on a distinguished road
Default

Seems like I finally got it working following these instructions: http://techsiteblog.com/ffmpeg-and-x264/

Even though they seem to be based on the Ubuntu instructions I failed to make work earlier...
Reply With Quote
Reply

Thread Tools

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How-to: PHP/APC/FPM Install njmattes Tutorials and How-To's 17 03-29-2010 12:57 PM
How-to: Webmin install on debian 5.0 Hans Tutorials and How-To's 22 02-21-2010 06:36 AM
How to Install drupal? rennsix Tutorials and How-To's 65 12-14-2009 07:21 PM
High Availability Configuration Using Debian Lenny jbimmerle Technical discussions 0 09-05-2009 03:26 AM
New Image: Debian 5.0 nullmind Announcements 4 08-01-2009 11:35 AM